plotly / plotly/plotly.js

add tooltip annotation feature

Offen
#7,054 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature P3
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

Hi,

I would like to propose a tooltip feature.

When exploring data and presenting our findings, it is important to be able to interactively annotate data points. Most popular data analysis software allow to do that.

I wrote a code to introduce this functionality (found in this branch). The tooltip function can be activated by a new modebar button. It allows to add an annotation to every clicked point. By default, tooltips contain x and y coordinates. They can be customized to contain any additional data attached to the trace or points, which makes it a powerful tool for data exploration and presentation.

When a plot is created with editable: true, the tooltips can be dragged around for placement or deleted interactively. Their text can also be edited. To delete a tooltip, click on its text and delete it.

Tooltips can be customized with an optional tooltiptemplate (leverages existing hovertemplate code) and tooltip annotation options (leverages existing annotations code)
331887266-f7258b47-6eb2-4c3c-a3ce-f23899fe57e1
Live example

The JS version is already compatible with Dash when a figure is created with a dictionary passed to dcc.Graph (Dash demo) but not yet with Plotly.py

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem verlinkten dev-tooltip-Branch, seiner README und dem Live-Beispiel und überprüfe anschließend den vorgeschlagenen modebar-Button zusammen mit dem bestehenden Verhalten von annotations und hovertemplate. Die Dash-Demo befindet sich in demo/dash/dash_app_with_tooltip.py. Als erledigt gilt die Aufgabe, wenn das Verhalten der Tooltip-Annotationen, ihre Anpassung, Bearbeitung, ihr Ziehen und Löschen wie beschrieben funktionieren und mit der bestehenden plotly.js-Nutzung kompatibel bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
data-visualization
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.