Created
April 23, 2018 13:23
-
-
Save elisedeux/d5beccb0df093c1b648890ccde0fa7fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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