Skip to content

fix(axis): always render tickLine unless visible is false#2194

Merged
nickofthyme merged 1 commit intoelastic:mainfrom
nickofthyme:fix-axis-tick-rendering
Oct 10, 2023
Merged

fix(axis): always render tickLine unless visible is false#2194
nickofthyme merged 1 commit intoelastic:mainfrom
nickofthyme:fix-axis-tick-rendering

Conversation

@nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Oct 10, 2023

Summary

Now axes tickLine are always rendered unless visible is false, thereby including the tickLine.padding even if the tickLine.size or tickLine.strokeWidth are 0.

BREAKING CHANGE: Now displays padding where before would be hidden possibly creating an inadvertent breaking style change.

Screen Recording 2023-10-10 at 02 54 19 PM

Notice the bottom axes, as the tickLine.size goes to 0 the padding does not get removed.

Details

This logic was added back in #711 with a complete overhall of the axes logic. This was added to render only things that absolutely needed to be rendered and a 0 length or strokeWidth line does not. However this would unexpectedly strip away the tickLine.padding even with the tickLine.visible set to true. This change should have minimal impact across kibana but better to perform this change now with the major theme breaking changes.

export function shouldShowTicks({ visible, strokeWidth, size }: AxisStyle['tickLine'], axisHidden: boolean): boolean {
return !axisHidden && visible && size > 0 && strokeWidth >= MIN_STROKE_WIDTH;
}

Issues

Fix #2187

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)
  • Unit tests have been added or updated to match the most common scenarios

@nickofthyme nickofthyme added :axis Axis related issue :xy Bar/Line/Area chart related :timeslip Timeslip related issues labels Oct 10, 2023
@nickofthyme nickofthyme changed the title fix(axis): always render tickLine unless visible is false fix(axis): always render tickLine unless visible is false Oct 10, 2023
@nickofthyme nickofthyme merged commit ec95d50 into elastic:main Oct 10, 2023
@nickofthyme nickofthyme deleted the fix-axis-tick-rendering branch October 10, 2023 22:44
nickofthyme pushed a commit that referenced this pull request Nov 8, 2023
# [61.0.0](v60.0.0...v61.0.0) (2023-11-08)

### Bug Fixes

* `onRenderChange` callback trigger on resize ([#2228](#2228)) ([be30c1b](be30c1b))
* **axis:** always render `tickLine` unless `visible` is `false` ([#2194](#2194)) ([ec95d50](ec95d50))
* **BarSeries:** ignore histogram mode in determining stacked series ([#2225](#2225)) ([27b4281](27b4281))
* clamp brushing min of last bucket ([#2227](#2227)) ([155c22d](155c22d))
* **deps:** update dependency @elastic/eui to ^88.5.0 ([#2179](#2179)) ([2bb921e](2bb921e))
* **deps:** update dependency @elastic/eui to ^88.5.4 ([#2190](#2190)) ([05b33e5](05b33e5))
* **deps:** update dependency @elastic/eui to ^89.1.0 ([#2212](#2212)) ([a91f68d](a91f68d))
* **deps:** update dependency @elastic/eui to v89 ([#2193](#2193)) ([132327d](132327d))
* **deps:** update dependency @elastic/eui to v90 ([#2222](#2222)) ([10cd53b](10cd53b))

### chore

* reclaim charts theme ownership from eui ([#2175](#2175)) ([422c7d5](422c7d5))

### Features

* **metric:** allow alpha colors and improve contrast logic  ([#2184](#2184)) ([dd5732e](dd5732e))

### BREAKING CHANGES

* **BarSeries:** now ignores histogram mode in determining stacked series
* elastic charts theme renamed to `LEGACY_DARK_THEME` and `LEGACY_LIGHT_THEME` in favor of the main `DARK_THEME` and `LIGHT_THEME` which was merged with eui theme overrides. These new themes are now default.
* **axis:** Now respects `tickLine.padding` whenever `tickLine.visible` is `true`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:axis Axis related issue :timeslip Timeslip related issues :xy Bar/Line/Area chart related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove axis strict render checks

1 participant