Skip to content

feat(goal): auto generated linear ticks#1637

Merged
nickofthyme merged 16 commits intoelastic:masterfrom
nickofthyme:goal-linear-scale
Apr 6, 2022
Merged

feat(goal): auto generated linear ticks#1637
nickofthyme merged 16 commits intoelastic:masterfrom
nickofthyme:goal-linear-scale

Conversation

@nickofthyme
Copy link
Copy Markdown
Collaborator

@nickofthyme nickofthyme commented Mar 31, 2022

Summary

Adds automated linear ticks for goal/gauge charts when to ticks value is provided. Adds a new nice prop to force ticks to be niced given the specified domain. The autogenerated ticks are independent of the values provided for bands.

BREAKING CHANGE: goal chart now requires domain min and max to be defined

Before

When no ticks prop is provided we just default to this...

Image 2022-03-30 at 10 05 25 PM

After

Now whenever ticks prop is not defined when compute the sensible linear ticks.

image

Details

This PR adds linear ticks generation from the provided domain via a ScaleContinuous.

See demo story here

Issues

closes #1238

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • 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)

@nickofthyme nickofthyme added enhancement New feature or request :goal/gauge (old) Old Goal/Gauge chart related issues labels Mar 31, 2022
@nickofthyme nickofthyme requested a review from markov00 March 31, 2022 03:35
@nickofthyme nickofthyme marked this pull request as ready for review March 31, 2022 03:46
@nickofthyme nickofthyme requested a review from markov00 April 1, 2022 19:16
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.

Everything looks good now, thanks for all the updates.
I've put some minor comments about the docs/tsdocs, everything else is great!

@nickofthyme nickofthyme enabled auto-merge (squash) April 6, 2022 14:03
@nickofthyme nickofthyme merged commit 378c147 into elastic:master Apr 6, 2022
@nickofthyme nickofthyme deleted the goal-linear-scale branch April 6, 2022 15:35
nickofthyme added a commit to nickofthyme/elastic-charts that referenced this pull request Apr 7, 2022
BREAKING CHANGE: goal chart now requires domain min and max to be defined
nickofthyme pushed a commit that referenced this pull request Apr 14, 2022
# [46.0.0](v45.1.1...v46.0.0) (2022-04-14)

### Bug Fixes

* **axis:** ticks generation for linear scale on bar charts ([#1645](#1645)) ([65d0e7d](65d0e7d))
* **axis:** use correct desired tick count based on axis type ([#1646](#1646)) ([512a6cd](512a6cd))
* **deps:** update dependency @elastic/eui to v53 ([#1639](#1639)) ([34bf325](34bf325))
* **deps:** update dependency @elastic/eui to v54 ([#1642](#1642)) ([6eaca0a](6eaca0a))

### Features

* **axes:** option to fit domain to list of annotation `SpecIds` ([#1641](#1641)) ([220350d](220350d))
* **goal:** auto generated linear ticks ([#1637](#1637)) ([5437d8e](5437d8e))
* **legend:** expose sorting function ([#1644](#1644)) ([128114c](128114c))

### BREAKING CHANGES

* **goal:** goal chart now requires domain min and max to be defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change enhancement New feature or request :goal/gauge (old) Old Goal/Gauge chart related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-compute nice ticks for linear scales based on range

2 participants