Skip to content
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

feat: heatmap/swimlane chart type #831

Merged
merged 54 commits into from
Oct 2, 2020

Conversation

darnautov
Copy link
Contributor

@darnautov darnautov commented Sep 22, 2020

Summary

Resolves #752.

Initial implementation of a swimlane/heatmap visualization. I was mostly focused on the swim lane use case, but thanks to @markov00 it also has basic heatmap support.

There are some TS and test issues I'm resolving at the moment but would be helpful to start collecting feedback on the implementation, or maybe you'll spot a lacking of some critical features for the beta release.

Swim lane example:
image

Heatmap example:
image

Features:

  • Support linear, threshold, quantile, and quantize color scaling based on values
  • Support time series and categorical scaling for X-axis
  • Tooltip for cells and Y-axis values
  • Highlighting of the brushed area
  • Provide X, Y ranges and selected cells on brushing callback
  • Legend rendering based on color scaling
  • Truncate long Y-axis labels
  • Basic styling for axis, grid, and cells.

Known issues (I hope @nickofthyme or @markov00 could help)

  • Brush component persists even on empty mouseDownPosition
  • Using ScaleContinuous time scale ends up with some ticks outside of the range

TODO for further releases:

  • Support long labels for categorical data on X-axis.

Checklist

  • Any consumer-facing exports were added to src/index.ts (and stories only import from ../src except for test data & storybook)
  • This was checked for cross-browser compatibility
  • Proper documentation or storybook story was added for features that require explanation or tutorials
  • Unit tests were updated or added to match the most common scenarios

@cla-checker-service
Copy link

cla-checker-service bot commented Sep 22, 2020

💚 CLA has been signed

@peteharverson
Copy link

Tested this on the playground and it's looking great!

Some feedback on the selection behavior. Some of this may just be because it is running in the playground.

  • Need a way of deselecting
  • Ability for drag select to 'snap' to cell boundaries (as we have in the ML anomaly swim lane). This should possibly be configurable, as for some use cases it might make sense not to snap to the cell boundaries.
    image
  • Ability to select a whole cell by clicking on it (related to item above, where clicking on a cell snaps selection to the full range of that one cell)
  • Styling of selection needs some work - maybe adding the ability to mask out the area that isn't selected (as we have in the ML swim lane)

image

@darnautov darnautov marked this pull request as ready for review September 24, 2020 08:00
.domain(ranges)
.interpolate(interpolateHcl)
.range(colorRange);
colorScale.ticks = [0, ...colorScale.config.ticks(6)];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it doesn't cover the case when the values in the range are negative

@darnautov
Copy link
Contributor Author

Are you planning to implement some kind of visibility toggle on the legend? If not, I think we should disable the ability to toggle the legend items.

Screen Recording 2020-09-29 at 10 41 AM

@nickofthyme added in 0af6a9a, thanks @markov00

@markov00 markov00 changed the title feat: Swimlane / Heatmap visualisation feat: heatmap/swimlane chart type Oct 1, 2020
Copy link
Member

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

LGTM tested locally.
Everything is in place for an alpha release

@darnautov darnautov merged commit 96f92b5 into elastic:master Oct 2, 2020
markov00 pushed a commit that referenced this pull request Oct 2, 2020
# [23.1.0](v23.0.1...v23.1.0) (2020-10-02)

### Features

* heatmap/swimlane chart type ([#831](#831)) ([96f92b5](96f92b5)), closes [#752](#752)
@markov00
Copy link
Member

markov00 commented Oct 2, 2020

🎉 This PR is included in version 23.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Issue released publicly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swim lane visualization
5 participants