plotly / plotly/plotly.js

Customized Click, Hover, and Selection Styles or Traces

オープン
#1,847 コメント 31 件 リアクション 34 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

feature P3
主要言語
JavaScript
スター
18.3k
フォーク
2k
平均マージ
2日 12時間
マージ済み PR(30日)
28

説明

Plotly.js has default styles for hovering (tooltips) and for selection (dimmed traces).

In Dash, users want to be able to customize these styles. While they can customize these styles themselves through Dash callbacks, it's slow (roundtrip to server). And while I could write this behaviour into the Dash Graph component, it would be great if this was standard behaviour that everyone could benefit from.

Here are some examples that customized interaction styles or traces could enable.


As requested in the Dash community forum

d3827b8cd525b5f9b5111d4b93f1e336534043c5

For this example, there was some "animation fading" implemented, this is, why the line seems to be slightly behind the mouse. But I guess it's clear to see what kind of performance, I was hoping to get by Dash.
I think, it would be really nice, if there are efforts to improve these kind of animations, because I think they are used in many data visualization tools (having a moving maker I mean).
There is this built-in Plotly "Toggle Spike Lines" function in each Graph, that does nearly what I want and is pretty fast, but not customizable.

In addition to this example, users might want to:

  • Make the points larger
  • Make the lines that they're hovering over thicker
  • Add text to the points they're hovering over
  • Add shapes the points their hovering over (vertical or horizontal line shapes)
  • Outline countries in maps

capture d ecran 2017-07-04 a 13 04 29


In this Uber Rides Dash demo created by @alishobeiri, the selected bars are replotted to be white. This persistent style informs the user which bars are selected and also matches the color palette of app itself.

selected-bars

While selected markers have a "dimming" effect, some users will want to customize the style of the selected points and the unselected points. For example, they might want to:

  • Hide the unselected points
  • Display text to the selected points (mode: "markers+text")
  • Modify the colors of either selection
  • Add an outline to points or countries instead of fading

selected-regions


In BI platforms, "clicking" is often used for drill downs. While we support click events, we don't modify the look and feel of the graph after clicking. For example, users might want to display constant text when clicking on a point.

In addition, there are a few other default style changes for clickable points (this could be a separate issue):

  • Modify the hover interaction of the point to make it seem more "clickable": adding cursor: pointer and making the point a little bit larger
  • Displaying an "x" over the point so that the user can "unclick" a point

capture d ecran 2017-07-04 a 13 05 19
capture d ecran 2017-07-04 a 13 05 16
capture d ecran 2017-07-04 a 13 05 51


I'm sure there are many more examples out there.

cc @alexcjohnson @etpinard @cpsievert @monfera @jackparmer

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、Plotly.js の hover、選択、クリックの各インタラクションのエントリーポイントを確認します。この issue では特定のファイルやテストは指定されていません。サポートするカスタマイズの範囲と、hover 中、選択済み、未選択、クリックされたポイントに対する挙動を定義し、その後、要求されたスタイルが Dash の callback roundtrip なしで機能することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
data-visualization
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
18/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。