plotly / plotly/plotly.py

provide hovermode compare

Đang mở
#1,731 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

feature P3
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ả

I want hover a position show all data accross vertical line, like :
image

I found javascript version have this https://github.com/plotly/plotly.js/issues/2155#issuecomment-351393616

But hovermode='compare' got error

ValueError: 
    Invalid value of type 'builtins.str' received for the 'hovermode' property of layout
        Received value: 'compare'

    The 'hovermode' property is an enumeration that may be specified as:
      - One of the following enumeration values:
            ['x', 'y', 'closest', False]

PS: I really think bokeh's hovertool is much better than plotly , at least they put all hover relative things in one place with examples , easy to found what you want, simply add mode='vline' would work

HoverTool(
    tooltips=[
        ( 'date',   '@date{%F}'            ),
        ( 'close',  '$@{adj close}{%0.2f}' ), # use @{ } for field names with spaces
        ( 'volume', '@volume{0.00 a}'      ),
    ],
    formatters={
        'date'      : 'datetime', # use 'datetime' formatter for 'date' field
        'adj close' : 'printf',   # use 'printf' formatter for 'adj close' field
                                  # use default 'numeral' formatter for other fields
    },
    # display a tooltip whenever the cursor is vertically in line with a glyph
    mode='vline
')

plotly document contain many things but didn't group well, find a solution is not easy .

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

So sánh hành vi của plotly.js được tham chiếu trong issue #2155 với các giá trị layout hovermode được plotly.py chấp nhận, bắt đầu từ phần validation hiện đang từ chối 'compare'. Xác nhận hành vi hover theo chiều dọc mong muốn giữa các traces và kiểm tra rằng giá trị được hỗ trợ tạo ra phần hiển thị được yêu cầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, python
Lĩnh vực
data-visualization
Loại issue
Tính năng
Độ 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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.