mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Set min-width for DistributionBar and added README for storybook (#202247)
## Summary - This pull request resolves [elastic/kibana#200881](https://github.com/elastic/kibana/issues/200881) by setting a min-width of 10px for the DistributionBar component to prevent it from shrinking too small, ensuring a consistent and readable visual representation for better usability. - Additionally, added a README file with instructions for running Storybook to visually inspect the DistributionBar, as the folder had no documentation before, improving the developer experience. ## Screenshots: **Before** - The min-width of 10px was set, but small segments were not visible in the DistributionBar.  - The original mockStatsFindings with 'passed' set to 90 and 'failed' set to 10 did not visually reflect the min-width of 10px in the DistributionBar. The smallest segment was still not visible.  **After**: - Temporarily modified the `mockStatsFindings` in `distribution_bar.stories.tsx` to simulate the DistributionBar with extreme values by setting the count for 'passed' to 9000 (highest) and 'failed' to 1 (lowest):  - After the modification, the DistributionBar displayed correctly with even the smallest segments visible, confirming that the min-width is working as expected.  - These results were captured in a screenshot for the PR, and no changes were saved to the `distribution_bar.stories.tsx` file. ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
parent
3520e696f4
commit
50a2ffa7f2
2 changed files with 11 additions and 0 deletions
10
x-pack/packages/security-solution/distribution_bar/README.md
Normal file
10
x-pack/packages/security-solution/distribution_bar/README.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Security Solution's Distribution Bar
|
||||
|
||||
The DistributionBar component visually represents data distribution, such as critical, high, medium, and low alerts.
|
||||
|
||||
## Storybook
|
||||
|
||||
General look of the component can be checked visually running the following storybook:
|
||||
`yarn storybook security_solution_packages`
|
||||
|
||||
Note that all the interactions are mocked.
|
|
@ -36,6 +36,7 @@ const useStyles = () => {
|
|||
position: relative;
|
||||
border-radius: 2px;
|
||||
height: 5px;
|
||||
min-width: 10px; // prevents bar from shrinking too small
|
||||
`,
|
||||
empty: css`
|
||||
background-color: ${euiTheme.colors.lightShade};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue