{"id":37028687,"url":"https://github.com/plotly/d3-sankey-circular","last_synced_at":"2026-01-14T03:26:09.134Z","repository":{"id":57137289,"uuid":"167045965","full_name":"plotly/d3-sankey-circular","owner":"plotly","description":"A fork of the d3-sankey library to allow circular links.","archived":true,"fork":true,"pushed_at":"2020-08-17T18:35:27.000Z","size":275,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T06:17:55.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tomshanley/d3-sankey-circular","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plotly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-22T18:31:36.000Z","updated_at":"2025-08-29T05:22:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/plotly/d3-sankey-circular","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/plotly/d3-sankey-circular","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Fd3-sankey-circular","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Fd3-sankey-circular/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Fd3-sankey-circular/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Fd3-sankey-circular/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plotly","download_url":"https://codeload.github.com/plotly/d3-sankey-circular/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotly%2Fd3-sankey-circular/sbom","scorecard":{"id":738041,"data":{"date":"2025-08-11","repo":{"name":"github.com/plotly/d3-sankey-circular","commit":"85bf900c13e55d87f132ace471632a999c022c19"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"45 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-c6rq-rjc2-86v2","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T16:29:26.551Z","repository_id":57137289,"created_at":"2025-08-22T16:29:26.552Z","updated_at":"2025-08-22T16:29:26.552Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T03:26:08.490Z","updated_at":"2026-01-14T03:26:09.121Z","avatar_url":"https://github.com/plotly.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d3-sankey-circular\n\nA fork of the d3-sankey library (https://github.com/d3/d3-sankey) to allow circular links (ie cyclic graphs, like in [this example](https://bl.ocks.org/tomshanley/6f3fcf68c0dbc401548733dd0c64e3c3)).\n\nThe library contains a portion of code from Colin Fergus' bl.ock https://gist.github.com/cfergus/3956043 to detect circular links.\n\n## Install\n\nIf you use NPM, `npm install d3-sankey-circular`.\n\nElse, use the d3-sankey-circular.js file from the \u003ca href=\"https://github.com/tomshanley/d3-sankey-circular/compiled\"\u003ecompiled\u003c/a\u003e folder.\n\n## Usage\n\nvar sankey = d3.sankeyCircular();\n\n## API Reference\n\n\u003cb\u003e*The API follows the original d3-sankey library, with additional options to allow the circular links to be laid out and drawn.*\u003c/b\u003e\n\n\u003ca href=\"#sankey\" name=\"sankey\"\u003e#\u003c/a\u003e d3.\u003cb\u003esankeyCircular\u003c/b\u003e() [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L52 \"Source\")\n\nConstructs a new Sankey generator with the default settings.\n\n\u003ca href=\"#_sankey\" name=\"_sankey\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e(\u003ci\u003earguments\u003c/i\u003e…) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L62 \"Source\")\n\nComputes the node and link positions for the given *arguments*, returning a *graph* representing the Sankey layout. The returned *graph* has the following properties:\n\n* *graph*.nodes - the array of [nodes](#sankey_nodes)\n* *graph*.links - the array of [links](#sankey_links)\n\n\u003ca href=\"#sankey_update\" name=\"sankey_update\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003eupdate\u003c/b\u003e(\u003ci\u003egraph\u003c/i\u003e)\n\nRecomputes the specified *graph*’s links’ positions, updating the following properties of each *link*:\n\n* *link*.y0 - the link’s vertical starting position (at source node)\n* *link*.y1 - the link’s vertical end position (at target node)\n* *link*.circularLinkType - the link's circularLinkType either *top* or *bottom*, depending on whether the center of the connected nodes is above or below the vertical midpoint of the figure.\n\nThis method is intended to be called after computing the initial [Sankey layout](#_sankey), for example when the diagram is repositioned interactively.\n\n\u003ca name=\"sankey_nodes\" href=\"#sankey_nodes\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodes\u003c/b\u003e([\u003ci\u003enodes\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L93 \"Source\")\n\nIf *nodes* is specified, sets the Sankey generator’s nodes accessor to the specified function or array and returns this Sankey generator. If *nodes* is not specified, returns the current nodes accessor, which defaults to:\n\n```js\nfunction nodes(graph) {\n  return graph.nodes;\n}\n```\n\nIf *nodes* is specified as a function, the function is invoked when the Sankey layout is [generated](#_sankey), being passed any arguments passed to the Sankey generator. This function must return an array of nodes. If *nodes* is not a function, it must be a constant array of *nodes*.\n\nEach *node* must be an object. The following properties are assigned by the [Sankey generator](#_sankey):\n\n* *node*.sourceLinks - the array of outgoing [links](#sankey_links) which have this node as their source\n* *node*.targetLinks - the array of incoming [links](#sankey_links) which have this node as their target\n* *node*.value - the node’s value; the sum of *link*.value for the node’s incoming [links](#sankey_links)\n* *node*.index - the node’s zero-based index within the array of nodes\n* *node*.depth - the node’s zero-based graph depth, derived from the graph topology\n* *node*.column - the node’s zero-based depth, as drawn, going from left to right. Column is derived from *node*.depth and the [*sankey*.nodeAlign](#sankey_nodeAlign) setting.\n* *node*.height - the node’s zero-based graph height, derived from the graph topology\n* *node*.x0 - the node’s minimum horizontal position, derived from *node*.column\n* *node*.x1 - the node’s maximum horizontal position (*node*.x0 + [*sankey*.nodeWidth](#sankey_nodeWidth))\n* *node*.y0 - the node’s minimum vertical position\n* *node*.y1 - the node’s maximum vertical position (*node*.y1 - *node*.y0 is proportional to *node*.value)\n* *node*.partOfCycle - set to *true* if the node has incoming or outgoing links that are circular\n* *node*.circularLinkType - set to either *top* or *bottom*, if *node.partOfCycle* is *true*, which relates to whether circular links are drawn above or below the main part of the graph\n\nSee also [*sankey*.links](#sankey_links).\n\n\u003ca name=\"sankey_links\" href=\"#sankey_links\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003elinks\u003c/b\u003e([\u003ci\u003elinks\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L97 \"Source\")\n\nIf *links* is specified, sets the Sankey generator’s links accessor to the specified function or array and returns this Sankey generator. If *links* is not specified, returns the current links accessor, which defaults to:\n\n```js\nfunction links(graph) {\n  return graph.links;\n}\n```\n\nIf *links* is specified as a function, the function is invoked when the Sankey layout is [generated](#_sankey), being passed any arguments passed to the Sankey generator. This function must return an array of links. If *links* is not a function, it must be a constant array of *links*.\n\nEach *link* must be an object with the following properties:\n\n* *link*.source - the link’s source [node](#sankey_nodes)\n* *link*.target - the link’s target [node](#sankey_nodes)\n* *link*.value - the link’s numeric value\n\nFor convenience, a link’s source and target may be initialized using numeric or string identifiers rather than object references; ; see [*sankey*.nodeId](#sankey_nodeId). The following properties are assigned to each link by the [Sankey generator](#_sankey):\n\n* *link*.y0 - the link’s vertical starting position (at source node)\n* *link*.y1 - the link’s vertical end position (at target node)\n* *link*.width - the link’s width (proportional to *link*.value)\n* *link*.index - the zero-based index of *link* within the array of links\n* *link*.circular - set to *true* if the link is circular\n\nFor any links that circular (*link*.circular = *true*), the following properties are assigned\n\n* *link*.circularLinkID - the zero-based index of *link* within the array of circular links\n* *link*.circularLinkType - set to either *top* or *bottom*, which relates to whether the link is drawn above or below the main part of the graph\n* *link*.circularLinkPathData - an object containing the properties used to draw the SVG path, including *link*.circularLinkPathData.path, which is the string used for the *d* property.\n\n\u003ca name=\"sankey_nodeId\" href=\"#sankey_nodeId\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodeId\u003c/b\u003e([\u003ci\u003eid\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L77 \"Source\")\n\nIf *id* is specified, sets the node id accessor to the specified function and returns this Sankey generator. If *id* is not specified, returns the current node id accessor, which defaults to the numeric *node*.index:\n\n```js\nfunction id(d) {\n  return d.index;\n}\n```\n\nThe default id accessor allows each link’s source and target to be specified as a zero-based index into the [nodes](#sankey_nodes) array. For example:\n\n```js\nvar nodes = [\n  {\"id\": \"Alice\"},\n  {\"id\": \"Bob\"},\n  {\"id\": \"Carol\"}\n];\n\nvar links = [\n  {\"source\": 0, \"target\": 1}, // Alice → Bob\n  {\"source\": 1, \"target\": 2} // Bob → Carol\n];\n```\n\nNow consider a different id accessor that returns a string:\n\n```js\nfunction id(d) {\n  return d.id;\n}\n```\n\nWith this accessor, you can use named sources and targets:\n\n```js\nvar nodes = [\n  {\"id\": \"Alice\"},\n  {\"id\": \"Bob\"},\n  {\"id\": \"Carol\"}\n];\n\nvar links = [\n  {\"source\": \"Alice\", \"target\": \"Bob\"},\n  {\"source\": \"Bob\", \"target\": \"Carol\"}\n];\n```\n\n\u003ca name=\"sankey_nodeAlign\" href=\"#sankey_nodeAlign\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodeAlign\u003c/b\u003e([\u003ci\u003ealign\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L81 \"Source\")\n\nIf *align* is specified, sets the node [alignment method](#alignments) the specified function and returns this Sankey generator. If *align* is not specified, returns the current node alignment method, which defaults to [d3.sankeyJustify](#sankeyJustify). The specified function is evaluated for each input *node* in order, being passed the current *node* and the total depth *n* of the graph (one plus the maximum *node*.depth), and must return an integer between 0 and *n* - 1 that indicates the desired horizontal position of the node in the generated Sankey diagram.\n\n\u003ca name=\"sankey_nodeWidth\" href=\"#sankey_nodeWidth\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodeWidth\u003c/b\u003e([\u003ci\u003ewidth\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L85 \"Source\")\n\nIf *width* is specified, sets the node width to the specified number and returns this Sankey generator. If *width* is not specified, returns the current node width, which defaults to 24.\n\n\u003ca name=\"sankey_nodePadding\" href=\"#sankey_nodePadding\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodePadding\u003c/b\u003e([\u003ci\u003epadding\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L89 \"Source\")\n\nIf *padding* is specified, sets the vertical separation between nodes at each column to the specified number and returns this Sankey generator. If *padding* is not specified, returns the current node padding, which defaults to 8.\n\n\u003ca name=\"sankey_nodePaddingRatio\" href=\"#sankey_nodePaddingRatio\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003enodePaddingRatio\u003c/b\u003e([\u003ci\u003eproportion\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L89 \"Source\")\n\nIf *proportion* is specified (from 0 to 1), sets the vertical separation between nodes at each column to the specified number and returns this Sankey generator. The proportion is applied to the most dense column of nodes, and calculates a minimum padding that will be used across the chart.\n\nIf a nodePaddingRatio is not specified, then defaults to the *padding* setting in pixels.\n\n\u003ca name=\"sankey_extent\" href=\"#sankey_extent\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003eextent\u003c/b\u003e([\u003ci\u003eextent\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L105 \"Source\")\n\nIf *extent* is specified, sets the extent of the Sankey layout to the specified bounds and returns the layout. The *extent* bounds are specified as an array \\[\\[\u003ci\u003ex0\u003c/i\u003e, \u003ci\u003ey0\u003c/i\u003e\\], \\[\u003ci\u003ex1\u003c/i\u003e, \u003ci\u003ey1\u003c/i\u003e\\]\\], where *x0* is the left side of the extent, *y0* is the top, *x1* is the right and *y1* is the bottom. If *extent* is not specified, returns the current extent which defaults to [[0, 0], [1, 1]].\n\n\u003ca name=\"sankey_size\" href=\"#sankey_size\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003esize\u003c/b\u003e([\u003ci\u003esize\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L101 \"Source\")\n\nAn alias for [*sankey*.extent](#sankey_extent) where the minimum *x* and *y* of the extent are ⟨0,0⟩. Equivalent to:\n\n```js\nsankey.extent([[0, 0], size]);\n```\n\n\u003ca name=\"sankey_iterations\" href=\"#sankey_iterations\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003eiterations\u003c/b\u003e([\u003ci\u003eiterations\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L109 \"Source\")\n\nIf *iterations* is specified, sets the number of relaxation iterations when [generating the layout](#_sankey) and returns this Sankey generator. If *iterations* is not specified, returns the current number of relaxation iterations, which defaults to 32.\n\n\u003ca name=\"sankey_circularLinkGap\" href=\"#sankey_circularLinkGap\"\u003e#\u003c/a\u003e \u003ci\u003esankey\u003c/i\u003e.\u003cb\u003ecircularLinkGap\u003c/b\u003e([\u003ci\u003ecircularLinkGap\u003c/i\u003e]) [\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankey.js#L109 \"Source\")\n\nIf *circularLinkGap* is specified, sets the gap (in pixels) between circular links that travel next to each other. If *circularLinkGap*, it defaults to 2.\n\n### Alignments\n\nSee [*sankey*.nodeAlign](#sankey_nodeAlign).\n\n\u003ca name=\"sankeyLeft\" href=\"#sankeyLeft\"\u003e#\u003c/a\u003e d3.\u003cb\u003esankeyLeft\u003c/b\u003e(\u003ci\u003enode\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e)\n\nReturns *node*.depth.\n\n\u003ca name=\"sankeyRight\" href=\"#sankeyRight\"\u003e#\u003c/a\u003e d3.\u003cb\u003esankeyRight\u003c/b\u003e(\u003ci\u003enode\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e)\n\nReturns *n* - 1 - *node*.height.\n\n\u003ca name=\"sankeyCenter\" href=\"#sankeyCenter\"\u003e#\u003c/a\u003e d3.\u003cb\u003esankeyCenter\u003c/b\u003e(\u003ci\u003enode\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e)\n\nLike [d3.sankeyLeft](#sankeyLeft), except that nodes without any incoming links are moved as right as possible.\n\n\u003ca name=\"sankeyJustify\" href=\"#sankeyJustify\"\u003e#\u003c/a\u003e d3.\u003cb\u003esankeyJustify\u003c/b\u003e(\u003ci\u003enode\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e)\n\nLike [d3.sankeyLeft](#sankeyLeft), except that nodes without any outgoing links are moved to the far right.\n\n### Links\n\n\u003ca name=\"d.path\" href=\"#d.path\"\u003e#\u003c/a\u003e link\u003cb\u003e.path\u003c/b\u003e[\u003c\u003e](https://github.com/d3/d3-sankey/blob/master/src/sankeyLinkHorizontal.js \"Source\")\n\nEach link has a .path property which stores the svg path **d** string, which can be accessed to draw the path, for example\n\n```js\n\nsvg.append(\"g\")\n    .attr(\"class\", \"links\")\n    .attr(\"fill\", \"none\")\n    .attr(\"stroke-opacity\", 0.2)\n    .selectAll(\"path\");\n    .data(sankey.links)\n    .enter()\n    .append(\"path\")\n        .attr(\"d\", function(d){\n          return d.path;\n        })\n        .style(\"stroke-width\", function (link) { link.width; })\n        .style(\"stroke\", function (link, i) {\n            return link.circular ? \"red\" : \"black\"\n        })\n```\n\nFor normal paths, the path string is created by the d3-shape linkHorizontal function. For circular paths, the path string is calculated to reduced overlaps with other nodes and paths.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotly%2Fd3-sankey-circular","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplotly%2Fd3-sankey-circular","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotly%2Fd3-sankey-circular/lists"}