plotly / plotly/plotly.js

Feature request / Focus reset on Treemap during live updates

未關閉
#7,464 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature P3
主要語言
JavaScript
星號
18.3k
分支
2k
平均合併
2 天 12 小時
30 天內合併 PR
28

描述

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先追蹤 Plotly.js treemap 在 ids、parents 與 labels 陣列變更時的更新,並以所描述的即時更新情境以及目前的 focus/pathbar 行為作為參考。完成的標準是:更新後,只要選取的節點及其子節點仍然存在,該節點就會維持焦點,同時導覽和 pathbar 保持一致。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
data-visualization, frontend
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。