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): custom slot to render contents in gap #2303

Merged
merged 11 commits into from
Jan 26, 2024

Conversation

nickofthyme
Copy link
Collaborator

@nickofthyme nickofthyme commented Jan 16, 2024

Summary

This PR adds the ability to render arbitrary contents into the gap space of the metric. This adds the optional slot prop to the Metric spec.

Screen Recording 2024-01-16 at 01 06 53 PM

Details

The contents of the slot are contained inside of an absolutely positioned container to allow rendering contents without contents size impacting the layout of the Metric elements. Alternatively, we could add an option to disable this behavior ad allow the Metric elements to be pushed out of the render area or we could account for the slot size at the time of rendering.

Issues

closes #2182

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 light and dark themes

@nickofthyme nickofthyme added the :metric Related to Metric chart label Jan 16, 2024
@nickofthyme
Copy link
Collaborator Author

buildkite update screenshots

@nickofthyme nickofthyme marked this pull request as ready for review January 17, 2024 15:50
Copy link
Member

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

I'm fine with the code changes, just the naming is a bit too vague

packages/charts/api/charts.api.md Outdated Show resolved Hide resolved
@nickofthyme nickofthyme enabled auto-merge (squash) January 26, 2024 21:37
@nickofthyme
Copy link
Collaborator Author

buildkite update screenshots

@nickofthyme nickofthyme merged commit 3256c8c into elastic:main Jan 26, 2024
13 checks passed
@nickofthyme nickofthyme deleted the metric-slot branch January 26, 2024 23:22
nickofthyme pushed a commit that referenced this pull request Jan 29, 2024
# [63.1.0](v63.0.0...v63.1.0) (2024-01-29)

### Bug Fixes

* **deps:** update dependency @elastic/eui to ^92.1.1 ([#2315](#2315)) ([f4e4fae](f4e4fae))
* **deps:** update dependency @playwright/test to ^1.41.1 ([#2316](#2316)) ([e2ab527](e2ab527))
* **styles:** isolated point style overrides ([#2278](#2278)) ([3fb1df2](3fb1df2))

### Features

* **metric:** custom slot to render contents in gap ([#2303](#2303)) ([3256c8c](3256c8c))

### Performance Improvements

* **tooltip:** improve placement logic ([#2310](#2310)) ([cac5f49](cac5f49))
@nickofthyme nickofthyme mentioned this pull request Feb 13, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:metric Related to Metric chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add render slot for gap area in Metric
2 participants