-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Lens] Enhance visualization modifier popup with layer palette #155280
Conversation
Pinging @elastic/kibana-visualizations @elastic/kibana-visualizations-external (Team:Visualizations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fantastic! Changes LGTM!
🤩 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together, @dej611. It looks wonderful. Leaving you a few small comments below for your initial review.
-
Why did we change the previous popover header from
Layers with reduced sampling
toSampling probability by layer
? The reason I ask is because that sounds like an odd title for an area that only shows layers with reduced sampling (i.e. we don't show all layers, namely those with 100% sampling). Should we change it back? -
Would it be possible to apply a minimum width of 280px on the modifiers popover?
x-pack/plugins/lens/public/datasources/form_based/info_badges.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/embeddable/embeddable_info_badges.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datasources/form_based/info_badges.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lens/public/datasources/form_based/info_badges.tsx
Outdated
Show resolved
Hide resolved
@MichaelMarcialis I changed that after Sophie's request. As she said
The title was a proposal from her. |
Refactored info badge component into a shared component and added unit test for the shared codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes, @dej611! This looks great. The only previously mentioned item remaining was setting a minimum width on the modifier popover of 280px. Would it be possible to address that?
Otherwise, aside from my small comments below, this looks good-to-go. Approving now so I don't hold you up.
css={css` | ||
padding-right: 0; | ||
`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this doing anything? If not, it can be removed.
css={css` | |
padding-right: 0; | |
`} |
} | ||
return ( | ||
<> | ||
{index ? <EuiHorizontalRule margin="s" /> : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be better to set this to no margin to simplify your aside
padding.
{index ? <EuiHorizontalRule margin="s" /> : null} | |
{index ? <EuiHorizontalRule margin="none" /> : null} |
padding: ${!isFirstItem ? 0 : euiTheme.size.base} ${euiTheme.size.base} | ||
${bottomPadding}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the removal of the horizontal rule margin in the previous comment, you can simplify these styles.
padding: ${!isFirstItem ? 0 : euiTheme.size.base} ${euiTheme.size.base} | |
${bottomPadding}; | |
padding: ${euiTheme.size.base}; |
<EuiFlexGroup justifyContent={hasColor ? 'center' : 'spaceBetween'} gutterSize="s"> | ||
{hasColor ? ( | ||
<EuiFlexItem grow={false}> | ||
<EuiIcon | ||
color={hasSingleColor ? palette[0] : undefined} | ||
type={iconType} | ||
css={css` | ||
margin-top: ${euiTheme.size.xxs}; | ||
`} | ||
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`} | ||
/> | ||
</EuiFlexItem> | ||
) : null} | ||
<EuiFlexItem grow={Boolean(palette)}> | ||
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}> | ||
{title} | ||
</EuiText> | ||
</EuiFlexItem> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With your latest markup refactoring, I'd suggest the following changes for simplicity:
<EuiFlexGroup justifyContent={hasColor ? 'center' : 'spaceBetween'} gutterSize="s"> | |
{hasColor ? ( | |
<EuiFlexItem grow={false}> | |
<EuiIcon | |
color={hasSingleColor ? palette[0] : undefined} | |
type={iconType} | |
css={css` | |
margin-top: ${euiTheme.size.xxs}; | |
`} | |
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`} | |
/> | |
</EuiFlexItem> | |
) : null} | |
<EuiFlexItem grow={Boolean(palette)}> | |
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}> | |
{title} | |
</EuiText> | |
</EuiFlexItem> | |
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}> | |
{hasColor ? ( | |
<EuiFlexItem grow={false}> | |
<EuiIcon | |
color={hasSingleColor ? palette[0] : undefined} | |
type={iconType} | |
data-test-subj={`${dataTestSubjPrefix}-${index}-icon`} | |
/> | |
</EuiFlexItem> | |
) : null} | |
<EuiFlexItem> | |
<EuiText size="s" data-test-subj={`${dataTestSubjPrefix}-${index}-title`}> | |
{title} | |
</EuiText> | |
</EuiFlexItem> |
<EuiFlexGroup | ||
justifyContent={'center'} | ||
gutterSize="s" | ||
css={css` | ||
margin-top: ${euiTheme.size.xs}; | ||
overflow-y: hidden; | ||
`} | ||
> | ||
<EuiFlexItem | ||
grow={false} | ||
css={css` | ||
height: ${euiTheme.size.xs}; | ||
`} | ||
> | ||
<EuiIcon type="empty" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem | ||
grow={Boolean(palette)} | ||
css={css` | ||
height: ${euiTheme.size.xs}; | ||
`} | ||
> | ||
<EuiColorPaletteDisplay | ||
size="xs" | ||
palette={palette} | ||
data-test-subj={`${dataTestSubjPrefix}-${index}-palette`} | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using an EuiFlexGroup
with one of the two EuiFlexItem
children housing an empty icon, would it be simpler to just house the EuiColorPaletteDisplay
in a div
element with some left padding for alignment?
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
* main: (1294 commits) [SecuritySolution] Refactor security packages (elastic#155365) [Discover] Show "Temporary" badge for ad-hoc data views in Alerts flyout (elastic#155717) [RAM] Conditional actions feedback on pr review (elastic#155804) [Files] Adds bulk delete method (elastic#155628) [Lens] Use proper way to generate absolute short URL (elastic#155512) [Guided onboarding] Use Kibana features to grant access (elastic#155065) [Index Management] Fix duped mock (elastic#155844) [Lens] Enhance visualization modifier popup with layer palette (elastic#155280) Fix flaky combobox tests on role management screen (elastic#155711) [Infrastructure UI] Create InventoryViewsService and InventoryViewsClient (elastic#155126) [Fleet] always create agent upload write indices (elastic#155729) [Fleet] [Cloud Security Posture] Add CloudFormation agent install method (elastic#155045) Add tech preview label for search applications (elastic#155649) [ML] AIOps: Stabilize flaky functional tests. (elastic#155710) [ES UI Shared] Migrate JsonEditor to monaco (elastic#155610) [Security Solution] Fixes security_solution storybooks always rendering in a flyout (elastic#155814) [Synthetics] Make error popover disappear `onMouseLeave` of metric item card (elastic#155800) Remove Exploratory View components from Observability (elastic#155629) [Discover] Remove redundant "Filter was added" toast (elastic#155645) [RAM][Security Solution][Alerts] Support the ability to trigger a rule action per alert generated (elastic#153611) (elastic#155384) ...
## Summary Adds the 8.8 documentation for the following: - Enable report sharing: #153429 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html - Random sampling feature: #143221 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time - Improve Ignore global filters UI: #154441 and #155280 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations --------- Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
## Summary Adds the 8.8 documentation for the following: - Enable report sharing: elastic#153429 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html - Random sampling feature: elastic#143221 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time - Improve Ignore global filters UI: elastic#154441 and elastic#155280 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations --------- Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com> (cherry picked from commit 06a800f)
# Backport This will backport the following commits from `main` to `8.8`: - [[DOCS] Adds 8.8 Viz docs (#157215)](#157215) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kaarina Tungseth","email":"kaarina.tungseth@elastic.co"},"sourceCommit":{"committedDate":"2023-05-23T15:41:42Z","message":"[DOCS] Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8 documentation for the following:\r\n\r\n- Enable report sharing: https://github.com/elastic/kibana/pull/153429\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n- Random sampling feature: https://github.com/elastic/kibana/pull/143221\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n- Improve Ignore global filters UI:\r\nhttps://github.com//pull/154441 and\r\nhttps://github.com//pull/155280\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","Team:SharedUX","v8.8.0","v8.9.0"],"number":157215,"url":"https://github.com/elastic/kibana/pull/157215","mergeCommit":{"message":"[DOCS] Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8 documentation for the following:\r\n\r\n- Enable report sharing: https://github.com/elastic/kibana/pull/153429\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n- Random sampling feature: https://github.com/elastic/kibana/pull/143221\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n- Improve Ignore global filters UI:\r\nhttps://github.com//pull/154441 and\r\nhttps://github.com//pull/155280\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157215","number":157215,"mergeCommit":{"message":"[DOCS] Adds 8.8 Viz docs (#157215)\n\n## Summary\r\n\r\nAdds the 8.8 documentation for the following:\r\n\r\n- Enable report sharing: https://github.com/elastic/kibana/pull/153429\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html\r\n\r\n- Random sampling feature: https://github.com/elastic/kibana/pull/143221\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time\r\n\r\n- Improve Ignore global filters UI:\r\nhttps://github.com//pull/154441 and\r\nhttps://github.com//pull/155280\r\nDocs preview:\r\nhttps://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations\r\n\r\n---------\r\n\r\nCo-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>","sha":"06a800fbad1f2a8fd9146bfe0c439e2107f771fc"}}]}] BACKPORT--> Co-authored-by: Kaarina Tungseth <kaarina.tungseth@elastic.co>
## Summary Adds the 8.8 documentation for the following: - Enable report sharing: elastic#153429 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/reporting-getting-started.html - Random sampling feature: elastic#143221 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#improve-visualization-loading-time - Improve Ignore global filters UI: elastic#154441 and elastic#155280 Docs preview: https://kibana_157215.docs-preview.app.elstc.co/guide/en/kibana/master/lens.html#add-annotations --------- Co-authored-by: Tim Sullivan <tsullivan@users.noreply.github.com>
Summary
Fix #154349
This PR introduces some chart info API enhancements, used within the visualization modifier popup in a embeddable context.
For the specific scenario with a table with multiple color by value columns, the palette is omitted:
Sampling dashboard with many combinations:
sampling_testing_dashboard.ndjson.txt
Additional fixes:
Before:

Before:






After:





Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers