plotly / plotly/plotly.js

Feature request / Focus reset on Treemap during live updates

Đang mở
#7,464 0 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
JavaScript
Star
18.3k
Fork
2k
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Mô tả

Context

I'm using Plotly's treemap in real-time web application where data is updated frequently.
The visualization represents a hierarchical dataset, and I allow users to interact with it by clicking on a bloc to focus on a specific branch

Problem

Currently, every time I update the data (specifically the ids, parents, and labels arrays), the focus resets back to the root of the treemap. This breaks the user experience since the user is forced back to the top level, even if they were navigating deeper into the tree.

Expected Behavior

Ideally, I want the treemap to preserve the current focus when the tree is updated (as long as the selected node and its children are still present in the data). I haven't found a configuration like rootId / focusId option that persists focus across updates in treemaps.

Current workaround

One potential workaround I'm exploring is to reconstruct a filtered version of the tree manually, by :

  • Extracting the clicked node and all of its descendants
  • Overidding their parents fields so the focused node become the new root
  • Updating the plot with this "subtree" only

That should works, but it adds quite a bit complexity to the data processing. In addition, I don't know how to manage pathbar

Request

Is there currently a configuration way to preserve the focus state across data updates in a treemap plot ?

Environment
  • Library : Plotly.js (with react class)
  • Plot type : treemap
  • Use case : real-time updates + interactive navigation

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

Bắt đầu bằng cách theo dõi các lần cập nhật treemap của Plotly.js khi các mảng ids, parents và labels thay đổi, sử dụng kịch bản cập nhật trực tiếp đã mô tả và hành vi focus/pathbar hiện tại làm tham chiếu. Được xem là hoàn thành khi node được chọn vẫn giữ focus sau các lần cập nhật nếu nó và các node con của nó vẫn còn tồn tại, đồng thời việc điều hướng và pathbar vẫn nhất quán.

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, react
Lĩnh vực
data-visualization, frontend
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
38/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.