Skip to content

feat(xy)!: change timeAxisLayerCount the default from 0 to 2 #2582

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 39 commits into from
Mar 11, 2025

Conversation

walterra
Copy link
Contributor

@walterra walterra commented Jan 13, 2025

Summary

timeAxisLayerCount: 2 is now the default to render multiple layers for time based axes. This feature was originally added in 2021 and now just a small set of consumers are using the legacy time axis.

BREAKING CHANGE

The timeAxisLayerCount options now defaults to 2 instead of 0.

Details

  • This includes some tricky changes: Because timeAxisLayerCount defaulted to 0, code in some places assumed that a change to 2 was only done by users when the x axis was then time based. Thus changing the default to 2 changed the calculated padding for all axis types.
  • On top of that this surfaced a limitation of this setting: When timeAxisLayerCount is set to 2, there was no check for axes if they were actually time based. This means this also affected vertical axes so the left and right margin would change. I think that's the reason why we see so many baseline changes in the playwright e2e image assertions.

Issues

Fixes #2125

This PR is part of elastic/kibana#193683

close elastic/kibana#221512

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • All related issues have been linked (i.e. closes #123, fixes #123)
  • New public API exports have been added to packages/charts/src/index.ts
  • Unit tests have been added or updated to match the most common scenarios
  • The proper documentation and/or storybook story has been added or updated
  • The code has been checked for cross-browser compatibility (Chrome, Firefox, Safari, Edge)
  • Visual changes have been tested with light and dark themes

@walterra walterra changed the title make timeAxisLayerCount: 2 the default feat(xy): make timeAxisLayerCount: 2 the default Jan 13, 2025
@walterra walterra self-assigned this Jan 13, 2025
@walterra walterra added :axis Axis related issue :xy Bar/Line/Area chart related labels Jan 13, 2025
@nickofthyme
Copy link
Collaborator

nickofthyme commented Jan 13, 2025

@walterra FYI, to update any playwright snapshots you can comment on the PR with..

buildkite update screenshots

This will run the ci in update mode and push a commit to your branch with the updated e2e screenshots, if any. The reason we need to run this in the CI is due to slight differences in the browser binaries between MacOS and linux ci agents. So to avoid this we only store screenshots generated from ci.

And to just trigger a re-run of the ci you can comment...

buildkite test this

@walterra walterra force-pushed the remove-legacy-time-axis-support branch from 6b22f3a to fd7ac96 Compare January 14, 2025 15:57
@walterra walterra changed the title feat(xy): make timeAxisLayerCount: 2 the default fix!(xy): change timeAxisLayerCount the default from 0 to 2 Jan 16, 2025
@walterra walterra changed the title fix!(xy): change timeAxisLayerCount the default from 0 to 2 feat!(xy): change timeAxisLayerCount the default from 0 to 2 Jan 17, 2025
@walterra walterra changed the title feat!(xy): change timeAxisLayerCount the default from 0 to 2 feat(xy)!: change timeAxisLayerCount the default from 0 to 2 Jan 17, 2025
@walterra walterra added kibana cross issue Has a Kibana issue counterpart and removed kibana cross issue Has a Kibana issue counterpart labels Jan 20, 2025
@walterra walterra force-pushed the remove-legacy-time-axis-support branch from 3a7832f to abddedc Compare January 21, 2025 15:59
@walterra walterra marked this pull request as ready for review January 24, 2025 08:14
@walterra walterra force-pushed the remove-legacy-time-axis-support branch from 125b36b to fc7edea Compare February 7, 2025 10:42
@walterra
Copy link
Contributor Author

walterra commented Feb 7, 2025

@markov00 I updated code related to multilayerTimeAxis so it's not recalculated that often. I pushed the calculation as far up as possible to the level of selectors, or where we iterate over all axes and need to calculate it for each axis.

@walterra walterra force-pushed the remove-legacy-time-axis-support branch from c3b3570 to c6fdc74 Compare February 20, 2025 08:14
@walterra
Copy link
Contributor Author

walterra commented Mar 5, 2025

buildkite update screenshots

Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Overall LGTM. I would just ask that we swap out the manual object creation with the equivalent mocks in the unit tests.

Copy link
Collaborator

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! LGTM

@walterra walterra merged commit 6863e6e into elastic:main Mar 11, 2025
14 checks passed
@walterra walterra deleted the remove-legacy-time-axis-support branch March 11, 2025 16:36
markov00 added a commit that referenced this pull request Mar 26, 2025
BREAKING CHANGE: The timeAxisLayerCount options now defaults to 2 instead of 0. The multilayer time axis is now the default style.
nickofthyme pushed a commit that referenced this pull request Mar 26, 2025
# [70.0.0](v69.2.0...v70.0.0) (2025-03-26)

### Features

* **xy:** change timeAxisLayerCount the default from 0 to 2 ([#2582](#2582)) ([81c32c7](81c32c7))

### BREAKING CHANGES

* **xy:** The timeAxisLayerCount options now defaults to 2 instead of 0. The multilayer time axis is now the default style.
markov00 added a commit that referenced this pull request Mar 28, 2025
markov00 added a commit that referenced this pull request Mar 28, 2025
nickofthyme pushed a commit that referenced this pull request Mar 28, 2025
## [69.2.1](v69.2.0...v69.2.1) (2025-03-28)

### Reverts

* "feat(xy)!: change `timeAxisLayerCount` the default from `0` to `2` ([#2582](#2582))" ([a9d3fcb](a9d3fcb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:axis Axis related issue :xy Bar/Line/Area chart related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ElasticCharts] Use multi-layer time axis as default time axis [cartesian] Use only multi-layer time axis style
3 participants