Title: Explicit node coordinates (x/y positions) not fully respected in Sankey diagram · Issue #7758 · plotly/plotly.js · GitHub
Open Graph Title: Explicit node coordinates (x/y positions) not fully respected in Sankey diagram · Issue #7758 · plotly/plotly.js
X Title: Explicit node coordinates (x/y positions) not fully respected in Sankey diagram · Issue #7758 · plotly/plotly.js
Description: We (@janosh) are trying to generate a Sankey diagram but for some reason the explicit coordinates are not fully respected. The "right_a" node has a coordinate of (0.9, 0.05) (top right), but for some reason shows at bottom left. plotly 6...
Open Graph Description: We (@janosh) are trying to generate a Sankey diagram but for some reason the explicit coordinates are not fully respected. The "right_a" node has a coordinate of (0.9, 0.05) (top right), but for so...
X Description: We (@janosh) are trying to generate a Sankey diagram but for some reason the explicit coordinates are not fully respected. The "right_a" node has a coordinate of (0.9, 0.05) (top right), ...
Opengraph URL: https://github.com/plotly/plotly.js/issues/7758
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Explicit node coordinates (x/y positions) not fully respected in Sankey diagram","articleBody":"We (@janosh) are trying to generate a Sankey diagram but for some reason the explicit coordinates are not fully respected. The \"right_a\" node has a coordinate of `(0.9, 0.05)` (top right), but for some reason shows at bottom left.\n\nplotly 6.3.1, macos 26.0.1\n\n```python\nimport plotly.graph_objects as go\n\n\nlabels = [\"left_a\", \"left_b\", \"left_c\", \"left_d\", \"left_e\", \"left_f\", \"left_g\", \"left_h\", \"left_i\", \"left_j\", \"left_k\", \"left_l\", \"left_m\",\n \"left_n\", \"left_o\", \"left_p\", \"left_q\", \"left_r\",\n \"right_a\", \"right_b\", \"right_c\", \"right_d\", \"right_e\", \"right_f\", \"right_g\", \"right_h\", \"right_i\", \"right_j\", \"right_k\", \"right_l\"]\n\nnode_pos = {\n \"left_a\": (0.1, 0.1), \"left_b\": (0.1, 0.14), \"left_c\": (0.1, 0.18), \"left_d\": (0.1, 0.23),\n \"left_e\": (0.1, 0.27), \"left_f\": (0.1, 0.31), \"left_g\": (0.1, 0.35),\n \"left_h\": (0.1, 0.40), \"left_i\": (0.1, 0.44), \"left_j\": (0.1, 0.48),\n \"left_k\": (0.1, 0.52), \"left_l\": (0.1, 0.56), \"left_m\": (0.1, 0.61),\n \"left_n\": (0.1, 0.65), \"left_o\": (0.1, 0.69), \"left_p\": (0.1, 0.73),\n \"left_q\": (0.1, 0.77), \"left_r\": (0.1, 0.82),\n \"right_a\": (0.9, 0.05),\n \"right_b\": (0.9, 0.15), \"right_c\": (0.9, 0.25), \"right_d\": (0.9, 0.35), \"right_e\": (0.9, 0.45), \"right_f\": (0.9, 0.55), \"right_g\": (0.9, 0.65),\n \"right_h\": (0.9, 0.75), \"right_i\": (0.9, 0.85), \"right_j\": (0.9, 0.93), \"right_k\": (0.9, 0.97), \"right_l\": (0.9, 0.99)}\n\nsources = [0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10,\n 10, 10, 11, 12, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 18, 18, 18, 19, 19, 19, 19, ]\n\ntargets = [23, 21, 20, 26, 30, 20, 24, 22, 21, 20, 20, 25, 29, 22, 22, 29, 20, 20, 22, 25, 24, 29, 20, 22, 29, 21, 21, 20, 24, 30, 22,\n 20, 20, 21, 25, 22, 30, 28, 24, 29, 20, 21, 24, 20, 20, 22, 20, 23, 21, 24, 31, 25, 21, 22, 20, 23, 30, 27, 26, 24, 21, 20, 22,\n 23, 30, 25, 20, 21, 22, 20, 21, 25, 20, 22, 21, 24, ]\nvalues = [1 for _ in targets]\nassert len(sources) == len(targets) == len(values)\n\nx_positions: list[float] = [node_pos[lbl][0] for lbl in labels]\ny_positions: list[float] = [node_pos[lbl][1] for lbl in labels]\n\nfig = go.Figure(\n go.Sankey(\n arrangement=\"fixed\",\n node=dict(\n label=labels,\n x=x_positions,\n y=y_positions,\n ),\n link=dict(\n source=sources,\n target=targets,\n value=values,\n ),\n )\n)\n\n# fig.show()\n\nfig.write_image(\"debug.svg\", format=\"svg\")\n```\n\n\n\n\n\n\n","author":{"url":"https://github.com/DanielYang59","@type":"Person","name":"DanielYang59"},"datePublished":"2025-10-25T16:19:22Z","url":"https://github.com/plotly/plotly.js/issues/7758"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b6c3cfa7-2778-f9fd-3813-3117f2836a6d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A64A:1087D4:27BC15B:351F8EF:6B01B6B7 |
| html-safe-nonce | 618255902a6444a026843dd1747049e753c78fc22a1274d3c4f2a59897e27557 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjRBOjEwODdENDoyN0JDMTVCOjM1MUY4RUY6NkIwMUI2QjciLCJ2aXNpdG9yX2lkIjoiNTg4NDQyODMwMzQwOTk4NTIwNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fd2fd40e77e6d30d5efcf6be004255199f4a90d1f614fbdf7de57f0c6bdf8862 |
| hovercard-subject-tag | issue:4284141996 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.js/7758/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42f9927a57847bd0c1acaf8c15ae2bb66003306e038e35e5c50a6e12c290a4af/plotly/plotly.js/issues/7758 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42f9927a57847bd0c1acaf8c15ae2bb66003306e038e35e5c50a6e12c290a4af/plotly/plotly.js/issues/7758 |
| og:image:alt | We (@janosh) are trying to generate a Sankey diagram but for some reason the explicit coordinates are not fully respected. The "right_a" node has a coordinate of (0.9, 0.05) (top right), but for so... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DanielYang59 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width