Skip to content

Echarts updates #436

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

Merged
merged 11 commits into from
Oct 24, 2023
Prev Previous commit
Next Next commit
fix: echarts json rerendering on data change
  • Loading branch information
raheeliftikhar5 committed Oct 24, 2023
commit 12970d092960b14cf3cd6d066d533a239482711a
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ ChartTmpComp = withViewFn(ChartTmpComp, (comp) => {
opts={{ locale: getEchartsLocale() }}
option={option}
theme={mode !== 'map' ? themeConfig : undefined}
mode={mode}
/>
)}
</ReactResizeDetector>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export default class EChartsReactCore extends PureComponent<EChartsReactProps> {
return;
}

if(this.props.mode === "json") {
this.updateEChartsOption();
return;
}

// when these props are not isEqual, update echarts
const pickKeys = ["option", "notMerge", "lazyUpdate", "showLoading", "loadingOption"];
if (!isEqual(_.pick(this.props, pickKeys), _.pick(prevProps, pickKeys))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ export type EChartsReactProps = {
* should update echarts options
*/
readonly shouldSetOption?: (prevProps: EChartsReactProps, props: EChartsReactProps) => boolean;
/**
* echarts mode: ui | json | map
*/
readonly mode?: 'ui' | 'json' | 'map'
};