plotly / plotly/plotly.py

add label alignment in nodes in Sankey plot

Open
#3,080 5 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature P3
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Dear devs,

Recently, I have been playing around with Sankey plots in plotly. This tool is really great. I have been looking for a specific feature that I couldn't find in the API and in fact I believe it does not exist, yet.
Would it be possible to specifiy the alignment of the labels in the nodes of a sankey plot?
Specifically in vertical orientation, I believe the nodes would look much prettier, if the label may be horizontally aligned with the box.

I would imagine additional keywords for the node-dictionary like "horizontalalignment" and "verticalalignment".
(As it is the case for matplotlib textboxes :
https://matplotlib.org/3.1.1/tutorials/text/text_props.html)

Possibly, this is actually easily implemented, but I could not really figure out, how to do that myself.

Is it possible to add this feature?

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 concerns adding horizontal and vertical label alignment to Sankey node labels, but it names no source files, tests, or entry points. Start by locating the Sankey node API and reviewing the linked Matplotlib text-property reference; done means the alignment options are supported and documented for vertically oriented Sankey plots.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.