Feature request / Focus reset on Treemap during live updates
Chưa có ai nhận issue này.
- 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
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 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