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 value labels to Heatmap #106406

Merged
merged 11 commits into from
Oct 25, 2021
Merged

[Lens] Add value labels to Heatmap #106406

merged 11 commits into from
Oct 25, 2021

Conversation

dej611
Copy link
Contributor

@dej611 dej611 commented Jul 21, 2021

Summary

Fixes #105410

Creates the menu to control the value labels visibility option in the Heatmap.

Notes:

Value labels visibily dynamically changes based on the cell space.
I've set the min/max font size to 8/18 (different from XY) because, given the heatmap context I thought it may make sense for smaller text. But it can be easily changed.

Screenshot 2021-10-19 at 12 31 35

Screenshot 2021-10-19 at 12 31 44

Screenshot 2021-10-19 at 12 32 18

Screenshot 2021-10-19 at 12 32 33

Screenshot 2021-10-19 at 12 48 33

Screenshot 2021-10-19 at 12 48 46

Screenshot 2021-10-19 at 12 48 56

When labels won't fit in the cell, even scaling down to the minFontSize, then it will be hidden:

Screenshot 2021-10-20 at 12 19 41

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:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@dej611
Copy link
Contributor Author

dej611 commented Sep 8, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@dej611
Copy link
Contributor Author

dej611 commented Sep 14, 2021

Waiting on #111991 to be merged to unblock this PR.

@dej611
Copy link
Contributor Author

dej611 commented Sep 14, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Sep 16, 2021

@elasticmachine merge upstream

@dej611
Copy link
Contributor Author

dej611 commented Oct 18, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

merge conflict between base and head

@dej611 dej611 added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Oct 19, 2021
@dej611
Copy link
Contributor Author

dej611 commented Oct 19, 2021

@elasticmachine merge upstream

@dej611 dej611 marked this pull request as ready for review October 20, 2021 10:28
@dej611 dej611 requested a review from a team as a code owner October 20, 2021 10:28
@elasticmachine
Copy link
Contributor

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

@dej611 dej611 added the v8.1.0 label Oct 20, 2021
@dej611
Copy link
Contributor Author

dej611 commented Oct 20, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/ml/jobs/categorization_field_examples·ts.apis Machine Learning jobs Categorization example endpoint - invalid, too many tokens.

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]     │
[00:00:00]       └-: apis
[00:00:00]         └-> "before all" hook in "apis"
[00:10:20]         └-: Machine Learning
[00:10:20]           └-> "before all" hook in "Machine Learning"
[00:10:20]           └-> "before all" hook in "Machine Learning"
[00:10:20]             │ debg creating role ft_ml_source
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source]
[00:10:20]             │ debg creating role ft_ml_source_readonly
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_source_readonly]
[00:10:20]             │ debg creating role ft_ml_dest
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest]
[00:10:20]             │ debg creating role ft_ml_dest_readonly
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_dest_readonly]
[00:10:20]             │ debg creating role ft_ml_ui_extras
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_ml_ui_extras]
[00:10:20]             │ debg creating role ft_default_space_ml_all
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_all]
[00:10:20]             │ debg creating role ft_default_space1_ml_all
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_all]
[00:10:20]             │ debg creating role ft_all_spaces_ml_all
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_all]
[00:10:20]             │ debg creating role ft_default_space_ml_read
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_read]
[00:10:20]             │ debg creating role ft_default_space1_ml_read
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space1_ml_read]
[00:10:20]             │ debg creating role ft_all_spaces_ml_read
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_all_spaces_ml_read]
[00:10:20]             │ debg creating role ft_default_space_ml_none
[00:10:20]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [ft_default_space_ml_none]
[00:10:20]             │ debg creating user ft_ml_poweruser
[00:10:20]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser]
[00:10:20]             │ debg created user ft_ml_poweruser
[00:10:20]             │ debg creating user ft_ml_poweruser_spaces
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_spaces]
[00:10:21]             │ debg created user ft_ml_poweruser_spaces
[00:10:21]             │ debg creating user ft_ml_poweruser_space1
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_space1]
[00:10:21]             │ debg created user ft_ml_poweruser_space1
[00:10:21]             │ debg creating user ft_ml_poweruser_all_spaces
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_poweruser_all_spaces]
[00:10:21]             │ debg created user ft_ml_poweruser_all_spaces
[00:10:21]             │ debg creating user ft_ml_viewer
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer]
[00:10:21]             │ debg created user ft_ml_viewer
[00:10:21]             │ debg creating user ft_ml_viewer_spaces
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_spaces]
[00:10:21]             │ debg created user ft_ml_viewer_spaces
[00:10:21]             │ debg creating user ft_ml_viewer_space1
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_space1]
[00:10:21]             │ debg created user ft_ml_viewer_space1
[00:10:21]             │ debg creating user ft_ml_viewer_all_spaces
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_viewer_all_spaces]
[00:10:21]             │ debg created user ft_ml_viewer_all_spaces
[00:10:21]             │ debg creating user ft_ml_unauthorized
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized]
[00:10:21]             │ debg created user ft_ml_unauthorized
[00:10:21]             │ debg creating user ft_ml_unauthorized_spaces
[00:10:21]             │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [ft_ml_unauthorized_spaces]
[00:10:21]             │ debg created user ft_ml_unauthorized_spaces
[00:14:36]           └-: jobs
[00:14:36]             └-> "before all" hook in "jobs"
[00:14:36]             └-: Categorization example endpoint - 
[00:14:36]               └-> "before all" hook for "valid with good number of tokens"
[00:14:36]               └-> "before all" hook for "valid with good number of tokens"
[00:14:36]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "mappings.json"
[00:14:36]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Loading "data.json.gz"
[00:14:36]                 │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [ft_categorization] creating index, cause [api], templates [], shards [1]/[0]
[00:14:36]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Created index "ft_categorization"
[00:14:36]                 │ debg [x-pack/test/functional/es_archives/ml/categorization] "ft_categorization" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:14:37]                 │ info [x-pack/test/functional/es_archives/ml/categorization] Indexed 1501 docs into "ft_categorization"
[00:14:37]                 │ debg applying update to kibana config: {"dateFormat:tz":"UTC"}
[00:14:38]               └-> valid with good number of tokens
[00:14:38]                 └-> "before each" hook: global before each for "valid with good number of tokens"
[00:14:38]                 └- ✓ pass  (144ms)
[00:14:38]               └-> invalid, too many tokens.
[00:14:38]                 └-> "before each" hook: global before each for "invalid, too many tokens."
[00:14:38]                 │ info [r.suppressed] [node-01] path: /_analyze, params: {}
[00:14:38]                 │      org.elasticsearch.transport.RemoteTransportException: [node-01][127.0.0.1:63241][indices:admin/analyze[s]]
[00:14:38]                 │      Caused by: java.lang.IllegalStateException: The number of tokens produced by calling _analyze has exceeded the allowed maximum of [10000]. This limit can be set by changing the [index.analyze.max_token_count] index level setting.
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction$TokenCounter.increment(TransportAnalyzeAction.java:397) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.simpleAnalyze(TransportAnalyzeAction.java:229) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:204) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:122) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:110) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:62) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.support.single.shard.TransportSingleShardAction.lambda$asyncShardOperation$0(TransportSingleShardAction.java:99) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.ActionRunnable.lambda$supply$0(ActionRunnable.java:47) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.action.ActionRunnable$2.doRun(ActionRunnable.java:62) ~[elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:737) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:26) [elasticsearch-8.0.0-SNAPSHOT.jar:8.0.0-SNAPSHOT]
[00:14:38]                 │      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
[00:14:38]                 │      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
[00:14:38]                 │      	at java.lang.Thread.run(Thread.java:833) [?:?]
[00:14:38]                 └- ✖ fail: apis Machine Learning jobs Categorization example endpoint -  invalid, too many tokens.
[00:14:38]                 │       Error: expected 'partially_valid' to sort of equal 'invalid'
[00:14:38]                 │       + expected - actual
[00:14:38]                 │ 
[00:14:38]                 │       -partially_valid
[00:14:38]                 │       +invalid
[00:14:38]                 │       
[00:14:38]                 │       at Assertion.assert (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/expect/expect.js:100:11)
[00:14:38]                 │       at Assertion.eql (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/expect/expect.js:244:8)
[00:14:38]                 │       at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:302:44)
[00:14:38]                 │       at runMicrotasks (<anonymous>)
[00:14:38]                 │       at processTicksAndRejections (node:internal/process/task_queues:96:5)
[00:14:38]                 │       at Object.apply (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:14:38]                 │ 
[00:14:38]                 │ 

Stack Trace

Error: expected 'partially_valid' to sort of equal 'invalid'
    at Assertion.assert (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/expect/expect.js:244:8)
    at Context.<anonymous> (test/api_integration/apis/ml/jobs/categorization_field_examples.ts:302:44)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Object.apply (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16) {
  actual: 'partially_valid',
  expected: 'invalid',
  showDiff: true
}

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 834 835 +1

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
lens 235 236 +1

Async chunks

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

id before after diff
lens 1.0MB 1.0MB +513.0B
Unknown metric groups

API count

id before after diff
lens 253 254 +1

History

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

Copy link
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Code LGTM! I like this addition and personally I am fine with the selected font sizes, I couldn't find any case that these font sizes are not ideal. :)

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.

Looks good to me. Tested on FF and works as expected!

@dej611
Copy link
Contributor Author

dej611 commented Oct 25, 2021

@elasticmachine merge upstream

@dej611 dej611 added v8.0.0 and removed v8.1.0 labels Oct 25, 2021
@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Test Failures

  • [job] [logs] Default CI Group #6 / apis SecuritySolution Endpoints hosts Make sure that we get Last Seen for a Host with docValueFields

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 834 835 +1

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
lens 235 236 +1

Async chunks

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

id before after diff
lens 1.0MB 1.0MB +513.0B
Unknown metric groups

API count

id before after diff
lens 253 254 +1

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

@dej611 dej611 merged commit cf2a3f5 into elastic:master Oct 25, 2021
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 27, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 106406 or prevent reminders by adding the backport:skip label.

3 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 106406 or prevent reminders by adding the backport:skip label.

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 106406 or prevent reminders by adding the backport:skip label.

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 106406 or prevent reminders by adding the backport:skip label.

@stratoula stratoula added backport:skip This commit does not require backporting and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Nov 1, 2021
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 2, 2021
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 106406 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 2, 2021
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:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Add Heatmap option to show cell values
5 participants