JupyterDash line shapes incorrect plotted
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
Plotting lines in Plotly and JupyterDash gives a problem. I don't know if the issue is related to Plotly or JupyterDash, depending on which is the expected behaviour.
It did work in a previous version of Plotly.
Versions:
dash==1.17.0
jupyter-dash==0.3.1
plotly==4.12.0
import plotly.graph_objects as go
from dash.dependencies import Input, Output
from jupyter_dash import JupyterDash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import dash_table
x_data = [ 54135, 12346, 75492, 64135, 748612, 31548 ]
fig = go.Figure(go.Scatter(x=x_data, y=[1, 2, 3, 4, 5, 6]))
fig.update_xaxes(
title_text='Segments',
type='category'
)
fig.add_shape(
dict(
type="line",
xref='x', yref='y',
x0=x_data[4], x1=x_data[4],
y0=0, y1=10,
)
)
fig.show()
app = JupyterDash(__name__)
app.layout = html.Div([
dcc.Graph(figure=fig)
])
app.run_server(host='0.0.0.0', port=8003)
But apparently, this gives different results in Plotly as it does in Dash.
Plotly

Dash

(The small part on the left is the zoomed-out result, because the vertical-line was plotted at 31548 (which is the class of the X_data, but Dash seems to regard is as an integer)
This only happened in the latest updates (I used to work with plotly=4.8.0 before this error)
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
Beginne mit der bereitgestellten Python-Reproduktion und vergleiche die Ausgabe von fig.show() mit der Ausgabe von JupyterDash app.run_server() unter Verwendung der aufgeführten Versionen von Plotly, Dash und JupyterDash. Verfolge, wie der kategoriale Wert der x-Achse für die hinzugefügte shape interpretiert wird, und ermittle anschließend, ob die Abweichung zu Plotly oder JupyterDash gehört. Als erledigt gilt die Aufgabe, wenn die vertikale Linie in beiden Ausgaben an der vorgesehenen Kategorie ausgerichtet ist.
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