Skip to content

[lens] remove scale from columns#224519

Merged
ppisljar merged 15 commits intoelastic:mainfrom
ppisljar:lens/cleanupScale
Jul 3, 2025
Merged

[lens] remove scale from columns#224519
ppisljar merged 15 commits intoelastic:mainfrom
ppisljar:lens/cleanupScale

Conversation

@ppisljar
Copy link
Contributor

@ppisljar ppisljar commented Jun 19, 2025

Summary

Removes column.scale as it is not needed.
Each column has a function which converts column to column meta information, on which .scale is available. It actually looks we are already using that column.operation.scale in all places so having the scale on the column itself is unnecessary and is just pollution the SO

@ppisljar ppisljar added Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// release_note:skip Skip the PR/issue when compiling release notes Feature:Lens backport:skip This PR does not require backporting labels Jun 19, 2025
@ppisljar ppisljar force-pushed the lens/cleanupScale branch from 8c5117c to 7462ebf Compare June 23, 2025 10:46
@ppisljar ppisljar marked this pull request as ready for review June 24, 2025 06:41
@ppisljar ppisljar requested review from a team as code owners June 24, 2025 06:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@botelastic botelastic bot added the Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. label Jun 24, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Comment on lines +265 to +269
scale?:
| 'ratio'
| 'ordinal'
| 'interval'
| ((column: C, dataView?: IndexPattern) => 'ratio' | 'ordinal' | 'interval' | undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would avoid polymorphism here and just define a function value to it.
Even for constants the implementation would be trivial.

Comment on lines +178 to +181
const scale =
'scale' in operationDefinition && typeof operationDefinition.scale === 'function'
? operationDefinition.scale(column, dataView as IndexPattern)
: (operationDefinition.scale as 'ratio' | 'ordinal' | 'interval') ?? 'ratio';
Copy link
Contributor

Choose a reason for hiding this comment

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

With only the function definition this would be much better:

const scale = operationDefinition.scale ? operationDefinition.scale(column, dataView as IndexPattern) : 'ratio';

@ppisljar ppisljar added 8.19 candidate and removed backport:skip This PR does not require backporting 8.19 candidate labels Jul 1, 2025
@ppisljar ppisljar enabled auto-merge (squash) July 1, 2025 12:26
@ppisljar ppisljar added the backport This PR is a backport of another PR label Jul 1, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #132 / Search solution tests Search Home page Solution Nav - Search search home page with existing indices "before each" hook for "renders Elasticsearch Documentation content"

Metrics [docs]

Async chunks

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

id before after diff
exploratoryView 141.5KB 141.3KB -172.0B
lens 1.5MB 1.5MB +182.0B
total +10.0B

History

@ppisljar
Copy link
Contributor Author

ppisljar commented Jul 3, 2025

ping @elastic/obs-ux-management-team

@ppisljar ppisljar merged commit 6113a11 into elastic:main Jul 3, 2025
11 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.0, 9.1

https://github.com/elastic/kibana/actions/runs/16043353755

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 3, 2025
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19
9.0
9.1

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 3, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[lens] remove scale from columns
(#224519)](#224519)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Peter
Pisljar","email":"peter.pisljar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T06:37:24Z","message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","Team:Visualizations","release_note:skip","Feature:Lens","Team:obs-ux-management","v8.19.0","v9.2.0","v9.0.4"],"title":"[lens]
remove scale from
columns","number":224519,"url":"https://github.com/elastic/kibana/pull/224519","mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224519","number":224519,"mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Peter Pisljar <peter.pisljar@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 3, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [[lens] remove scale from columns
(#224519)](#224519)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Peter
Pisljar","email":"peter.pisljar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T06:37:24Z","message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","Team:Visualizations","release_note:skip","Feature:Lens","Team:obs-ux-management","v8.19.0","v9.2.0","v9.0.4"],"title":"[lens]
remove scale from
columns","number":224519,"url":"https://github.com/elastic/kibana/pull/224519","mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224519","number":224519,"mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Peter Pisljar <peter.pisljar@elastic.co>
kibanamachine added a commit that referenced this pull request Jul 3, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [[lens] remove scale from columns
(#224519)](#224519)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Peter
Pisljar","email":"peter.pisljar@elastic.co"},"sourceCommit":{"committedDate":"2025-07-03T06:37:24Z","message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","Team:Visualizations","release_note:skip","Feature:Lens","Team:obs-ux-management","v8.19.0","v9.2.0","v9.0.4"],"title":"[lens]
remove scale from
columns","number":224519,"url":"https://github.com/elastic/kibana/pull/224519","mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.0"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224519","number":224519,"mergeCommit":{"message":"[lens]
remove scale from columns
(#224519)","sha":"6113a1188a13e3db8034bd2c3ec3447a963a45ce"}},{"branch":"9.0","label":"v9.0.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Peter Pisljar <peter.pisljar@elastic.co>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.0.4 v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants