-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: add ECharts BoxPlot chart #11199
Merged
Merged
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ae116e3
feat: add ECharts BoxPlot chart
villebro 3fd1fb5
lint
villebro d88548d
fix cypress tests
villebro 6597984
lint
villebro e50f7b9
remove viz.py shim
villebro b37d252
bump plugin package
villebro 2d2fc1e
skip non-legacy plugin cypress dashboard tests
villebro 26b5ee2
fix cypress tests
villebro 41ff604
disable cypress tests for non-leagcy charts
villebro c3da08f
fix bad rebase
villebro d735a99
use midpoint interpolation for quartile calculation
villebro ea2385d
bump packages and add support for no groupby
villebro de644a1
whitespace
villebro 244bb20
whitespace
villebro 1836018
linting
villebro f1e73cc
fix tests
villebro 1bc8118
xit mathjs load test
villebro f2812db
Merge branch 'master' into villebro/boxplot
villebro 83c5d0f
bump mathjs to 8.0.1
villebro fd14da5
Merge branch 'master' into villebro/boxplot
villebro c39f18a
disable cypress filter test for v1 charts
villebro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
superset-frontend/cypress-base/cypress/utils/vizPlugins.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
const V1_PLUGINS = ['box_plot', 'echarts_timeseries', 'word_cloud', 'pie']; | ||
|
||
export function isLegacyChart(vizType: string): boolean { | ||
return !V1_PLUGINS.includes(vizType); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@ktmud (pinging as I noticed you had introduced this test recently) I had to disable this test, as apparently the function annotation layer that was added to the ECharts Timeseries viz loads
mathjs
despite not being used here. The relevant code is here (is called bytransformProps.ts
): https://github.com/apache-superset/superset-ui/blob/master/plugins/plugin-chart-echarts/src/utils/annotation.ts . Is there something that can be done differently to avoid havingmathjs
load 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.
You chart plugin seems to be using a different version of
mathjs
, which is probably incompatible with what's used inAnnotationLayer
control. Do you mind changing them to the same version and see if the test still fails?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.
Ok, good to know, I'll do that 👍
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.
@ktmud I've now upgraded all
mathjs
deps to8.0.1
, and still failing the test. I propose disabling it for now so we can merge this.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.
The test is failing because of this import chain:
@superset-ui/plugin-chart-echarts -> Timeseries -> transformProps -> utils/annotation -> mathjs
. UnlikeloadChart
,transformProps
is not loaded asynchronously, so Webpack could not defer the loading ofmathjs
, which means it will be loaded for all first-visits on almost all pages, undoing part of the optimization we did in #10837 .The test is there to make sure this optimization still works. It didn't break because it was flaky. It caught the breaking changes it is supposed to catch.
It's OK to merge this PR as is for now, but I'd recommend finding ways to move the
mathjs
logic to the chart renderer so that we could continue benefiting from code split and asynchronous loading.In general I think
transformProps
should be as lightweight as possible and preferably only return scalars. It should only be about applying defaults and consolidating parameter names/shapes. Most complex logics should be dealt with either by the chart renderer itself or at another data-processing layer on top of the chart. This way it's easier to reuse your chart at other places outside of Superset charting plugins.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.
Thanks for the context. I'll move the
mathjs
(and any other similar) rendering logic out oftransformProps
and re-enable the test in a subsequent bump.