JupyterDash line shapes incorrect plotted
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 18.8k
- Fork
- 2.8k
- Merge trung bình
- 16 giờ 26 phút
- Pull request đã merge (30 ngày)
- 21
Mô tả
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)
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với bản tái hiện Python được cung cấp và so sánh đầu ra của fig.show() với đầu ra của JupyterDash app.run_server() bằng các phiên bản Plotly, Dash và JupyterDash được liệt kê. Theo dõi cách giá trị phân loại của trục x được diễn giải cho shape được thêm vào, sau đó xác định xem sự khác biệt thuộc về Plotly hay JupyterDash. Công việc được xem là hoàn tất khi đường thẳng đứng căn chỉnh với danh mục mong muốn trong cả hai đầu ra.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- data-visualization
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100