Khouloud
Khouloud

Reputation: 111

Rendering cytoscape graph in div position

I would like to render a cytoscape graph to a div position. In the documentation, I just found how it can be rendered to dom.

What about a specific div ?

Upvotes: 0

Views: 802

Answers (1)

Ivan
Ivan

Reputation: 789

You can render this to any DOM element including DIV:

var cy = cytoscape({
  container: document.getElementById('your-div-id-here'),

  ...your parameters here...
});


// or (but then getting the cy reference is more difficult)
$('#your-div-id-here').cytoscape({
  ...your parameters here...
});

Here is the working example: fiddle

Upvotes: 1

Related Questions