Skip to content

Heatmap (density) plot in multitrace chart #411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2017
Merged

Heatmap (density) plot in multitrace chart #411

merged 2 commits into from
Jul 18, 2017

Conversation

tgoldina
Copy link
Contributor

https://jira.lsstcorp.org/browse/DM-10832

Added heatmap trace type to multitrace chart with options and server side connection.

Known limitations:

  • The only way to recalculate heatmap is to change table, filter from the plot, or change heatmap parameters. The map is not recalculated on zoom or when axis limits change
  • Table highlight is not shown - it's not clear if we should support this connection
    colorbar can overlap.
  • It's not possible to set from UI which heatmap trace is on top. (Usually the last trace in the data array is the one on top.) We might need a separate ticket for placing active trace (of the same type) on top of the others.
  • Colorbar can overlap with the legend, other colorbar ticks. It's not easy to position it perfectly in generic case, when multiple colorbars (and legend) are present, but it is possible to set its length and location in the data array, when you know what exactly will be present on the chart.

@tgoldina tgoldina requested a review from loitly July 14, 2017 21:40
Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chart Options:

  • when scroll, top portion should be fixed and not scroll off.
  • Color is no longer applicable and should not be an option.

Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The color bars look very nice as is. But, once the chart is resized(400px width instead of 800px).. the labels render on top of each other.

Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is good to merge. I don't see anything that would affect existing behavior. There are known issues that need to be resolved before it can be production ready as noted by Tatiana.

Object.assign(changes, fields);

// reversescale is boolean
changes[`data.${activeTrace}.reversescale`] = get(fields, `data.${activeTrace}.reversescale`, '').includes('true');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a WebUtil.toBoolean function for this, if you want to use it.

@ejoliet
Copy link
Contributor

ejoliet commented Jul 17, 2017

Great feature!
I've played with it. It looks neat. I have a couple of comments:

  • highlighted dot not visible enough depending on the color selected
  • when i interact with the data, sometime selection or highlighted dots are not visible or filter is not applied
  • No legend/colormap on the plot to indicate the range
  • Do we want the background of the tooltip to be the same color as the dot or do we want to fix it?

Thanks.

- show Color field only of marker.color is sopported for this trace type
- move legend to the bottom if default colorbars are added
@tgoldina
Copy link
Contributor Author

tgoldina commented Jul 18, 2017

In the latest commit:

  • the default colorbar is added below the existing, to avoid overlapping.
  • color field in options is only shown if data.marker.color property is available for this trace type
  • as an attempt to avoid legend and colorbar overlap, legend is switched to the bottom (horizontal configuration) when the default colorbar is added.

Heatmap does not show selected or highlighed from the table, only scatter trace shows them.

The example is a top chart at http://localhost:8080/firefly/demo/ffapi-highlevel-charttest.html

For scatter color maps, we do not display colorbar at the moment, as Emmanuel has noted. There is a ticket (https://jira.lsstcorp.org/browse/DM-11064) to address this issue.

Regarding tooltip background, we'd like to keep as much Plotly behavior as possible. User can override it by giving custom layout or data configuration.

Please, file the ticket for multitrace charts, if you see problems with filter, selection, or highlight. Selected and highlighted points are shown for active trace only, when active trace is scatter. You can change active trace by using the listbox on the toolbar.

We might want to create a ticket to place an active trace on top of other traces of the same type. (Plotly keeps its own order for the different trace types.) Currently the latest trace is displayed on top. If traces are overlapping, the tooltips will be shown for the topmost trace.

@tgoldina tgoldina merged commit 7a4c569 into dev Jul 18, 2017
@tgoldina tgoldina deleted the DM-10832_heatmap branch July 26, 2017 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants