-
Notifications
You must be signed in to change notification settings - Fork 122
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): add axis titles #1503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good just a few more things to consider.
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/state/selectors/compute_chart_dimensions.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/state/selectors/get_grid_full_height.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/canvas_renderers.ts
Outdated
Show resolved
Hide resolved
packages/charts/src/chart_types/heatmap/renderer/canvas/connected_component.tsx
Outdated
Show resolved
Hide resolved
Since Nick's PR is going to be pulling some properties off the theme vs the config, would it be cool to just put the titles on the theme instead of the config? @markov00 and @nickofthyme thoughts? |
@rshen91 My preference is to put the title style in the theme and keep the |
The current position is adjusted to be aligned only to the grid, it doesn't consider yet the axis dimensions
b9616bf
to
8cd19eb
Compare
# [42.0.0](v41.0.1...v42.0.0) (2022-01-05) ### Bug Fixes * **flamegraph:** solve animation regression occurring with 6db2677 ([#1541](#1541)) ([5ec6037](5ec6037)), closes [#1540](#1540) * **heatmap:** render empty state ([#1532](#1532)) ([59002df](59002df)) * **waffle:** fix strange 0 text in legend item extra when label is 0 ([#1538](#1538)) ([72224b9](72224b9)) ### Features * **goal:** add valueFormatter for tooltip ([#1529](#1529)) ([8139973](8139973)) * **heatmap:** add axis titles ([#1503](#1503)) ([a87325d](a87325d)) * **types:** improve generic types in specs, and spec prop types ([#1421](#1421)) ([562929e](562929e)) ### BREAKING CHANGES * **types:** The `xAccessor` and `yAccessor` are now required on all xy chart specs. Stronger typing on `data` prop that may cause type errors when using untyped array (i.e. `const arr: never[] = []`). Other minor type changes related to spec types. * **heatmap:** The heatmap yAxisLabel.padding style type is changed from Pixel | Partial<Padding> to Pixels | Padding. The heatmap axis labels are now correctly subjected to padding calculations and it will result in a slightly different position of labels. Co-authored-by: Marco Vettorello <vettorello.marco@gmail.com>
Summary
xAxisTitle
andyAxisTitle
props are available and rendered in the Heatmap chart.The title style reuse the one provided by the
Theme.axes.axisTitle
theme configuration.Together with the
visible
option, using an empty string will result in a hidden title.BREAKING CHANGE
The heatmap
yAxisLabel.padding
style type is changed fromPixel | Partial<Padding>
toPixels | Padding
.The heatmap axis labels are now correctly subjected to padding calculations and it will result is slightly modified position of labels.
fix #1531
Details
I've refactored some calculations used to compute the size of the grid based on the style constraints and I've unified the chart elements size calculation within a single selector:
computeChartElementSizesSelector
.In accordance with @darnautov I've also removed the gray mask in the lower part the heatmap when brushing the chart:
from:
to:
Issues
Closes #1221
Checklist
:xy
,:partition
)closes #123
,fixes #123
)packages/charts/src/index.ts