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] Chart switch redesign #187475

Merged
merged 50 commits into from
Sep 5, 2024
Merged

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jul 3, 2024

Summary

  1. The main change is chart switch redesign:
Screenshot 2024-08-26 at 15 08 50
  1. Toolbar changes for most of the visualization (refer to design files)
Screenshot 2024-08-26 at 15 09 14 Screenshot 2024-08-26 at 15 08 56

Subtasks

  • reorders the elements in the charts switch
  • redesigns chart switch visually
  • adds deprecated group (metric)
  • changes the add subtype layer menu
  • adds description to chart switch
  • subselect for bar/gauge visualizations
  • adds border to workspace panel
  • changes boxesHorizontal icon to boxesVertical

Resolves #179260 also fixes #182677
switching between chart types

@mbondyra mbondyra added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens backport:skip This commit does not require backporting v6.8.16 labels Jul 3, 2024
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch from bc50c4e to a5d18d0 Compare July 4, 2024 14:47
@mbondyra mbondyra added v8.16.0 and removed v6.8.16 labels Jul 5, 2024
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch 2 times, most recently from bef1672 to 9b10b1d Compare July 16, 2024 10:07
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch 4 times, most recently from 960ba69 to 3eaf12c Compare July 29, 2024 08:59
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch 2 times, most recently from 76898c4 to 4058ab7 Compare August 7, 2024 10:38
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch 7 times, most recently from 42def81 to 42112c0 Compare August 23, 2024 09:12
@elastic elastic deleted a comment from kibana-ci Aug 23, 2024
@elastic elastic deleted a comment from kibana-ci Aug 23, 2024
@mbondyra mbondyra force-pushed the lens/chart_switch_redesign branch 2 times, most recently from fb7c929 to 15c5677 Compare August 26, 2024 11:05
@elastic elastic deleted a comment from kibana-ci Aug 26, 2024
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 those changes so quickly, @mbondyra! Looks great. Leaving you some final comments below, but nothing worth holding you up over. Assuming you're able to address them, approving now.

@gvnmagni
Copy link

gvnmagni commented Sep 2, 2024

Apologies for not noticing this earlier, @markov00 made me how the description of charts might need a little review, I'll try write a few considerations here by the end of the day

@gvnmagni
Copy link

gvnmagni commented Sep 2, 2024

Here I am with a few suggestions, please consider that as options, everything is up to discuss:

Bar
Current: Compare categories or groups of data via bars.
Proposal: Compare categories or groups of data with bars.

Line
Current: Reveal variations in data over time or categorically.
Proposal: Reveal variations in data over time.

Area
Compare distributions of cumulative data trends.
nothing to change

Metric
Present individual key metrics or KPIs.
nothing to change

Table
Organize data in structured rows and columns.
nothing to change

Pie
Current: Display proportions of a whole in a circular format.
Proposal: Display parts of a whole in a circular format.

Gauge
Show progress to a goal in linear or arced style.
nothing to change

Heat map
Show density or distribution across two dimensions.
nothing to change

Waffle
Represent data proportions via a grid of colored cells.
nothing to change

Region map
Show geographic data using colored regions.
nothing to change

Treemap
Current: Use nested rectangles to show proportionality.
Proposal: Use nested rectangles to show proportions and hierarchy.

Tag cloud
Current: Visualize text data frequency or importance.
nothing to change

Mosaic
Current: Show proportions of categorical data via rectangles.
Proposal: Show proportions of categorical data with rectangles.

Legacy Metric
Present individual key metrics or KPIs.
nothing to change

…rt_switch_redesign

# Conflicts:
#	x-pack/plugins/lens/public/visualizations/partition/toolbar.tsx
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 1868 1872 +4
eventAnnotationListing 569 573 +4
expressionGauge 103 107 +4
expressionHeatmap 174 178 +4
expressionPartitionVis 189 193 +4
expressionTagcloud 163 167 +4
expressionXY 250 254 +4
infra 1504 1508 +4
lens 1439 1447 +8
maps 1232 1236 +4
observability 1045 1049 +4
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
@kbn/chart-icons 84 90 +6
@kbn/test-eui-helpers 18 19 +1
lens 586 589 +3
total +10

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/test-eui-helpers 0 1 +1

Async chunks

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

id before after diff
apm 3.5MB 3.5MB +104.0B
expressionGauge 22.6KB 21.9KB -642.0B
expressionHeatmap 26.6KB 26.7KB +102.0B
expressionPartitionVis 36.5KB 35.9KB -612.0B
expressionTagcloud 18.8KB 19.0KB +132.0B
expressionXY 129.3KB 127.7KB -1.6KB
infra 1.5MB 1.5MB +105.0B
lens 1.5MB 1.5MB +26.8KB
maps 3.0MB 3.0MB +164.0B
observability 461.8KB 461.7KB -103.0B
total +24.4KB

Page load bundle

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

id before after diff
eventAnnotationListing 11.1KB 11.0KB -103.0B
lens 51.7KB 51.6KB -88.0B
total -191.0B
Unknown metric groups

API count

id before after diff
@kbn/chart-icons 84 90 +6
@kbn/test-eui-helpers 36 37 +1
lens 688 691 +3
total +10

History

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

@mbondyra mbondyra merged commit 9e8244f into elastic:main Sep 5, 2024
21 checks passed
@mbondyra mbondyra deleted the lens/chart_switch_redesign branch September 5, 2024 10:32
mbondyra added a commit that referenced this pull request Oct 15, 2024
With [PR #187475](https://github.com/elastic/kibana/pull/187475/files)
we introduced a bug, affecting the AI assistant's suggestions API when
switching between different chart types (e.g., from bar to line chart).
This feature relies on the switchVisualizationType method, which was
changed to require a `layerId`. However, the suggestions API does not
provide `layerId`, causing the chart type to not switch as expected.

Solution:
The bug can be resolved by modifying the logic in the
`switchVisualizationType` method. We changed:

```ts
const dataLayer = state.layers.find((l) => l.layerId === layerId);
```

to:

```ts
const dataLayer = state.layers.find((l) => l.layerId === layerId) ?? state.layers[0];
```

This ensures that the suggestions API falls back to the first layer if
no specific layerId is provided.

---------

Co-authored-by: Marco Vettorello <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 15, 2024
…#196295)

With [PR elastic#187475](https://github.com/elastic/kibana/pull/187475/files)
we introduced a bug, affecting the AI assistant's suggestions API when
switching between different chart types (e.g., from bar to line chart).
This feature relies on the switchVisualizationType method, which was
changed to require a `layerId`. However, the suggestions API does not
provide `layerId`, causing the chart type to not switch as expected.

Solution:
The bug can be resolved by modifying the logic in the
`switchVisualizationType` method. We changed:

```ts
const dataLayer = state.layers.find((l) => l.layerId === layerId);
```

to:

```ts
const dataLayer = state.layers.find((l) => l.layerId === layerId) ?? state.layers[0];
```

This ensures that the suggestions API falls back to the first layer if
no specific layerId is provided.

---------

Co-authored-by: Marco Vettorello <[email protected]>
(cherry picked from commit e476220)
kibanamachine added a commit that referenced this pull request Oct 15, 2024
…196295) (#196448)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Lens] Fix switchVisualizationType to use it without layerId
(#196295)](#196295)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marta
Bondyra","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-15T21:53:00Z","message":"[Lens]
Fix switchVisualizationType to use it without layerId (#196295)\n\nWith
[PR #187475](https://github.com/elastic/kibana/pull/187475/files)\r\nwe
introduced a bug, affecting the AI assistant's suggestions API
when\r\nswitching between different chart types (e.g., from bar to line
chart).\r\nThis feature relies on the switchVisualizationType method,
which was\r\nchanged to require a `layerId`. However, the suggestions
API does not\r\nprovide `layerId`, causing the chart type to not switch
as expected.\r\n\r\nSolution:\r\nThe bug can be resolved by modifying
the logic in the\r\n`switchVisualizationType` method. We
changed:\r\n\r\n```ts\r\nconst dataLayer = state.layers.find((l) =>
l.layerId === layerId);\r\n```\r\n\r\nto:\r\n\r\n```ts\r\nconst
dataLayer = state.layers.find((l) => l.layerId === layerId) ??
state.layers[0];\r\n```\r\n\r\nThis ensures that the suggestions API
falls back to the first layer if\r\nno specific layerId is
provided.\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Vettorello
<[email protected]>","sha":"e4762201fdd84f372c78bc2a159061e504b26e78","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Visualizations","release_note:skip","Feature:Lens","v9.0.0","backport:prev-minor"],"title":"[Lens]
Fix switchVisualizationType to use it without
layerId","number":196295,"url":"https://github.com/elastic/kibana/pull/196295","mergeCommit":{"message":"[Lens]
Fix switchVisualizationType to use it without layerId (#196295)\n\nWith
[PR #187475](https://github.com/elastic/kibana/pull/187475/files)\r\nwe
introduced a bug, affecting the AI assistant's suggestions API
when\r\nswitching between different chart types (e.g., from bar to line
chart).\r\nThis feature relies on the switchVisualizationType method,
which was\r\nchanged to require a `layerId`. However, the suggestions
API does not\r\nprovide `layerId`, causing the chart type to not switch
as expected.\r\n\r\nSolution:\r\nThe bug can be resolved by modifying
the logic in the\r\n`switchVisualizationType` method. We
changed:\r\n\r\n```ts\r\nconst dataLayer = state.layers.find((l) =>
l.layerId === layerId);\r\n```\r\n\r\nto:\r\n\r\n```ts\r\nconst
dataLayer = state.layers.find((l) => l.layerId === layerId) ??
state.layers[0];\r\n```\r\n\r\nThis ensures that the suggestions API
falls back to the first layer if\r\nno specific layerId is
provided.\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Vettorello
<[email protected]>","sha":"e4762201fdd84f372c78bc2a159061e504b26e78"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196295","number":196295,"mergeCommit":{"message":"[Lens]
Fix switchVisualizationType to use it without layerId (#196295)\n\nWith
[PR #187475](https://github.com/elastic/kibana/pull/187475/files)\r\nwe
introduced a bug, affecting the AI assistant's suggestions API
when\r\nswitching between different chart types (e.g., from bar to line
chart).\r\nThis feature relies on the switchVisualizationType method,
which was\r\nchanged to require a `layerId`. However, the suggestions
API does not\r\nprovide `layerId`, causing the chart type to not switch
as expected.\r\n\r\nSolution:\r\nThe bug can be resolved by modifying
the logic in the\r\n`switchVisualizationType` method. We
changed:\r\n\r\n```ts\r\nconst dataLayer = state.layers.find((l) =>
l.layerId === layerId);\r\n```\r\n\r\nto:\r\n\r\n```ts\r\nconst
dataLayer = state.layers.find((l) => l.layerId === layerId) ??
state.layers[0];\r\n```\r\n\r\nThis ensures that the suggestions API
falls back to the first layer if\r\nno specific layerId is
provided.\r\n\r\n---------\r\n\r\nCo-authored-by: Marco Vettorello
<[email protected]>","sha":"e4762201fdd84f372c78bc2a159061e504b26e78"}}]}]
BACKPORT-->

Co-authored-by: Marta Bondyra <[email protected]>
wajihaparvez added a commit that referenced this pull request Oct 24, 2024
…7543)

## Summary

Updated visuals in Dashboard docs for chart switch redesign and related
changes.

Closes: [#538](elastic/platform-docs-team#538)
Rel: #187475
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…stic#197543)

## Summary

Updated visuals in Dashboard docs for chart switch redesign and related
changes.

Closes: [elastic#538](elastic/platform-docs-team#538)
Rel: elastic#187475
(cherry picked from commit 7ceaf32)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 24, 2024
…stic#197543)

## Summary

Updated visuals in Dashboard docs for chart switch redesign and related
changes.

Closes: [elastic#538](elastic/platform-docs-team#538)
Rel: elastic#187475
(cherry picked from commit 7ceaf32)
kibanamachine added a commit that referenced this pull request Oct 24, 2024
#197543) (#197738)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Docs] Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)](#197543)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"wajihaparvez","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T21:55:01Z","message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v9.0.0","v8.16.0","backport:version","v8.17.0"],"title":"[Docs]
Update Dashboard docs for chart switch redesign in
8.16.0","number":197543,"url":"https://github.com/elastic/kibana/pull/197543","mergeCommit":{"message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197543","number":197543,"mergeCommit":{"message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: wajihaparvez <[email protected]>
kibanamachine added a commit that referenced this pull request Oct 24, 2024
….0 (#197543) (#197737)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Docs] Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)](#197543)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"wajihaparvez","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-24T21:55:01Z","message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Docs","release_note:skip","v9.0.0","v8.16.0","backport:version","v8.17.0"],"title":"[Docs]
Update Dashboard docs for chart switch redesign in
8.16.0","number":197543,"url":"https://github.com/elastic/kibana/pull/197543","mergeCommit":{"message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197543","number":197543,"mergeCommit":{"message":"[Docs]
Update Dashboard docs for chart switch redesign in 8.16.0
(#197543)\n\n## Summary\r\n\r\nUpdated visuals in Dashboard docs for
chart switch redesign and related\r\nchanges.\r\n\r\nCloses:
[#538](https://github.com/elastic/platform-docs-team/issues/538)\r\nRel:
#187475","sha":"7ceaf32fa4014977be80b0c67f12fed44a0fe664"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: wajihaparvez <[email protected]>
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.16.0
Projects
None yet