Skip to content
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(metric): add text value #1817

Merged
merged 13 commits into from
Sep 15, 2022

Conversation

markov00
Copy link
Member

Summary

Add the ability to render text in place of numerical values.

BREAKING CHANGE

The metric types are updated to align with the new feature. I've introduced a lower type branch, that splits numerical (together with trend/progress) from a textual only metric.

Screenshot 2022-09-12 at 14 02 33

Issues

fix #1801

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)
  • Visual changes have been tested with all available themes including dark, light, eui-dark & eui-light

BREAKING CHANGE: the metric types are updated to align better with the new feature
@markov00 markov00 added breaking change :metric Related to Metric chart labels Sep 12, 2022
@markov00 markov00 changed the title feat(metric): add textual metric feat(metric): add text value Sep 12, 2022
BREAKING CHANGE: `progressBarDirection` and `trendShape` are now required
@markov00 markov00 marked this pull request as ready for review September 13, 2022 12:32
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.

Looks good with one thought.

storybook/stories/metric/2_grid.story.tsx Show resolved Hide resolved
packages/charts/api/charts.api.md Show resolved Hide resolved
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.

Good, one finally suggestion

@markov00
Copy link
Member Author

buildkite update screenshots

@markov00 markov00 enabled auto-merge (squash) September 15, 2022 08:44
@markov00 markov00 merged commit d7610ad into elastic:master Sep 15, 2022
nickofthyme pushed a commit that referenced this pull request Sep 17, 2022
# [49.0.0](v48.0.1...v49.0.0) (2022-09-17)

### Bug Fixes

* **deps:** update dependency @elastic/eui to v67 ([#1815](#1815)) ([a45b3d3](a45b3d3))
* **metric:** improve multi-line wrapping ([#1816](#1816)) ([f9c790e](f9c790e))

### Features

* **metric:** add a textual value ([#1817](#1817)) ([d7610ad](d7610ad))
* **metric:** add empty cell marker ([#1819](#1819)) ([58ca9c3](58ca9c3))
* **metric:** expose min metric height ([#1825](#1825)) ([c9bd634](c9bd634))

### BREAKING CHANGES

* **metric:** the metric types have been changed: the `value: number` and `valueFormatter` are only available for a numerical, progress bar, or trend metric. For the textual metric, the `value` has a `string` type.
The `progressBarDirection` and `trendShape` properties are now required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change :metric Related to Metric chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Metric] support strings
3 participants