Skip to content

fix(xy): time axis improvements#1445

Merged
monfera merged 13 commits intoelastic:masterfrom
monfera:time-axis-improvements
Oct 28, 2021
Merged

fix(xy): time axis improvements#1445
monfera merged 13 commits intoelastic:masterfrom
monfera:time-axis-improvements

Conversation

@monfera
Copy link
Copy Markdown
Contributor

@monfera monfera commented Oct 27, 2021

Summary

Multilayer time axis tick/grid line placement and styling improvements

Details

Issues

Partial fulfilment of #1442

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • The :theme label has been added and the @elastic/eui-design team has been pinged when there are Theme API changes
  • 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 all available themes including dark, light, eui-dark & eui-light

@monfera monfera marked this pull request as draft October 27, 2021 16:30
@monfera monfera added :axis Axis related issue :test Missing or to be fixed test :theme :xy Bar/Line/Area chart related bug Something isn't working code quality wip work in progress labels Oct 27, 2021
Comment on lines +86 to +89
baseTheme={{
...baseTheme,
axes: { ...baseTheme.axes, tickLine: { ...baseTheme.axes.tickLine, size: 0.0001, padding: 4 } },
}}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

baseTheme should be left alone, the axes overrides should go in the theme prop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will change it in the next commit—is it mostly convenience like no need to deepmerge myself, or is there some deeper reason?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Correct, just for ease of use. You also might spread something that is not actually a full Theme type and it could break.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@monfera monfera marked this pull request as ready for review October 27, 2021 19:10
@monfera monfera requested review from markov00 and rshen91 October 27, 2021 19:10
Copy link
Copy Markdown
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

LGTM - timeslip looks great in dark mode compared to current master 👍🏻

@rshen91 rshen91 mentioned this pull request Oct 27, 2021
18 tasks
Copy link
Copy Markdown
Collaborator

@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.

Thanks Robert, it looks way better now


if (isMultilayerTimeAxis) {
const rasterSelector = getRasterSelector(xDomain.timeZone, timeAxisLayerCount);
const rasterSelector = rasters({ minimumTickPixelDistance: 24, locale: 'en-US' }, xDomain.timeZone);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also the locale should be picked up from Kibana

const axisTitleColor = 'rgb(112,112,112)';
const axisTitleFontSize = 15;
const dataInk = 'rgba(96, 146, 192, 1)';
const horizontalGridLineStyle = { stroke: 'black', strokeWidth: 0.15, opacity: 1 };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need the black stroke and very thin width?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, because the equivalent looking much lighter grey stroke, with the default width (1px) leads to a different intersection of the horizontal and vertical grid lines, and it results in a "broken vertical grid line" artifact
image

@monfera monfera merged commit 1ce4223 into elastic:master Oct 28, 2021
nickofthyme pushed a commit that referenced this pull request Oct 28, 2021
## [38.1.1](v38.1.0...v38.1.1) (2021-10-28)

### Bug Fixes

* **xy:** multilayer time axis tick/grid line placement and styling ([#1445](#1445)) ([1ce4223](1ce4223))
@nickofthyme
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 38.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nickofthyme nickofthyme added the released Issue released publicly label Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:axis Axis related issue bug Something isn't working code quality released Issue released publicly :test Missing or to be fixed test :theme wip work in progress :xy Bar/Line/Area chart related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants