-
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
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 🙏 |
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 👍
Tested locally all affected vis types in Chrome & Firefox. Didn't find any regressions.
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These styles can be moved to src/plugins/vis_type_vislib/public/vislib/components/legend/_legend.scss
.
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.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use unknown
instead here?
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.
const usedValueAxis = (visConfig.valueAxes || []).find( | ||
(valueAxis) => valueAxis.id === seriesParam.valueAxis | ||
); | ||
if (get(usedValueAxis, 'scale.mode') === 'percentage') { |
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.
Can we avoid import get
from lodash here and use typescript instead?
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.
yDimension.format = { id: 'percent' }; | ||
} | ||
} | ||
if (get(visConfig, 'gauge.percentageMode') === true) { |
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.
Here too, in that way we don't need to use lodash at all 😄
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.
mountLegend(visData: any, position: Positions) { | ||
this.unmount = mountReactNode( | ||
mountLegend( | ||
visData: any, |
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.
And I think this could be unknown too
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.
return false; | ||
} | ||
|
||
const rows: object[] | undefined = get(visData, 'rows'); |
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 suggest to not use lodash here too.
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.
@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:
toExpressionAst
function for all vislib types and separate function for pie type.Before
After
Checklist