-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[XY] Usable reference lines for xyVis
.
#132192
[XY] Usable reference lines for xyVis
.
#132192
Conversation
# Conflicts: # src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts
# Conflicts: # src/plugins/chart_expressions/expression_xy/common/expression_functions/common_reference_line_layer_args.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/extended_reference_line_layer.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/reference_line_layer.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts # src/plugins/chart_expressions/expression_xy/common/types/expression_functions.ts
Pinging @elastic/kibana-vis-editors @elastic/kibana-vis-editors-external (Team:VisEditors) |
Pinging @elastic/kibana-presentation (Team:Presentation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just seeing a file rename. 👍
# Conflicts: # packages/kbn-optimizer/limits.yml
# Conflicts: # src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts # src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts
High level feedback: It seems like this change is only relevant for being able to conveniently place reference lines via expression, but the change propagates through to the actual elastic-charts spec too, including some duplication of logic in |
@flash1293, on the other hand, I can't agree with such a point of view. Here are some arguments for the current solution and against merging those two logics:
|
I don't agree with this view - the point of a unified renderer is to keep it aligned in terms of features and code. Branching out into different implementations should be avoided as much as possible and in the current state I'm seeing a bunch of opportunities to avoid branching. For example the files |
...plugins/chart_expressions/expression_xy/public/components/reference_lines/reference_line.tsx
Outdated
Show resolved
Hide resolved
src/plugins/chart_expressions/expression_xy/common/expression_functions/reference_line.ts
Show resolved
Hide resolved
src/plugins/chart_expressions/expression_xy/public/components/reference_lines.tsx
Show resolved
Hide resolved
# Conflicts: # src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
History
To update your PR or re-run it, just comment with: cc @Kunzetsov |
@flash1293, I fill like you should restart your kibana. Line 39 in 8846369
|
Tested around and from what I can tell this works really well. One thing I noticed - the standalone reference lines do not try to do the segmenting if they color into the same direction: https://github.com/elastic/kibana/pull/132192/files#diff-f588e9251dfe7febff5c66997c7f3acbcfbd16e41f0d123109cabeef96fb21bdR64 This results in overlapping colors: What about adopting the same logic of the reference line layer for all standalone reference lines? It's a neat use case to be able to color the areas in the same direction to create "sections" in the chart. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving to not block the PR
@flash1293, I'll add the feature you've mentioned at the follow-up PR. Thanks for the really good point. I've totally missed it 😃 |
Summary
Closes part of the issue.
Added
referenceLine
expression, which is usable for users. It enables the possibility to provide static value for the reference line at thexyVis
expression function.Example
Usage