Skip to content

Instantly share code, notes, and snippets.

@elisedeux
Created April 23, 2018 13:23
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 elisedeux/d5beccb0df093c1b648890ccde0fa7fa to your computer and use it in GitHub Desktop.
Save elisedeux/d5beccb0df093c1b648890ccde0fa7fa to your computer and use it in GitHub Desktop.
// Create the class with a low opacity value
ogma.createClass('faded', {
nodeAttributes: { opacity: 0.2 },
edgeAttributes: { opacity: 0.2 }
});
// Select the nodes and edges that must be faded
const nodesToFade = ogma.getNodes().filter(node => node.getData('type') === 'INVESTOR');
const edgesToFade = nodesToFade.getAdjacentEdges();
// Add the "faded" class and apply it over 500 ms
nodesToFade.addClass('faded', 500);
edgesToFade.addClass('faded', 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment