plotly / plotly/plotly.js

Feature request / Focus reset on Treemap during live updates

Aperta
#7,464 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature P3
Lingua principale
JavaScript
Stelle
18.3k
Fork
2k
Merge medio
2g 12h
PR unite (30g)
28

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia tracciando gli aggiornamenti del treemap di Plotly.js quando cambiano gli array ids, parents e labels, usando come riferimento lo scenario di aggiornamento in tempo reale descritto e il comportamento attuale di focus/pathbar. Il lavoro è completato quando il nodo selezionato rimane focalizzato dopo gli aggiornamenti se esso e i suoi nodi figli esistono ancora, mentre la navigazione e il pathbar rimangono coerenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
data-visualization, frontend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.