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] Visualizations are tightly coupled to specific functions based on operation.dataType #75702

Closed
wylieconlon opened this issue Aug 21, 2020 · 1 comment · Fixed by #75703
Assignees
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture
Projects

Comments

@wylieconlon
Copy link
Contributor

This is both cleaning up tech debt in Lens and setting us up for the date ranges and a combined number histogram/range function. The main issue is that we are coupling the data type and expected display behavior. The nice thing is that we already have a second parameter on OperationMetadata which should be used instead:

export interface OperationMetadata {
  dataType: DataType;
  scale?: 'ordinal' | 'interval' | 'ratio';

The main difference is that histograms are interval type, and other bucket aggregations are ordinal type. Here are the places that I have identified as needing to change:

  • The XY suggestion logic looks at dataType === 'date' to determine the X axis. It should instead use operationMetadata.scaleType === 'interval', so that number histograms are placed on the X axis.
  • Pie charts reject dataType === 'date' in suggestions, but instead they should reject scaleType === 'interval'
  • The XY title logic uses special logic for dataType === 'date' when building titles. It probably should
  • The handleFilterClick function on datatables is looking up the time field only for date histograms, but not date functions in general.
@wylieconlon wylieconlon added technical debt Improvement of the software architecture and operational architecture Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Lens labels Aug 21, 2020
@wylieconlon wylieconlon added this to Long-term goals in Lens via automation Aug 21, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@wylieconlon wylieconlon self-assigned this Aug 21, 2020
Lens automation moved this from Long-term goals to Done Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens Team:Visualizations Visualization editors, elastic-charts and infrastructure technical debt Improvement of the software architecture and operational architecture
Projects
No open projects
Lens
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants