0

I have been using cytoscape.js library to develop an application, but the extension layout cose-bilkent is working fine in google chrome, but the same code gives an error in Internet Explorer.

I am getting SCRIPT5009: 'Set' is undefined error in th IE debugger. Please advise what I might be missing.

Image with error in cose-bilkent.js file

Chetna
  • 1
  • 2
  • Hi, could you please add the section in your code, which is causing this problem? Thanks :) Judging by the browser you want to use, the mistake is probably not on your side, IE isn't really supported by cytoscape. – Stephan T. Jul 31 '18 at 05:58
  • Hi @Stephan T. , Thanks for the reply. PFA the screenshot of error in cose-bilkent.js file of cytoscape.js, a few layout extensions like Arbor is working fine in both IE and chrome. Also there is no error in my code. – Chetna Aug 01 '18 at 10:36

1 Answers1

0

This is a very common mistake (not yours, its the ie that is broken). IE doesn't support either Map or Set (expect for their "basic support"). You can see that here.

import 'core-js/es6/map';
import 'core-js/es6/set';

If you want to use it, there may be some workarounds with requireJS or polyfill, but using edge or ANY other browser than good ol' IE would do the trick...

Stephan T.
  • 5,843
  • 3
  • 20
  • 42
  • Thanks Stephen. Could you please shed some light on how to use the extensions? I am using Maven framework and I am a bot confused about the registering concept of extensions. The index.js of all the layouts consists of the following code - – Chetna Aug 14 '18 at 04:51
  • const impl = require('./layout'); // registers the extension on a cytoscape lib ref let register = function( cytoscape ){ if( !cytoscape ){ return; } // can't register if cytoscape unspecified cytoscape( 'layout', 'dagre', impl ); // register with cytoscape.js }; if( typeof cytoscape !== 'undefined' ){ // expose to global cytoscape (i.e. window.cytoscape) register( cytoscape ); } module.exports = register; – Chetna Aug 14 '18 at 04:58
  • If you take a look at the [documentation](https://github.com/cytoscape/cytoscape.js/tree/master/documentation/demos/cose-bilkent-layout) provided by cytoscape, you see how to initialize cytoscape. – Stephan T. Aug 14 '18 at 06:10
  • I saw the documentation, could please advise the correct way of using an extension like popper in Cytoscape. Downloading an including popper.js and cytoscape-popper.js in the script tag of index.html doesn't work. – Chetna Aug 16 '18 at 09:53