allow provision of X coordinates only for Sankey charts
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 18.8k
- Forks
- 2.8k
- Merge medio
- 16 h 26 min
- PR fusionados (30 d)
- 21
Descripción
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)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
No se nombran archivos ni tests. Reproduce los dos ejemplos de Sankey del Issue y, a continuación, sigue dónde se gestionan las coordenadas de los nodos de Sankey para determinar por qué x requiere actualmente y. La tarea estará terminada cuando un gráfico de Sankey con arrangement establecido en fixed acepte coordenadas x sin y y conserve el comportamiento documentado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-visualization
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100