Skip to content
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

Update echarts to v5 #167

Merged
merged 7 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Not released

- Update echarts to v5 [#167](https://github.com/CartoDB/carto-react/pull/167)
- Fix unnecessary widget calculations triggered by widget itself [#185](https://github.com/CartoDB/carto-react/pull/185)
- Add new `useSourceFilters` hook for better custom widgets dev [#185](https://github.com/CartoDB/carto-react/pull/185)
- Fix unnecessary widgets calculations when unrelated source changes [#184](https://github.com/CartoDB/carto-react/pull/184)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@testing-library/react": "^11.2.5",
"@testing-library/react-hooks": "^5.1.0",
"@testing-library/user-event": "^12.8.1",
"echarts": "^4.9.0",
"echarts-for-react": "^2.0.16",
"echarts": "^5.2.0",
"echarts-for-react": "^3.0.1",
"husky": "^4.3.8",
"lerna": "^4.0.0",
"lint-staged": "^10.5.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-ui/__tests__/widgets/testUtils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import { createMuiTheme, responsiveFontSizes, ThemeProvider } from '@material-ui/core';
import echarts from 'echarts';
import * as echarts from 'echarts';

import { cartoThemeOptions } from '../../src/theme/carto-theme';

Expand Down
4 changes: 2 additions & 2 deletions packages/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.57",
"echarts": "^4.9.0",
"echarts-for-react": "^2.0.16",
"echarts": "^5.2.0",
"echarts-for-react": "^3.0.1",
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/react-ui/src/widgets/HistogramWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ function __generateDefaultConfig(
show: tooltip,
trigger: 'axis',
padding: [theme.spacing(0.5), theme.spacing(1)],
borderWidth: 0,
textStyle: {
...theme.typography.caption,
fontSize: 12,
lineHeight: 16
lineHeight: 16,
color: theme.palette.common.white,
},
backgroundColor: theme.palette.other.tooltip,
position: function (point, params, dom, rect, size) {
Expand Down
5 changes: 4 additions & 1 deletion packages/react-ui/src/widgets/PieWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ function __generateDefaultConfig({ tooltipFormatter, formatter, colors }, theme)
transitionDuration: 0,
backgroundColor: theme.palette.other.tooltip,
confine: true,
textStyle: {
color: theme.palette.common.white
},
...(tooltipFormatter
? { formatter: (params) => tooltipFormatter({ ...params, formatter }) }
: {})
Expand Down Expand Up @@ -269,7 +272,7 @@ PieWidgetUI.defaultProps = {
params.name
}</p>
<p style="font-size: 12px;font-weight:normal;line-height:1.33;margin:0 0 4px 0;">${colorSpan(
params.data.color || params.color
params.data.color || params.textStyle.color
)} ${valueHtml} (${params.percent}%)</p>`;
},
colors: null,
Expand Down
3 changes: 2 additions & 1 deletion packages/react-ui/src/widgets/ScatterPlotWidgetUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function __generateDefaultConfig(
textStyle: {
...theme.typography.caption,
fontSize: 12,
lineHeight: 16
lineHeight: 16,
color: theme.palette.common.white,
},
backgroundColor: theme.palette.other.tooltip,
...(tooltipFormatter ? { formatter: tooltipFormatter } : {})
Expand Down
2 changes: 1 addition & 1 deletion packages/react-widgets/src/hooks/useCustomCompareMemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ export default function useCustomCompareMemo(value, isEqual) {
}

return ref.current;
}
}
4 changes: 2 additions & 2 deletions packages/react-widgets/src/widgets/CategoryWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function CategoryWidget(props) {
} = props;
const dispatch = useDispatch();

const isSourceReady = useSelector(
(state) => selectIsViewportFeaturesReadyForSource(state, dataSource)
const isSourceReady = useSelector((state) =>
selectIsViewportFeaturesReadyForSource(state, dataSource)
);

const [categoryData, setCategoryData] = useState(null);
Expand Down
14 changes: 3 additions & 11 deletions packages/react-widgets/src/widgets/FormulaWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ function FormulaWidget(props) {
onError,
wrapperProps
} = props;
const isSourceReady = useSelector(
(state) => selectIsViewportFeaturesReadyForSource(state, dataSource)
const isSourceReady = useSelector((state) =>
selectIsViewportFeaturesReadyForSource(state, dataSource)
);
const filters = useSourceFilters({ dataSource, id });

Expand Down Expand Up @@ -59,15 +59,7 @@ function FormulaWidget(props) {
if (onError) onError(error);
});
}
}, [
operation,
column,
filters,
dataSource,
setIsLoading,
onError,
isSourceReady
]);
}, [operation, column, filters, dataSource, setIsLoading, onError, isSourceReady]);

return (
<WrapperWidgetUI title={title} isLoading={isLoading} {...wrapperProps}>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-widgets/src/widgets/HistogramWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function HistogramWidget(props) {
const [isLoading, setIsLoading] = useState(true);

const filters = useSourceFilters({ dataSource, id });
const isSourceReady = useSelector(
(state) => selectIsViewportFeaturesReadyForSource(state, dataSource)
const isSourceReady = useSelector((state) =>
selectIsViewportFeaturesReadyForSource(state, dataSource)
);

const tooltipFormatter = useCallback(
Expand Down
4 changes: 2 additions & 2 deletions packages/react-widgets/src/widgets/PieWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function PieWidget({
const [selectedCategories, setSelectedCategories] = useState([]);
const [isLoading, setIsLoading] = useState(true);

const isSourceReady = useSelector(
(state) => selectIsViewportFeaturesReadyForSource(state, dataSource)
const isSourceReady = useSelector((state) =>
selectIsViewportFeaturesReadyForSource(state, dataSource)
);
const filters = useSourceFilters({ dataSource, id });

Expand Down
4 changes: 2 additions & 2 deletions packages/react-widgets/src/widgets/ScatterPlotWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function ScatterPlotWidget(props) {
const [scatterData, setScatterData] = useState([]);
const [isLoading, setIsLoading] = useState(true);

const isSourceReady = useSelector(
(state) => selectIsViewportFeaturesReadyForSource(state, dataSource)
const isSourceReady = useSelector((state) =>
selectIsViewportFeaturesReadyForSource(state, dataSource)
);
const filters = useSourceFilters({ dataSource, id });

Expand Down
91 changes: 47 additions & 44 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2863,7 +2863,7 @@
resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437"
integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw==

"@octokit/plugin-paginate-rest@^2.16.0":
"@octokit/plugin-paginate-rest@^2.16.4":
version "2.16.5"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.16.5.tgz#4d8098410f4c4697d33979f06f38d2ed2574adf1"
integrity sha512-2PfRGymdBypqRes4Xelu0BAZZRCV/Qg0xgo8UB10UKoghCM+zg640+T5WkRsRD0edwfLBPP3VsJgDyDTG4EIYg==
Expand Down Expand Up @@ -2905,12 +2905,12 @@
universal-user-agent "^6.0.0"

"@octokit/rest@^18.1.0":
version "18.11.2"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.2.tgz#0a38cd42f5e41128276099fa0513f456044a4a52"
integrity sha512-XZPD5HN0B8AfvXhdztFqoZxNVC6hRgQSZTWS1Eh0xHAoJvduVBwniWJ0t4DsdO9in+odZZ9EYAOFtQuaLVZ44Q==
version "18.11.3"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.11.3.tgz#f5b04fab82fbc879747c033097ccee744a57b8d1"
integrity sha512-k4uCg4PVo6r9ncguSD4fXt6pYkM/FXs7759sYfpvIEhGNPJbFROooOJpkagKPAcSPoEGyEbIR+A9KYIv4jNe4A==
dependencies:
"@octokit/core" "^3.5.1"
"@octokit/plugin-paginate-rest" "^2.16.0"
"@octokit/plugin-paginate-rest" "^2.16.4"
"@octokit/plugin-request-log" "^1.0.4"
"@octokit/plugin-rest-endpoint-methods" "5.11.3"

Expand All @@ -2934,9 +2934,9 @@
source-map "^0.7.3"

"@popperjs/core@^2.5.4", "@popperjs/core@^2.6.0":
version "2.10.1"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.1.tgz#728ecd95ab207aab8a9a4e421f0422db329232be"
integrity sha512-HnUhk1Sy9IuKrxEMdIRCxpIqPw6BFsbYSEUO9p/hNw5sMld/+3OLMWQP80F8/db9qsv3qUjs7ZR5bS/R+iinXw==
version "2.10.2"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.10.2.tgz#0798c03351f0dea1a5a4cabddf26a55a7cbee590"
integrity sha512-IXf3XA7+XyN7CP9gGh/XB0UxVMlvARGEgGXLubFICsUMGz6Q+DU+i4gGlpOxTjKvXjkJDJC8YdqdKkDj9qZHEQ==

"@probe.gl/stats@3.4.1", "@probe.gl/stats@^3.3.0", "@probe.gl/stats@^3.4.0":
version "3.4.1"
Expand Down Expand Up @@ -4256,9 +4256,9 @@
"@types/react" "*"

"@types/react@*", "@types/react@>=16.9.0":
version "17.0.24"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.24.tgz#7e1b3f78d0fc53782543f9bce6d949959a5880bd"
integrity sha512-eIpyco99gTH+FTI3J7Oi/OH8MZoFMJuztNRimDOJwH4iGIsKV2qkGnk4M9VzlaVWeEEWLWSQRy0FEA0Kz218cg==
version "17.0.26"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.26.tgz#960ea4b3518cc154ed7df3b35656c508df653331"
integrity sha512-MXxuXrH2xOcv5cp/su4oz69dNQnSA90JjFw5HBd5wifw6Ihi94j7dRJm7qNsB30tnruXSCPc9qmlhGop4nh9Hw==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
Expand Down Expand Up @@ -7593,30 +7593,31 @@ ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11:
dependencies:
safe-buffer "^5.0.1"

echarts-for-react@^2.0.16:
version "2.0.16"
resolved "https://registry.yarnpkg.com/echarts-for-react/-/echarts-for-react-2.0.16.tgz#8134a53dff90882c1e6a95c45ceab21e00f6c9f5"
integrity sha512-VmHCktay2qKt/+wpL/C7thbvIa7dYBEey0/U4Zaqo+qeA4wx+uiCd5NeCsPIhD/0Pv+2qqNswqiNiUCtcgccOw==
echarts-for-react@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/echarts-for-react/-/echarts-for-react-3.0.1.tgz#cf9de60e468b342c244314be2325e00d765a5137"
integrity sha512-9LNcPNT+DH+IwtZlahuXQf7zqCWSnnYqITXtKgLDzoQ7fvotH1xEaFPriASQb+jYqSI9pBdtN5cFneT89wECUg==
dependencies:
fast-deep-equal "^2.0.1"
size-sensor "^1.0.0"
fast-deep-equal "^3.1.3"
size-sensor "^1.0.1"

echarts@^4.9.0:
version "4.9.0"
resolved "https://registry.yarnpkg.com/echarts/-/echarts-4.9.0.tgz#a9b9baa03f03a2a731e6340c55befb57a9e1347d"
integrity sha512-+ugizgtJ+KmsJyyDPxaw2Br5FqzuBnyOWwcxPKO6y0gc5caYcfnEUIlNStx02necw8jmKmTafmpHhGo4XDtEIA==
echarts@^5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/echarts/-/echarts-5.2.1.tgz#bd58ec011cd82def4a714e4038ef4b73b8417bc3"
integrity sha512-OJ79b22eqRfbSV8vYmDKmA+XWfNbr0Uk/OafWcFNIGDWti2Uw9A6eVCiJLmqPa9Sk+EWL+t5v26aak0z3gxiZw==
dependencies:
zrender "4.3.2"
tslib "2.3.0"
zrender "5.2.1"

ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=

electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.846:
version "1.3.853"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.853.tgz#f3ed1d31f092cb3a17af188bca6c6a3ec91c3e82"
integrity sha512-W4U8n+U8I5/SUaFcqZgbKRmYZwcyEIQVBDf+j5QQK6xChjXnQD+wj248eGR9X4u+dDmDR//8vIfbu4PrdBBIoQ==
version "1.3.854"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.854.tgz#003f0b9c80eccc35be0ef04a0e0b1c31a10b90d5"
integrity sha512-00/IIC1mFPkq32MhUJyLdcTp7+wsKK2G3Sb65GSas9FKJQGYkDcZ4GwJkkxf5YyM3ETvl6n+toV8OmtXl4IA/g==

element-resize-detector@^1.2.2:
version "1.2.3"
Expand Down Expand Up @@ -8013,9 +8014,9 @@ eslint-plugin-react-hooks@^4.2.0:
integrity sha512-623WEiZJqxR7VdxFCKLI6d6LLpwJkGPYKODnkH3D7WpOG5KM8yWueBd8TLsNAetEJNF5iJmolaAKO3F8yzyVBQ==

eslint-plugin-react@^7.22.0:
version "7.26.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.0.tgz#3ae019a35d542b98e5af9e2f96b89c232c74b55b"
integrity sha512-dceliS5itjk4EZdQYtLMz6GulcsasguIs+VTXuiC7Q5IPIdGTkyfXVdmsQOqEhlD9MciofH4cMcT1bw1WWNxCQ==
version "7.26.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.26.1.tgz#41bcfe3e39e6a5ac040971c1af94437c80daa40e"
integrity sha512-Lug0+NOFXeOE+ORZ5pbsh6mSKjBKXDXItUD2sQoT+5Yl0eoT82DqnXeTMfUare4QVCn9QwXbfzO/dBLjLXwVjQ==
dependencies:
array-includes "^3.1.3"
array.prototype.flatmap "^1.2.4"
Expand Down Expand Up @@ -8412,11 +8413,6 @@ extsprintf@^1.2.0:
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8=

fast-deep-equal@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49"
integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=

fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
Expand Down Expand Up @@ -10363,9 +10359,9 @@ is-glob@^3.0.0, is-glob@^3.1.0:
is-extglob "^2.1.0"

is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.2.tgz#859fc2e731e58c902f99fcabccb75a7dd07d29d8"
integrity sha512-ZZTOjRcDjuAAAv2cTBQP/lL59ZTArx77+7UzHdWW/XB1mrfp7DEaVpKmZ0XIzx+M7AxfhKcqV+nMetUQmFifwg==
version "4.0.3"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
dependencies:
is-extglob "^2.1.1"

Expand Down Expand Up @@ -15484,9 +15480,9 @@ side-channel@^1.0.4:
object-inspect "^1.9.0"

signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3:
version "3.0.4"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.4.tgz#366a4684d175b9cab2081e3681fda3747b6c51d7"
integrity sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==
version "3.0.5"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f"
integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==

simple-swizzle@^0.2.2:
version "0.2.2"
Expand All @@ -15500,7 +15496,7 @@ sisteransi@^1.0.5:
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==

size-sensor@^1.0.0:
size-sensor@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/size-sensor/-/size-sensor-1.0.1.tgz#f84e46206d3e259faff1d548e4b3beca93219dbb"
integrity sha512-QTy7MnuugCFXIedXRpUSk9gUnyNiaxIdxGfUjr8xxXOqIB3QvBUYP9+b51oCg2C4dnhaeNk/h57TxjbvoJrJUA==
Expand Down Expand Up @@ -16599,6 +16595,11 @@ tsconfig-paths@^3.11.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

tslib@2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==

tslib@^1.9.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand Down Expand Up @@ -17755,10 +17756,12 @@ zip-stream@^2.1.2:
compress-commons "^2.1.1"
readable-stream "^3.4.0"

zrender@4.3.2:
version "4.3.2"
resolved "https://registry.yarnpkg.com/zrender/-/zrender-4.3.2.tgz#ec7432f9415c82c73584b6b7b8c47e1b016209c6"
integrity sha512-bIusJLS8c4DkIcdiK+s13HiQ/zjQQVgpNohtd8d94Y2DnJqgM1yjh/jpDb8DoL6hd7r8Awagw8e3qK/oLaWr3g==
zrender@5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/zrender/-/zrender-5.2.1.tgz#5f4bbda915ba6d412b0b19dc2431beaad05417bb"
integrity sha512-M3bPGZuyLTNBC6LiNKXJwSCtglMp8XUEqEBG+2MdICDI3d1s500Y4P0CzldQGsqpRVB7fkvf3BKQQRxsEaTlsw==
dependencies:
tslib "2.3.0"

zwitch@^1.0.0:
version "1.0.5"
Expand Down