node positions do not work with link value zero in Sankey
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 18.8k
- Forks
- 2.8k
- Ø Merge
- 16 Std. 26 Min.
- Gemergte PRs (30 T.)
- 21
Beschreibung
Hello,
I'm new to the plot.ly lib but I already discovered an issue.
If there is a node with:
- no links
- only links with the value of zero
the manual positioning doesn't work anymore except if you delete the relating coordinates of this node and keep the node in the list (see third example).
Below you can find a short testing code with the generated output.
working example
import plotly.graph_objects as go
data=go.Sankey(
arrangement = "freeform",
node = {
"label": ["A", "B", "C", "D", "E", "F"],
"x": [0.2, 0.1, 0.9, 0.7, 0.3, 0.9],
"y": [0.1, 0.9, 0.2, 0.1, 0.9, 0.9],
'pad':100}, # 10 Pixels
link = {
"source": [0, 0, 1, 4, 4, 3, 3],
"target": [1, 3, 4, 3, 5, 2, 5],
"value": [3, 3, 5, 4, 10, 1, 7 ]})
fig_sankey = go.Figure(data=data)
fig_sankey.show()

node with only one link with value of zero
import plotly.graph_objects as go
data=go.Sankey(
arrangement = "freeform",
node = {
"label": ["A", "B", "C", "D", "E", "F"],
"x": [0.2, 0.1, 0.9, 0.7, 0.3, 0.9],
"y": [0.1, 0.9, 0.2, 0.1, 0.9, 0.9],
'pad':100}, # 10 Pixels
link = {
"source": [0, 0, 1, 4, 4, 3, 3],
"target": [1, 3, 4, 3, 5, 2, 5],
"value": [3, 3, 5, 4, 10, 0, 7 ]})
fig_sankey = go.Figure(data=data)
fig_sankey.show()

kind of working again cause coordinates of C are deleted
import plotly.graph_objects as go
data=go.Sankey(
arrangement = "freeform",
node = {
"label": ["A", "B", "C", "D", "E", "F"],
"x": [0.2, 0.1, 0.7, 0.3, 0.9],
"y": [0.1, 0.9, 0.1, 0.9, 0.9],
'pad':100}, # 10 Pixels
link = {
"source": [0, 0, 1, 4, 4, 3, 3],
"target": [1, 3, 4, 3, 5, 2, 5],
"value": [3, 3, 5, 4, 10, 0, 7 ]})
fig_sankey = go.Figure(data=data)
fig_sankey.show()

Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie damit, die bereitgestellten Python-Sankey-Beispiele auszuführen und die freie Positionierung zu vergleichen, wenn ein Link den Wert null hat. Verfolgen Sie den Sankey-Rendering-Pfad von der Python-Abbildungsdefinition bis zu der Komponente, die die Knotenpositionen verarbeitet. Als erledigt gilt die Aufgabe, wenn manuelle Koordinaten für Knoten ohne Links oder mit ausschließlich Links mit dem Wert null weiterhin wirksam sind und ein Regressionstest beide Fälle abdeckt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100