-
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] xyVis
and layeredXyVis
.
#128255
[XY] xyVis
and layeredXyVis
.
#128255
Conversation
…to chart_expressions-xy
# Conflicts: # src/plugins/chart_expressions/expression_xy/common/expression_functions/legend_config.ts # x-pack/plugins/lens/public/xy_visualization/visualization.tsx
…to chart_expressions-xy
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.
Tested around a bit more and couldn't find anything that doesn't work. LGTM!
if (!aliases?.length) { | ||
throw new Error(`${fnDef.name} requires an argument`); | ||
} | ||
|
||
// use an alias if _ is the missing arg | ||
const errorArg = name === '_' ? aliases[0] : name; |
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.
this line has a potential to throw (when aliases is not an array).
const errorArg = name === '_' && aliases?.length ? aliases[0] : name;
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.
I've checked it. name
can't have the name _
. It should be in aliases. So, in any case, you'll have the first element. Am I wrong?
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.
kibana/src/plugins/expressions/common/expression_functions/expression_function_parameter.ts
Line 30 in e8f59a5
if (name === '_') { |
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.
in that case we should get rid of errorArg
and just use name
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.
Checked everything. Works as expected. That check was not used.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
merge conflict between base and head |
…pressions-xy-extended_layers # Conflicts: # src/plugins/chart_expressions/expression_xy/common/expression_functions/annotation_layer.ts # src/plugins/chart_expressions/expression_xy/public/components/annotations.tsx # src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx # src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx # src/plugins/event_annotation/common/index.ts # src/plugins/event_annotation/common/manual_event_annotation/index.ts # src/plugins/event_annotation/common/types.ts # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/annotations_config_panel/index.tsx # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/color_picker.tsx # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/icon_select.tsx # x-pack/plugins/lens/public/xy_visualization/xy_config_panel/shared/marker_decoration_settings.tsx
# Conflicts: # src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx
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.
LGTM
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
To update your PR or re-run it, just comment with: cc @Kunzetsov |
* Added extended layers expressions. * Added support of tables at layers. * Added annotations to layeredXyVIs. * Refactored the implementation to be reusable. * Fixed undefined layers. * Fixed empty arrays problems. * Fixed input translations and removed not used arguments. * Fixed missing required args error, and added required to arguments. * Simplified expression configuration. * Added strict to all the expressions. * Moved dataLayer to the separate component. * Refactored dataLayers helpers and xy_chart. * fillOpacity usage validation is added. * Fixed valueLabels argument options. Removed not used. Added validation for usage. * Added validation to the layeredXyVis. * Fixed extent validation. Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
* Added extended layers expressions. * Added support of tables at layers. * Added annotations to layeredXyVIs. * Refactored the implementation to be reusable. * Fixed undefined layers. * Fixed empty arrays problems. * Fixed input translations and removed not used arguments. * Fixed missing required args error, and added required to arguments. * Simplified expression configuration. * Added strict to all the expressions. * Moved dataLayer to the separate component. * Refactored dataLayers helpers and xy_chart. * fillOpacity usage validation is added. * Fixed valueLabels argument options. Removed not used. Added validation for usage. * Added validation to the layeredXyVis. * Fixed extent validation. Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Marta Bondyra <[email protected]> Co-authored-by: Marta Bondyra <[email protected]>
I apologize for adding this comment now, but I'm trying to understand something. With this change, the ability to scale axes to data bounds was removed for bar charts. Could anyone explain why that was done? My company has several visualizations that became unusable because of that behavior change. |
Completes #128056 and part of #127115
Changes made:
layeredXyVis
andxyVis
expressions are splitted.title
anddescription
arguments are removed fromlayeredXyVis
andxyVis
.DataLayers
component is added and code has been simplified.xyVis
has changed to be used atCanvas
.strict
,default
andrequired
has been added to the arguments to make the expression use-friendly.yConfig
andextendedYConfig
are splitted.yConfig
is used for configuration ofdataLayer
andextendedDataLayer
, it contains only options, which are appliable to the dataLayer.extendedYConfig
contains all the configuration, which is appliable to thereferenceLineLayer
.icon
argument fromreferenceLineLayer
should contain limited amount of available variants for user to be easy to use this expression.legendSize
disabling at Lens, iflegendPosition
isinside
.extent.mode
, when it is turned todataBounds
and there are noline
chart series.Will be done in the separate PRs
referenceLineLayer
should contain the additional argument for the static value. Otherwise, it is impossible forCanvas'
users to use thereferenceLineLayer
expression via accessors, if they want some static value.annotationLayers
should become usable from Canvas. Now the annotation is not appearing in the chart if used with the other datasource expression function from the one, used in Lens.Testing notes
layeredXyVis
should be tested viaLens
. As we've got rid of layerIds at thelayeredXyVis
, it was required to add some logic of remapping back dataLayer indexes to the layerIds of Lens, as this part of Kibana is tightly coupled with layerIds logic. So, should be checked if all the places, whereactiveData
is used, it was remapped with theVisualization.convertActiveData
.series
types.Lens
must work as before, withouterrors
from theexpressions
side. As we've got rid ofxyVis
should be tested fromCanvas
with different variations of arguments (starting from zero arguments. The main goal of this PR was to make this expression usable forCanvas'
users. It has to guide users on how to use it.).referenceLineLayers
andannotationLayers
are not usable fromCanvas
yet.Example of the expression for the testing in
Canvas