Vislib visualization renderer#80744
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
- use a serialiizable ms form of interval - recompute interval from esValue and esUnit not ms - remove legacy vislib code from build_pipeline
|
@elastic/kibana-design and @elastic/kibana-app could I get a review please 🙏 |
sulemanof
left a comment
There was a problem hiding this comment.
LGTM 👍
Tested locally all affected vis types in Chrome & Firefox. Didn't find any regressions.
There was a problem hiding this comment.
@nickofthyme, I tested locally and everything seems to work as expected. There's only one minor scss change that you can do.
| @import './vislib/index' | ||
| @import './vislib/index'; | ||
|
|
||
| .vislib .visLegend__toggle { |
There was a problem hiding this comment.
These styles can be moved to src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss.
stratoula
left a comment
There was a problem hiding this comment.
It looks great 👏 I have some minor comments that mainly have to do to remove lodash but it is LGTM. Tested locally on Safari and can't find any regression. Great size reduction 🥳
|
|
||
| interface RenderValue { | ||
| visConfig: VisParams; | ||
| visData: any; |
There was a problem hiding this comment.
can we use unknown instead here?
| const usedValueAxis = (visConfig.valueAxes || []).find( | ||
| (valueAxis) => valueAxis.id === seriesParam.valueAxis | ||
| ); | ||
| if (get(usedValueAxis, 'scale.mode') === 'percentage') { |
There was a problem hiding this comment.
Can we avoid import get from lodash here and use typescript instead?
| yDimension.format = { id: 'percent' }; | ||
| } | ||
| } | ||
| if (get(visConfig, 'gauge.percentageMode') === true) { |
There was a problem hiding this comment.
Here too, in that way we don't need to use lodash at all 😄
| mountLegend(visData: any, position: Positions) { | ||
| this.unmount = mountReactNode( | ||
| mountLegend( | ||
| visData: any, |
There was a problem hiding this comment.
And I think this could be unknown too
| return false; | ||
| } | ||
|
|
||
| const rows: object[] | undefined = get(visData, 'rows'); |
There was a problem hiding this comment.
I suggest to not use lodash here too.
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]@kbn/optimizer bundle module count
async chunk count
async chunks size
distributable file count
page load bundle size
History
To update your PR or re-run it, just comment with: |
Summary
Part of #46801
Implement a custom renderer for table visualization. This PR includes next changes:
toExpressionAstfunction for all vislib types and separate function for pie type.Before
After
Checklist