-
Notifications
You must be signed in to change notification settings - Fork 915
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
Finalize eligibility check for augmenting visualizations by vis augmenter #3687
Finalize eligibility check for augmenting visualizations by vis augmenter #3687
Conversation
… to augment Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
src/plugins/vis_type_vega/public/expressions/line_vega_spec_fn.ts
Outdated
Show resolved
Hide resolved
src/plugins/vis_type_vega/public/expressions/line_vega_spec_fn.ts
Outdated
Show resolved
Hide resolved
…ect/OpenSearch-Dashboards into eligibility-check
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## feature/feature-anywhere #3687 +/- ##
============================================================
+ Coverage 66.50% 66.51% +0.01%
============================================================
Files 3244 3244
Lines 62432 62448 +16
Branches 9637 9642 +5
============================================================
+ Hits 41520 41539 +19
+ Misses 18604 18576 -28
- Partials 2308 2333 +25
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
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!
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!
@@ -49,7 +50,22 @@ export const formatDatatable = ( | |||
datatable.columns.forEach((column) => { | |||
// clean quotation marks from names in columns | |||
column.name = cleanString(column.name); | |||
// clean ids to remove "." as that will cause vega to not process it correctly. |
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.
just a question here: can we just rename the ids so they do not include '.'?
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 we change it how it is in OpenSearchDashboardsDatatable
, this can cause a lot of implications as we need to modify OpenSearchaggsExpressionFunction
.
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.
@lezzago Looks good - a couple questions and some minor style suggestions, which can be implemented in a follow-up PR if you'd prefer.
const invalidConfigStates = [ | ||
{ | ||
enabled: true, | ||
type: 'date_histogram', | ||
params: {}, | ||
}, | ||
{ | ||
enabled: true, | ||
type: 'dot', | ||
params: {}, | ||
schema: 'radius', | ||
}, | ||
{ | ||
enabled: true, | ||
type: 'metrics', | ||
params: {}, | ||
schema: 'metrics', | ||
}, | ||
]; |
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.
Style nit for test readability - I prefer to clone the existing default object so that it's easier to see exactly which changes take it from valid to invalid. Something like
const invalidConfigStates = [ | |
{ | |
enabled: true, | |
type: 'date_histogram', | |
params: {}, | |
}, | |
{ | |
enabled: true, | |
type: 'dot', | |
params: {}, | |
schema: 'radius', | |
}, | |
{ | |
enabled: true, | |
type: 'metrics', | |
params: {}, | |
schema: 'metrics', | |
}, | |
]; | |
const invalidConfigStates = [ | |
...configStates, | |
{ | |
enabled: true, | |
type: 'dot', | |
params: {}, | |
schema: 'radius', | |
}, | |
]; |
(and I'd probably rename configStates
to validConfigStates
to make it even easier to mentally track.)
Or maybe even just define the two default config states separately so that you can compose them, for instance L103-114 could be written like:
const invalidConfigStates = [
validMetricConfigState,
{
...validDateHistConfigState,
type: 'histogram',
},
];
Just some ideas to play around with.
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 made some updates for this to improve this, but more improvements can happen if we make these into data models. That can be done in a future PR.
// Percentile ranks aggregation metric needs percentile formatting. | ||
if (column.meta?.type === 'percentile_ranks') Object.assign(subAxis, { format: '.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.
interesting finding!
@@ -5,5 +5,5 @@ | |||
"ui": true, | |||
"requiredPlugins": ["charts", "data", "expressions", "visualizations", "opensearchDashboardsLegacy", "visTypeVega"], | |||
"optionalPlugins": ["visTypeXy"], | |||
"requiredBundles": ["opensearchDashboardsUtils", "visDefaultEditor"] | |||
"requiredBundles": ["opensearchDashboardsUtils", "visDefaultEditor", "visAugmenter"] |
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 the future, I still think there's a better way to set this up, so that visAugmenter can simply specify that vega-lite rendering should be used, and it wouldn't be necessary to import here. But that's something we an come back to.
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.
Yea that seems like a better way to structure this, but we would have to come back to that later.
…ect/OpenSearch-Dashboards into eligibility-check
Signed-off-by: Ashish Agrawal <ashisagr@amazon.com>
Description
Finalize eligibility check for augmenting visualizations by vis augmenter
Eligibility Requirements:
metric
aggregation typesdate histogram
aggregation type for the X-axis bucketIssues Resolved
#3268
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr