Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Last active October 17, 2017 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvas0004/231b2ffc27d928096804d2d4fddd775e to your computer and use it in GitHub Desktop.
Save dvas0004/231b2ffc27d928096804d2d4fddd775e to your computer and use it in GitHub Desktop.
external_nodes = [["1.1.1.1", 0.23],["2.2.2.2", 0.85], ...] //sample data - in reality you'd probably get this from an API
external_nodes.forEach(function(element){
const label = element[0];
const confidence = element[1];
cytoscape_elements.push({
data: {
id: label,
label: label,
confidence: node_color_scale(confidence)
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment