source: node_modules/d3-sankey/src/align.js@ e4c61dd

Last change on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Prototype 1.1

  • Property mode set to 100644
File size: 460 bytes
Line 
1import {min} from "d3-array";
2
3function targetDepth(d) {
4 return d.target.depth;
5}
6
7export function left(node) {
8 return node.depth;
9}
10
11export function right(node, n) {
12 return n - 1 - node.height;
13}
14
15export function justify(node, n) {
16 return node.sourceLinks.length ? node.depth : n - 1;
17}
18
19export function center(node) {
20 return node.targetLinks.length ? node.depth
21 : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1
22 : 0;
23}
Note: See TracBrowser for help on using the repository browser.