未验证 提交 dc3bebb8 编写于 作者: P Peter Pan 提交者: GitHub

fix #674 (#677)

* chore: update dependencies

* fix: compatibility of safari (#674)
上级 cb3508e4
...@@ -38,16 +38,16 @@ ...@@ -38,16 +38,16 @@
"version": "yarn format && git add -A" "version": "yarn format && git add -A"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "3.2.0", "@typescript-eslint/eslint-plugin": "3.4.0",
"@typescript-eslint/parser": "3.2.0", "@typescript-eslint/parser": "3.4.0",
"eslint": "7.2.0", "eslint": "7.3.1",
"eslint-config-prettier": "6.11.0", "eslint-config-prettier": "6.11.0",
"eslint-plugin-prettier": "3.1.3", "eslint-plugin-prettier": "3.1.4",
"eslint-plugin-react": "7.20.0", "eslint-plugin-react": "7.20.0",
"eslint-plugin-react-hooks": "4.0.0", "eslint-plugin-react-hooks": "4.0.0",
"husky": "4.2.5", "husky": "4.2.5",
"lerna": "3.22.1", "lerna": "3.22.1",
"lint-staged": "10.2.9", "lint-staged": "10.2.11",
"prettier": "2.0.5", "prettier": "2.0.5",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"typescript": "3.9.5", "typescript": "3.9.5",
......
import * as chart from '~/utils/chart'; import * as chart from '~/utils/chart';
import React, {useEffect, useImperativeHandle} from 'react'; import React, {useEffect, useImperativeHandle} from 'react';
import {WithStyled, position, primaryColor, size} from '~/utils/style'; import {WithStyled, primaryColor} from '~/utils/style';
import useECharts, {Wrapper} from '~/hooks/useECharts';
import {EChartOption} from 'echarts'; import {EChartOption} from 'echarts';
import GridLoader from 'react-spinners/GridLoader'; import GridLoader from 'react-spinners/GridLoader';
import defaultsDeep from 'lodash/defaultsDeep'; import defaultsDeep from 'lodash/defaultsDeep';
import {formatTime} from '~/utils'; import {formatTime} from '~/utils';
import styled from 'styled-components';
import useECharts from '~/hooks/useECharts';
import {useTranslation} from '~/utils/i18n'; import {useTranslation} from '~/utils/i18n';
const Wrapper = styled.div`
position: relative;
> .echarts {
height: 100%;
}
> .loading {
${size('100%')}
${position('absolute', 0, null, null, 0)}
display: flex;
justify-content: center;
align-items: center;
}
`;
type LineChartProps = { type LineChartProps = {
options?: EChartOption; options?: EChartOption;
title?: string; title?: string;
......
import * as chart from '~/utils/chart'; import * as chart from '~/utils/chart';
import React, {useCallback, useEffect, useImperativeHandle} from 'react'; import React, {useCallback, useEffect, useImperativeHandle} from 'react';
import {WithStyled, position, primaryColor, size} from '~/utils/style'; import {WithStyled, primaryColor} from '~/utils/style';
import useECharts, {Wrapper} from '~/hooks/useECharts';
import {EChartOption} from 'echarts'; import {EChartOption} from 'echarts';
import GridLoader from 'react-spinners/GridLoader'; import GridLoader from 'react-spinners/GridLoader';
import {dataURL2Blob} from '~/utils/image';
import defaultsDeep from 'lodash/defaultsDeep'; import defaultsDeep from 'lodash/defaultsDeep';
import {saveAs} from 'file-saver';
import styled from 'styled-components';
import useECharts from '~/hooks/useECharts';
import {useTranslation} from '~/utils/i18n'; import {useTranslation} from '~/utils/i18n';
const Wrapper = styled.div`
position: relative;
> .echarts {
height: 100%;
}
> .loading {
${size('100%')}
${position('absolute', 0, null, null, 0)}
display: flex;
justify-content: center;
align-items: center;
}
`;
type renderItem = NonNullable<EChartOption.SeriesCustom['renderItem']>; type renderItem = NonNullable<EChartOption.SeriesCustom['renderItem']>;
type renderItemArguments = NonNullable<renderItem['arguments']>; type renderItemArguments = NonNullable<renderItem['arguments']>;
type RenderItem = ( type RenderItem = (
......
import {MutableRefObject, useCallback, useEffect, useLayoutEffect, useRef, useState} from 'react'; import {MutableRefObject, useCallback, useEffect, useLayoutEffect, useRef, useState} from 'react';
import {maskColor, primaryColor, textColor} from '~/utils/style'; import {maskColor, position, primaryColor, size, textColor} from '~/utils/style';
import {ECharts} from 'echarts'; import {ECharts} from 'echarts';
import {dataURL2Blob} from '~/utils/image'; import {dataURL2Blob} from '~/utils/image';
import {saveAs} from 'file-saver'; import {saveAs} from 'file-saver';
import styled from 'styled-components';
const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElement>(options: { const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElement>(options: {
loading?: boolean; loading?: boolean;
...@@ -99,3 +100,22 @@ const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElemen ...@@ -99,3 +100,22 @@ const useECharts = <T extends HTMLElement, W extends HTMLElement = HTMLDivElemen
}; };
export default useECharts; export default useECharts;
export const Wrapper = styled.div`
position: relative;
display: flex;
justify-content: center;
align-items: stretch;
> .echarts {
width: 100%;
}
> .loading {
${size('100%')}
${position('absolute', 0, null, null, 0)}
display: flex;
justify-content: center;
align-items: center;
}
`;
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"test": "echo \"Error: no test specified\" && exit 0" "test": "echo \"Error: no test specified\" && exit 0"
}, },
"dependencies": { "dependencies": {
"@tippyjs/react": "4.0.2", "@tippyjs/react": "4.0.4",
"@visualdl/i18n": "2.0.0-beta.43", "@visualdl/i18n": "2.0.0-beta.43",
"@visualdl/netron": "2.0.0-beta.43", "@visualdl/netron": "2.0.0-beta.43",
"@visualdl/wasm": "2.0.0-beta.43", "@visualdl/wasm": "2.0.0-beta.43",
...@@ -45,33 +45,33 @@ ...@@ -45,33 +45,33 @@
"isomorphic-unfetch": "3.0.0", "isomorphic-unfetch": "3.0.0",
"lodash": "4.17.15", "lodash": "4.17.15",
"mime-types": "2.1.27", "mime-types": "2.1.27",
"moment": "2.26.0", "moment": "2.27.0",
"next": "9.4.4", "next": "9.4.4",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"polished": "3.6.4", "polished": "3.6.5",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"query-string": "6.13.1", "query-string": "6.13.1",
"react": "16.13.1", "react": "16.13.1",
"react-dom": "16.13.1", "react-dom": "16.13.1",
"react-input-range": "1.3.0", "react-input-range": "1.3.0",
"react-is": "16.13.1", "react-is": "16.13.1",
"react-spinners": "0.8.3", "react-spinners": "0.9.0",
"react-toastify": "6.0.5", "react-toastify": "6.0.6",
"save-svg-as-png": "1.4.17", "save-svg-as-png": "1.4.17",
"styled-components": "5.1.1", "styled-components": "5.1.1",
"swr": "0.2.2", "swr": "0.2.3",
"tippy.js": "6.2.3" "tippy.js": "6.2.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "7.10.2", "@babel/core": "7.10.3",
"@types/d3-format": "1.3.1", "@types/d3-format": "1.3.1",
"@types/echarts": "4.6.1", "@types/echarts": "4.6.2",
"@types/file-saver": "2.0.1", "@types/file-saver": "2.0.1",
"@types/lodash": "4.14.155", "@types/lodash": "4.14.156",
"@types/mime-types": "2.1.0", "@types/mime-types": "2.1.0",
"@types/node": "14.0.13", "@types/node": "14.0.13",
"@types/nprogress": "0.2.0", "@types/nprogress": "0.2.0",
"@types/react": "16.9.36", "@types/react": "16.9.38",
"@types/react-dom": "16.9.8", "@types/react-dom": "16.9.8",
"@types/styled-components": "5.1.0", "@types/styled-components": "5.1.0",
"@visualdl/mock": "2.0.0-beta.43", "@visualdl/mock": "2.0.0-beta.43",
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
"copy-webpack-plugin": "6.0.2", "copy-webpack-plugin": "6.0.2",
"core-js": "3.6.5", "core-js": "3.6.5",
"cross-env": "7.0.2", "cross-env": "7.0.2",
"css-loader": "3.5.3", "css-loader": "3.6.0",
"enhanced-resolve": "4.1.1", "enhanced-resolve": "4.2.0",
"ora": "4.0.4", "ora": "4.0.4",
"typescript": "3.9.5", "typescript": "3.9.5",
"worker-plugin": "4.0.3" "worker-plugin": "4.0.3"
......
...@@ -37,21 +37,21 @@ ...@@ -37,21 +37,21 @@
"dependencies": { "dependencies": {
"detect-node": "2.0.4", "detect-node": "2.0.4",
"hoist-non-react-statics": "3.3.2", "hoist-non-react-statics": "3.3.2",
"i18next": "19.4.5", "i18next": "19.5.1",
"i18next-browser-languagedetector": "4.2.0", "i18next-browser-languagedetector": "5.0.0",
"i18next-fs-backend": "1.0.6", "i18next-fs-backend": "1.0.6",
"i18next-http-backend": "1.0.15", "i18next-http-backend": "1.0.15",
"i18next-http-middleware": "2.1.2", "i18next-http-middleware": "3.0.0",
"path-match": "1.2.4", "path-match": "1.2.4",
"prop-types": "15.7.2", "prop-types": "15.7.2",
"react-i18next": "11.5.0", "react-i18next": "11.7.0",
"url": "0.11.0" "url": "0.11.0"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "4.17.6", "@types/express": "4.17.6",
"@types/hoist-non-react-statics": "3.3.1", "@types/hoist-non-react-statics": "3.3.1",
"@types/node": "14.0.13", "@types/node": "14.0.13",
"@types/react": "16.9.36", "@types/react": "16.9.38",
"@types/react-dom": "16.9.8", "@types/react-dom": "16.9.8",
"typescript": "3.9.5" "typescript": "3.9.5"
}, },
......
...@@ -40,16 +40,16 @@ ...@@ -40,16 +40,16 @@
"protobufjs": "lutzroeder/protobuf.js#b9a9d027589356226f4704f9d77f2639f52172f3" "protobufjs": "lutzroeder/protobuf.js#b9a9d027589356226f4704f9d77f2639f52172f3"
}, },
"devDependencies": { "devDependencies": {
"autoprefixer": "9.8.0", "autoprefixer": "9.8.2",
"copy-webpack-plugin": "6.0.2", "copy-webpack-plugin": "6.0.2",
"css-loader": "3.5.3", "css-loader": "3.6.0",
"html-webpack-plugin": "4.3.0", "html-webpack-plugin": "4.3.0",
"mini-css-extract-plugin": "0.9.0", "mini-css-extract-plugin": "0.9.0",
"postcss-loader": "3.0.0", "postcss-loader": "3.0.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"sass": "1.26.8", "sass": "1.26.9",
"sass-loader": "8.0.2", "sass-loader": "8.0.2",
"terser": "4.7.0", "terser": "4.8.0",
"webpack": "4.43.0" "webpack": "4.43.0"
}, },
"engines": { "engines": {
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"ts-node": "8.10.2", "ts-node": "8.10.2",
"typescript": "3.9.5", "typescript": "3.9.5",
"webpack": "4.43.0", "webpack": "4.43.0",
"webpack-cli": "3.3.11", "webpack-cli": "3.3.12",
"webpack-dev-middleware": "3.7.2" "webpack-dev-middleware": "3.7.2"
}, },
"engines": { "engines": {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册