allow provision of X coordinates only for Sankey charts
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 18.8k
- Forks
- 2.8k
- Merge moyen
- 16 h 26 min
- PR mergées (30 j)
- 21
Description
This is somewhat of a duplicate of #960 and #1437 but slightly more hopeful :)
The x and y arguments of the nodes dict do successfully control node location, however -- it appears that both arguments must be supplied.
import dash
import dash_core_components as dcc
import dash_html_components as html
f#rom dash.dependencies import Output, Input, State
import plotly.graph_objs as go
#import pandas as pd
app = dash.Dash()
app.layout = html.Div([
dcc.Graph(
id = 'wut',
figure={
'data' : [
dict(
type='sankey',
#domain =
arrangement = 'fixed',
node = dict(
pad = 15,
thickness = 20,
line = dict(color = "black", width = 0.5),
label = ["A1", "A2", "B1", "B2", "C1", "C2"],
x = [0.1, 0.2, 0.24, 0.7, 0.8, .9],
y = [0, .2, .3, .4, .5, .6],
color = "blue"
),
link = dict(
source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A2, B1, ...
target = [2, 3, 3, 4, 4, 5],
value = [8, 4, 2, 8, 4, 2]
))
]}
)])
if __name__ == '__main__':
app.run_server(debug=True)
VS.
import dash
import dash_core_components as dcc
import dash_html_components as html
f#rom dash.dependencies import Output, Input, State
import plotly.graph_objs as go
#import pandas as pd
app = dash.Dash()
app.layout = html.Div([
dcc.Graph(
id = 'wut',
figure={
'data' : [
dict(
type='sankey',
#domain =
arrangement = 'fixed',
node = dict(
pad = 15,
thickness = 20,
line = dict(color = "black", width = 0.5),
label = ["A1", "A2", "B1", "B2", "C1", "C2"],
###x = [0.1, 0.2, 0.24, 0.7, 0.8, .9],
y = [0, .2, .3, .4, .5, .6],
color = "blue"
),
link = dict(
source = [0, 1, 0, 2, 3, 3], # indices correspond to labels, eg A1, A2, A2, B1, ...
target = [2, 3, 3, 4, 4, 5],
value = [8, 4, 2, 8, 4, 2]
))
]}
)])
if __name__ == '__main__':
app.run_server(debug=True)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Aucun fichier ni test n’est nommé. Reproduisez les deux exemples Sankey de l’Issue, puis suivez l’endroit où sont gérées les coordonnées des nœuds Sankey afin de déterminer pourquoi x nécessite actuellement y. La tâche est terminée lorsqu’un graphique Sankey avec arrangement défini sur fixed accepte des coordonnées x sans y et préserve le comportement documenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- data-visualization
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100