plotly / plotly/plotly.js

Sankey Diagram : show node labels on the right side of the node

Open
#7,445 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Hi,

I am using go.Sankey and can't find a way to display node labels on the right side of the node. I might have missed something but I came accross the entire documentation.

Situation today:
labels are always on the left side of the node

Wished situation :
labels can be on the right or on the left side of the node, depending on the set up. COuld be usefull to show labels outside of nodes (ie : on the right side of the node for the first layer and on the right side of the node for the last layers).

I am currently using go.Sankey in dash using this code :
sankey_data = go.Sankey(
arrangement="snap",
node=dict(
pad=pad_value,
thickness=20,
label=SankeyChart.get_node_labels_list(),
color=SankeyChart.get_node_color_list(),
x=SankeyChart.get_node_x_list(),
y=SankeyChart.get_node_y_list(),
# align="left",
line=dict(color="black", width=0.5),
),
link=dict(
source=SankeyChart.get_links_source_list(),
target=SankeyChart.get_links_target_list(),
value=SankeyChart.get_links_value_list(),
color=SankeyChart.get_links_color_list(),
),
)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue uses go.Sankey in a Dash configuration; start by locating the Sankey trace and its node-label rendering entry point. Add a configuration that supports left or right placement, including labels outside nodes, and verify both placements for first and last layers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.