-
Notifications
You must be signed in to change notification settings - Fork 923
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
[VisBuilder-Next] Pie Chart Integration for VisBuilder #7752
Conversation
❌ Empty Changelog SectionThe Changelog section in your PR description is empty. Please add a valid changelog entry or entries. If you did add a changelog entry, check to make sure that it was not accidentally included inside the comment block in the Changelog section. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7752 +/- ##
==========================================
+ Coverage 60.93% 60.95% +0.01%
==========================================
Files 3771 3776 +5
Lines 89545 89638 +93
Branches 14017 14045 +28
==========================================
+ Hits 54566 54637 +71
- Misses 31569 31588 +19
- Partials 3410 3413 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
c15a84d
to
4a1f149
Compare
This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7752 Signed-off-by: Anan Zhuang <[email protected]>
This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7752 Signed-off-by: Anan Zhuang <[email protected]>
This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7752 Signed-off-by: Anan Zhuang <[email protected]>
1309ec9
to
5e59033
Compare
src/plugins/vis_builder/public/application/utils/validations/validate_aggregations.ts
Outdated
Show resolved
Hide resolved
const currentLabels = { ...parentLabels, [`level${level}`]: child.name }; | ||
levelSet.add(`level${level}`); | ||
|
||
if (child.children && child.children.length > 0) { |
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.
if (child.children && child.children.length > 0) { | |
if (Array.isArray(child.children) && child.children.length > 0) { |
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.
k. will modify.
|
||
if (child.children && child.children.length > 0) { | ||
flattenSlices(child, split, level + 1, currentLabels); | ||
} else { |
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.
Is this else
safe to happen when child.children = []
?
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 part of the code is generally safe to execute. Every leaf node, nodes without children, has a size property. However, we could make it safer. I have updated in the code.
src/plugins/vis_builder/public/visualizations/vega/utils/helpers.ts
Outdated
Show resolved
Hide resolved
This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7607 Signed-off-by: Anan Zhuang <[email protected]>
Signed-off-by: Anan Zhuang <[email protected]>
@@ -77,6 +79,17 @@ export const DataTab = () => { | |||
} | |||
|
|||
const panelGroups = Array.from(schemas.all.map((schema) => schema.name)); | |||
// Check schema order | |||
if (destinationSchemaName === 'split') { | |||
const validationResult = validateAggregations(aggProps.aggs, schemas.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.
nit: We are only using split schema during validation we can only pass that schema instead of passing in all the schemas
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.
Yeah currently this is an special schema check for pie. It is not appliable for other schemas.
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.
Looks good.
* [VisBuilder-Next] Pie Chart Integration for VisBuilder This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: #7607 --------- Signed-off-by: Anan Zhuang <[email protected]> (cherry picked from commit 615d7d4) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* [VisBuilder-Next] Pie Chart Integration for VisBuilder This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: #7607 --------- (cherry picked from commit 615d7d4) Signed-off-by: Anan Zhuang <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…oject#7752) * [VisBuilder-Next] Pie Chart Integration for VisBuilder This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7607 --------- Signed-off-by: Anan Zhuang <[email protected]>
Description
This PR integrates pie charts into VisBuilder using Vega rendering.
Issues Resolved
#7607
Screenshot
2024-08-20_09-22-11.mp4
2024-08-20_09-54-03.mp4
Changelog
Check List
yarn test:jest
yarn test:jest_integration