Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
d3-sankey
Advanced tools
Readme
D3 4.0 implementation of the Sankey plugin to visualize the flow between nodes in a directed acyclic network.
If you use NPM, npm install d3-sankey
. Otherwise, download the latest release.
Here is Mike Bostock's famous example recreated with d3-sankey.
The dependencies are listed in the package.json file, so all you need to do to recreate the example is clone or download the block, run npm install
and then smush your JS together with d3smush
.
# sankey()
Constructs a new sankey generator with the default settings.
# sankey.nodeWidth([width])
If width is specified, sets the node width to the specified function or number and returns this sankey generator. If width is not specified, returns the current node width accessor, which defaults to:
function nodeWidth() {
return 24;
}
# sankey.nodePadding([padding])
If padding is specified, sets the node padding to the specified function or number and returns this sankey generator. If padding is not specified, returns the current node padding accessor, which defaults to:
function nodePadding() {
return 8;
}
Here padding refers to the vertical space between nodes that occupy the same horizontal space.
# sankey.nodes([nodes])
If nodes is specified, sets the list of nodes to the specified function or array and returns this sankey generator. If nodes is not specified, returns the current accessor to the list of nodes, which defaults to:
function nodes() {
return [];
}
# sankey.links([links])
If links is specified, sets the list of links to the specified function or array and returns this sankey generator. If links is not specified, returns the current accessor to the list of links, which defaults to:
function links() {
return [];
}
# sankey.layout([iterations])
Returns the current accessor to the SVG layout object. Here iterations is the number of times the converging function computeNodeDepths is run.
# sankey.relayout()
Similar to layout but only recalculates the depth of links. Primarily used when a node is moved vertically.
FAQs
Visualize flow between nodes in a directed acyclic network.
The npm package d3-sankey receives a total of 623,549 weekly downloads. As such, d3-sankey popularity was classified as popular.
We found that d3-sankey demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).