Skip to content

[MetricVis] Add possibility to apply color background for whole container in metric#125217

Merged
VladLasitsa merged 20 commits intoelastic:mainfrom
VladLasitsa:add_possibility_to_colorize_container
Feb 23, 2022
Merged

[MetricVis] Add possibility to apply color background for whole container in metric#125217
VladLasitsa merged 20 commits intoelastic:mainfrom
VladLasitsa:add_possibility_to_colorize_container

Conversation

@VladLasitsa
Copy link
Copy Markdown
Contributor

@VladLasitsa VladLasitsa commented Feb 10, 2022

Part of: #123797

Summary

  • Add colorFullBackground arg which allow to colorize full container
  • Add new errors which prohibit to use colorFullBackground as true for configuration when we set several metrics (split by bucket, add several metrics, use head arg in canvas expression)
My.Canvas.Workpad.-.Kibana.mp4

@VladLasitsa VladLasitsa self-assigned this Feb 11, 2022
@VladLasitsa VladLasitsa changed the title Add possibility to apply color background for whole container in metric [MetricVis] Add possibility to apply color background for whole container in metric Feb 14, 2022
Copy link
Copy Markdown
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

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

Code mostly looks good to me, it has left to address a few comments I've left.
@VladLasitsa, thanks for your efforts 👍

@VladLasitsa VladLasitsa added backport:skip This PR does not require backporting Feature:MetricVis Metric visualization feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.2.0 labels Feb 15, 2022
@VladLasitsa VladLasitsa marked this pull request as ready for review February 15, 2022 14:04
@VladLasitsa VladLasitsa requested review from a team as code owners February 15, 2022 14:04
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors)

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@flash1293
Copy link
Copy Markdown
Contributor

flash1293 commented Feb 15, 2022

Seems like this is not working together with autoScale=true:
Screenshot 2022-02-15 at 18 20 58

kibana
| kibana_context savedSearchId=null timeRange={timerange from="now-7d" to="now"}
| esaggs index={indexPatternLoad id="90943e30-9a47-11e8-b64d-95841ca0b247"} aggs={aggAvg id="0" enabled=true schema="metric" field="bytes"} metricsAtAllLevels=false partialRows=false
| metricVis metric={visdimension accessor="col-0-0"} colorMode="Background" colorFullBackground=true autoScale=true 
  palette={palette "#ff0000" "#00ff00" "#00ff00" gradient=false stop=0 stop=1 stop=6000 range="number" continuity="below"}
| render

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

Seems like this is not working together with autoScale=true: Screenshot 2022-02-15 at 18 20 58

kibana
| kibana_context savedSearchId=null timeRange={timerange from="now-7d" to="now"}
| esaggs index={indexPatternLoad id="90943e30-9a47-11e8-b64d-95841ca0b247"} aggs={aggAvg id="0" enabled=true schema="metric" field="bytes"} metricsAtAllLevels=false partialRows=false
| metricVis metric={visdimension accessor="col-0-0"} colorMode="Background" colorFullBackground=true autoScale=true 
  palette={palette "#ff0000" "#00ff00" "#00ff00" gradient=false stop=0 stop=1 stop=6000 range="number" continuity="below"}
| render

@flash1293 , I fixed it, could you please recheck?

@flash1293
Copy link
Copy Markdown
Contributor

@VladLasitsa Still doesn't work for me:

with autoScale:
Screenshot 2022-02-17 at 11 43 45

without autoScale:
Screenshot 2022-02-17 at 11 43 51

kibana
| kibana_context savedSearchId=null timeRange={timerange from="now-7d" to="now"}
| esaggs index={indexPatternLoad id="90943e30-9a47-11e8-b64d-95841ca0b247"} aggs={aggAvg id="0" enabled=true schema="metric" field="bytes"} metricsAtAllLevels=false partialRows=false
| metricVis metric={visdimension accessor="col-0-0"} colorMode="Background" colorFullBackground=true 
  palette={palette "#ff0000" "#00ff00" "#00ff00" gradient=false stop=0 stop=1 stop=6000 range="number" continuity="below"}
| render

Copy link
Copy Markdown
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

LGTM, works as expected 👍

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@Kuznietsov Kuznietsov left a comment

Choose a reason for hiding this comment

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

Mostly LGTM 👍 Need to test it locally. Could you, please, address all the issues I've mentioned below. Thanks.

@Kuznietsov
Copy link
Copy Markdown
Contributor

Tested locally, works fine. Waiting for the code updates and going to approve this PR. @VladLasitsa, thanks for the efforts.

Copy link
Copy Markdown
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.

I've left a few small wording suggestions, but nothing worth holding you up for. Approving, assuming those get made.

VladLasitsa and others added 2 commits February 23, 2022 12:50
…ion_functions/metric_vis_function.ts

Co-authored-by: Michael Marcialis <michael@marcial.is>
@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@VladLasitsa
Copy link
Copy Markdown
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

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 44 46 +2

Async chunks

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

id before after diff
expressionMetricVis 10.1KB 11.0KB +960.0B

Page load bundle

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

id before after diff
expressionMetricVis 8.1KB 8.9KB +812.0B
Unknown metric groups

API count

id before after diff
expressionMetricVis 44 46 +2

ESLint disabled line counts

id before after diff
expressionMetricVis 6 7 +1

Total ESLint disabled count

id before after diff
expressionMetricVis 6 7 +1

History

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

cc @VladLasitsa

@VladLasitsa VladLasitsa merged commit 4bffe73 into elastic:main Feb 23, 2022
lucasfcosta pushed a commit to lucasfcosta/kibana that referenced this pull request Mar 2, 2022
…iner in metric (elastic#125217)

* Add `colorFullBackground` arg which allow to colorize full container

* Fix Checks

* Fix condition

* Fix CI

* Fix snapshots

* Fixed remarks

* Fix full color background for auto scaling

* Fix CI

* Fix autoscale styles

* Fix nit's

* Update src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts

Co-authored-by: Michael Marcialis <michael@marcial.is>

* Fix some nit's

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Marcialis <michael@marcial.is>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:MetricVis Metric visualization feature release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants