Skip to content
This repository was archived by the owner on Dec 10, 2021. It is now read-only.

feat(plugin-chart-echarts): subject Update echarts to v5.0.1#928

Merged
villebro merged 11 commits intoapache-superset:masterfrom
maloun96:update_echarts
Feb 4, 2021
Merged

feat(plugin-chart-echarts): subject Update echarts to v5.0.1#928
villebro merged 11 commits intoapache-superset:masterfrom
maloun96:update_echarts

Conversation

@maloun96
Copy link
Copy Markdown
Contributor

@maloun96 maloun96 commented Feb 3, 2021

Update echarts package to version 5.0.1 and change types.

@maloun96 maloun96 requested a review from a team as a code owner February 3, 2021 10:52
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/superset/superset-ui/ez273hb7j
✅ Preview: https://superset-ui-git-fork-maloun96-updateecharts.superset.now.sh

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 3, 2021

Codecov Report

Merging #928 (d685df5) into master (dc36acc) will increase coverage by 0.03%.
The diff coverage is 63.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #928      +/-   ##
==========================================
+ Coverage   27.43%   27.46%   +0.03%     
==========================================
  Files         412      412              
  Lines        8300     8304       +4     
  Branches     1147     1147              
==========================================
+ Hits         2277     2281       +4     
  Misses       5889     5889              
  Partials      134      134              
Impacted Files Coverage Δ
...ins/plugin-chart-echarts/src/components/Echart.tsx 0.00% <0.00%> (ø)
plugins/plugin-chart-echarts/src/types.ts 100.00% <ø> (ø)
...plugin-chart-echarts/src/BoxPlot/transformProps.ts 51.28% <25.00%> (+1.28%) ⬆️
...ins/plugin-chart-echarts/src/Pie/transformProps.ts 69.69% <57.14%> (+0.94%) ⬆️
...gin-chart-echarts/src/Timeseries/transformProps.ts 45.83% <66.66%> (ø)
...lugin-chart-echarts/src/Timeseries/transformers.ts 64.51% <80.00%> (+0.58%) ⬆️
...ugins/plugin-chart-echarts/src/utils/annotation.ts 83.33% <100.00%> (ø)
plugins/plugin-chart-echarts/src/utils/prophet.ts 91.83% <100.00%> (+0.17%) ⬆️
plugins/plugin-chart-echarts/src/utils/series.ts 95.34% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc36acc...d685df5. Read the comment docs.

Copy link
Copy Markdown
Contributor

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 🎉 A few comments/questions - they might not all be applicable as I haven't looked at the new types, but would be curious to hear your thoughts on these.

getMetricLabel,
getNumberFormatter,
} from '@superset-ui/core';
import { EChartsOption, SeriesOption } from 'echarts';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something like BoxplotSeriesOption?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

// @ts-ignore
...outlierData,
],
] as SeriesOption,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer not to cast this but rather @ts-ignore any specific typing problems that absolutely can't be avoided. I think this needs to be done separately like so:

const series: BoxplotSeriesOption = [...];

and then later

const echartsOptions: EChartsOption = {
  ...,
  series,
  ...,
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done for box and pie chart

data: transformedData,
tooltip: {
formatter: param => {
formatter: (param: CallbackDataParams) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ok, just curious if there could be a dedicated type for the tooltip formatter params?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, formatter does not have a dedicated type

Copy link
Copy Markdown
Contributor

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good! Can you check those few comments, after that I think we can merge this and do additional fine tuning in forthcoming PRs.


const transformedData = data
.map(datum => {
const transformedData: (BoxplotDataItemOption & { name: string })[] = data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious name isn't in the BoxplotDataItemOption interface/type. Can you check if it should be called something else? If not, let's keep the type unchanged and just @ts-ignore the line.

.flatMap(row => row);

const outlierData = data
const outlierData: (BoxplotStateOption & { name: string })[] = data
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Copy Markdown
Contributor

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants