-
Notifications
You must be signed in to change notification settings - Fork 871
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
base: main
Are you sure you want to change the base?
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 63.82% 63.84% +0.02%
==========================================
Files 3650 3660 +10
Lines 80966 81216 +250
Branches 12894 12948 +54
==========================================
+ Hits 51673 51856 +183
- Misses 26126 26181 +55
- Partials 3167 3179 +12
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
This PR integrates pie charts into VisBuilder using Vega rendering. Issue Resolve: opensearch-project#7607 Signed-off-by: Anan Zhuang <[email protected]>
@@ -50,5 +51,18 @@ export const validateAggregations = (aggs: AggConfig[]): ValidationResult => { | |||
}; | |||
} | |||
|
|||
const splitSchema = schemas?.find((s) => s.name === 'split'); | |||
if (splitSchema && splitSchema.mustBeFirst) { |
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:
if (splitSchema && splitSchema.mustBeFirst) { | |
if (splitSchema?.mustBeFirst) { |
const defaultVisualizationTypes = [ | ||
createHistogramConfig, | ||
createLineConfig, | ||
createAreaConfig, | ||
createMetricConfig, | ||
createTableConfig, | ||
]; | ||
|
||
const visualizationTypes = useVega | ||
? [...defaultVisualizationTypes, createPieConfig] | ||
: defaultVisualizationTypes; | ||
|
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.
why not just
const defaultVisualizationTypes = [ | |
createHistogramConfig, | |
createLineConfig, | |
createAreaConfig, | |
createMetricConfig, | |
createTableConfig, | |
]; | |
const visualizationTypes = useVega | |
? [...defaultVisualizationTypes, createPieConfig] | |
: defaultVisualizationTypes; | |
const visualizationTypes = [ | |
createHistogramConfig, | |
createLineConfig, | |
createAreaConfig, | |
createMetricConfig, | |
createTableConfig, | |
]; | |
if (useVega) visualizationTypes.push(createPieConfig); | |
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) { |
|
||
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 = []
?
}); | ||
}; | ||
|
||
if (group && group.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 (group && group.length !== 0) { | |
if (Array.isArray(group) && group.length !== 0) { |
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