Plotly.js: [Enhancement] Legend and traces toggling

Created on 21 Jun 2016  路  10Comments  路  Source: plotly/plotly.js

It will be nice if the legend could span to two or more columns and the ability to turn off all the traces expect for the one being double clicked.

Live example from the nvd3 library (http://www.nvd3.org/examples/stackedArea.html)

Thanks in advance
Erlind

discussion needed feature

All 10 comments

PR https://github.com/plotly/plotly.js/pull/871 attempt to add this feature using a distinct double click interaction.

I'd prefer adding a legend attribute (maybe interaction: ['toggle', 'isolate', false]`) to archive this, but I'm open to suggestions.

A new attempt at the double click interaction: #1432

@etpinard I think I prefer double click actually - the decision about whether to toggle or isolate seems like it should be more user-driven than developer-driven, so making it an attribute would limit viewers' ability to interact as they please. The downside seems to me to be discoverability, but once you do discover it, isolating that trace/group seems intuitive as kind of "stronger than a single click." #1432 looks like a good start, so I'll review it.

Related to this, but not sure if it should be a separate request. I would like to suggest a 3-way toggling so that an entry can be on, off or highlighted. Sometimes, when trying to visually analyze a subset of plots in a crowded graph it might help to either dim the rest or just make a selected few stand out? So you still want the context of the other plots for comparison just not at the same visibility level as the selected subset.

I'd recommend doing something like that with a hover interaction, for example: http://c3js.org/samples/timeseries.html

Probably best as a separate issue though.

Thanks @rpaskowitz. Almost exactly what I was thinking only with a little more persistence so that one can have multiple highlighted. I will start up a new issue.

Should be doable using plotly_legendclick and plotly_legenddoubleclick added in https://github.com/plotly/plotly.js/pull/2581

A related feature that would be nice is if you could set a group of traces in which only one of those traces could be active at a time. So if I have traces A, B, C, and D, I could set A, B, C to be in a group so that only one could be on at once. If I have A and D on, then turning on B or C would turn off A.

following

Was this page helpful?
0 / 5 - 0 ratings