Skip to content

Instantly share code, notes, and snippets.

@shakhal shakhal/switcher.js
Last active Aug 29, 2015

What would you like to do?
Cytoscape js layout switcher
$(function(){ // on dom ready
var html = layouts.reduce(function(a,e,i){return a+"<a onclick='setLayout("+i+")'>"+e+"</a> - "},"Layouts:")
}); // on dom ready
var layouts = [ 'concentric',
function setLayout(i){
cy.layout({name: layouts[i]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.