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

[Lens] add new metric visualization #136567

Merged
merged 148 commits into from
Jul 26, 2022

Conversation

drewdaemon
Copy link
Contributor

@drewdaemon drewdaemon commented Jul 18, 2022

Summary

Resolve #134242

This adds the new metric visualization.

Screenshots

Screen Shot 2022-07-20 at 11 31 57 AM

Screen Shot 2022-07-20 at 11 50 27 AM

Checklist

Delete any items that are not applicable to this PR.

@MichaelMarcialis
Copy link
Contributor

Here is my take on how to split it. Let me know if you disagree.

The split that you and @flash1293 have established sounds good to me.

The min and max in this case are negative infinity and infinity. I think it makes sense to discuss forcing custom min/max for all metric-type visualizations as an enhancement in 8.5.

Ah, yes. I'm recalling that now. During these 8.5 discussions, I'd love to also discuss changing the min/max input placeholders and button icons to infinity symbols in those cases where we're using infinity instead of the min/max data set values (just so it's crystal clear to our users).

@flash1293
Copy link
Contributor

@mbondyra Colors should be fixed


const togglePalette = () => setIsPaletteOpen(!isPaletteOpen);

const idPrefix = htmlIdGenerator()();
Copy link
Contributor

@mbondyra mbondyra Jul 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: moving id to outside scope of the component makes the id more stable, otherwise the id gets changed with every rerender - I didn't notice any behaviour it would impact, but it's probably not a good practice, especially because the name stays the same:

id.mov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can definitely move the ID up the scope, but it seems like the name staying the same is an EUI bug?

Copy link
Contributor

@MichaelMarcialis MichaelMarcialis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the majority of those requested changes to quickly, @andrewctate! Amazing work! Acknowledging that we're pushing some comments/disucssions off to 8.5, this is looking good from my perspective. Adding a few last minute thoughts below, but approving now so I don't hold you up further. Thanks again for all your hard work on this!

  • Within the "Metric" layer panel, the "Primary metric" dimension correctly shows a color palette preview when "Dynamic" color is selected. However, if "Static" color is selected, a color swatch preview does not appear to indicate the applied color for that dimension. Would it be possible to add one similar to how we do with other visualizations?

image

  • Currently, the default "Primary metric" color of white (#ffffff) is being represented by a transparent swatch in the color picker, rather than a white swatch. Would it be possible to fix this?

image

  • I know that @gvnmagni requested that we use white as the default background color for visualizations with only the "Primary metric" dimension populated. I understand the desire to do so in order to present ultimate neutrality and a blank slate for the users to build/customize upon. Currently however, I don't think we're in a good position to do so. I worry that users seeing the workspace as shown in the screenshot below might give the false impression that something is broken or wrong with their configuration. I know we're currently starting to have conversations around whether we should resize the workspace panel to conform to the visualization and/or whether we should provide perimeter borders for visualizations such as this, but I don't think the outcome of those discussions are planned to be added for 8.4. As such, I'm wondering if it makes better sense to restore the previous light gray default background color for visualizations with only the "Primary metric" dimension populated, just so it's clear to the user that nothing is broken. Thoughts?

image

  • Do ya'll think we should change the "Progress bar direction" label to read "Bar direction" instead? Semantically, I view this element as more of a bar chart than a progress bar. This change would also help prevent the label from breaking a line.

image

  • Do ya'll have any thoughts on changing the "Max columns" label to something like "Layout columns"? I'm wondering if this change helps to make it clearer as to what this setting does.

image

Copy link
Contributor

@mbondyra mbondyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't find anything that should block this anymore and the other issues we agreed to push. Approved! 🥳

}

function MaximumEditor({ setState, state }: Props) {
const idPrefix = htmlIdGenerator()();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as the comment below - maybe we can move it up the scope?

@gvnmagni
Copy link

  • I know that @gvnmagni requested that we use white as the default background color for visualizations with only the "Primary metric" dimension populated. I understand the desire to do so in order to present ultimate neutrality and a blank slate for the users to build/customize upon. Currently however, I don't think we're in a good position to do so. I worry that users seeing the workspace as shown in the screenshot below might give the false impression that something is broken or wrong with their configuration. I know we're currently starting to have conversations around whether we should resize the workspace panel to conform to the visualization and/or whether we should provide perimeter borders for visualizations such as this, but I don't think the outcome of those discussions are planned to be added for 8.4. As such, I'm wondering if it makes better sense to restore the previous light gray default background color for visualizations with only the "Primary metric" dimension populated, just so it's clear to the user that nothing is broken. Thoughts?

Fine by me! 👍

@drewdaemon
Copy link
Contributor Author

@MichaelMarcialis thank you! And thanks to @flash1293 and the team for pitching in to get this over the line.

Within the "Metric" layer panel, the "Primary metric" dimension correctly shows a color palette preview when "Dynamic" color is selected. However, if "Static" color is selected, a color swatch preview does not appear to indicate the applied color for that dimension. Would it be possible to add one similar to how we do with other visualizations?

Makes sense. Adding as a follow-up.

Currently, the default "Primary metric" color of white (#ffffff) is being represented by a transparent swatch in the color picker, rather than a white swatch. Would it be possible to fix this?

We changed it to "Auto." Does that solve it?
Screen Shot 2022-07-26 at 10 25 29 AM

I'm wondering if it makes better sense to restore the previous light gray default background color for visualizations with only the "Primary metric" dimension populated, just so it's clear to the user that nothing is broken

Done!
Screen Shot 2022-07-26 at 10 45 31 AM
Screen Shot 2022-07-26 at 10 46 36 AM

change the "Progress bar direction" label to read "Bar direction"

Done!

changing the "Max columns" label to something like "Layout columns"

Done!

@drewdaemon drewdaemon requested a review from a team as a code owner July 26, 2022 17:46
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #39 / machine learning - data visualizer data view management "before each" hook for "sets custom label for existing field"
  • [job] [logs] FTR Configs #44 / ObservabilityApp Observability Rule Details page Page components maps correctly the rule type with the human readable rule type

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
embeddable 79 81 +2
expressionMetricVis 22 60 +38
lens 935 943 +8
total +48

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
expressionMetricVis 47 56 +9
lens 525 527 +2
total +11

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
expressionMetricVis 3.7KB 71.0KB +67.3KB
lens 1.2MB 1.2MB +14.8KB
total +82.2KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count 4937 4939 +2

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
embeddable 3 4 +1
lens 40 41 +1
total +2

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
embeddable 68.5KB 68.6KB +123.0B
expressionMetricVis 8.9KB 10.0KB +1.0KB
lens 34.0KB 34.3KB +310.0B
total +1.4KB
Unknown metric groups

API count

id before after diff
embeddable 505 507 +2
expressionMetricVis 47 56 +9
lens 604 608 +4
total +15

async chunk count

id before after diff
expressionMetricVis 1 2 +1

ESLint disabled in files

id before after diff
lens 2 3 +1

ESLint disabled line counts

id before after diff
expressionMetricVis 2 1 -1

Total ESLint disabled count

id before after diff
expressionMetricVis 2 1 -1
lens 29 30 +1
total -0

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Embedding Embedding content via iFrame Feature:Lens release_note:feature Makes this part of the condensed release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure ui-copy Review of UI copy with docs team is recommended v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Implement new metric grid visualization