diff --git a/.npmignore b/.npmignore index ba20304cb1..d25559df2e 100644 --- a/.npmignore +++ b/.npmignore @@ -10,5 +10,7 @@ .DS_Store Thumbs.db Desktop.ini +/asset/contributing-inspect.png +CONTRIBUTING.md # Hidden files -.* \ No newline at end of file +.* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 88d681a8bd..ece92db9f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,9 @@ Please check out the [Apache Code of Conduct](https://www.apache.org/foundation/ Contributions can be made in varied ways: -- Help others in the issues +- Help others with the issues - Help solve problems with the issues - - Remind the authors to provide a demo if they are reporting for a bug + - Remind the authors to provide a demo if they are reporting a bug - Try to reproduce the problem as described in the issues - Make pull requests to fix bugs or implement new features - Improve or translate the documents @@ -19,13 +19,13 @@ Contributions can be made in varied ways: ## Issues -We have already prepared issue templates for bug report and feature request. If you want to fire an issue, just entering [New issue](https://github.com/apache/echarts/issues/new/choose) page and select either of them to get started. +We have already prepared issue templates for bug reports and feature requests. If you want to fire an issue, just enter the [New issue](https://github.com/apache/echarts/issues/new/choose) page and select either of them to get started. Additionally, before doing so, please search for similar questions in our [issues list](https://github.com/apache/echarts/issues?utf8=%E2%9C%93&q=is%3Aissue). If you are able to reproduce an issue found in a closed issue, please create a new issue and reference the closed one. Please read the [documentation](http://echarts.apache.org/option.html) carefully before asking any questions. -Any questions in the form of *how can I use echarts to* or *how to use echarts x feature to* belong in [Stack Overflow](http://stackoverflow.com), issues with questions like that in the issue tracker will be closed. +Any questions in the form of *how can I use echarts to* or *how to use echarts x feature to* belong in [Stack Overflow](http://stackoverflow.com). Issues with questions like that in the issue tracker will be closed. ## Release Milestone Discussion @@ -33,8 +33,8 @@ We will start the discussion about the bugs to fix and the features of each rele Regarding the release plan, we will release a minor version at the end of every month. Here is some detail. -1. Assume our current stable release is 4.3.0. We will start the discussion of the milestone of the release two versions ahead, which is 4.5.0 at the beginning of each month. At this time we should also kickoff the development of the next release, which is 4.4.0. -2. Finish 4.4.0 developing at about 22th of this month and start the testing. And the 4.5.0 milestone discussion is frozen and published on the [GitHub](https://github.com/apache/echarts/milestone/14) +1. Assume our current stable release is 4.3.0. We will start the discussion of the milestone of the release two versions ahead, which is 4.5.0 at the beginning of each month. At this time, we should also kick off the development of the next release, which is 4.4.0. +2. Finish 4.4.0 development on about the 22nd of this month and start the testing. And the 4.5.0 milestone discussion is frozen and published on the [GitHub](https://github.com/apache/echarts/milestone/14) 3. Vote in the mailing list for the 4.4.0 release at the end of this month. ## Pull Requests @@ -47,8 +47,8 @@ Wiki: [How to setup the dev environment](https://github.com/apache/echarts/wiki/ ## Some hints about using code from other authors -+ About using some algorithms/formulas or inspired by other's work: - + We can be inspired by other people’s work. There is no problem with copying ideas and no problems associated with that so long as the code is entirely yours and you aren’t violating the license of the inspirational work. You can just follow "normal" source code rules. ++ About using some algorithms/formulas or inspired by others' work: + + We can be inspired by other people’s work. There is no problem with copying ideas and no problems associated with that as long as the code is entirely yours and you aren’t violating the license of the inspirational work. You can just follow "normal" source code rules. + But when you copy the code, even parts of files, it must remain under the copyright of the original authors. + What's the right thing to do for the public good here? I'll go with: + Be transparent when implementing an existing idea/algorithm. @@ -56,14 +56,14 @@ Wiki: [How to setup the dev environment](https://github.com/apache/echarts/wiki/ + Use standard language when doing so (we need to define standard language). + "inspired by", "learned from" and "references to" are vague concepts in copyright. + If any copyrightable expression is copied from the existing idea/algorithm, compare its licensing to our licensing policies and include licensing accordingly. - + Check the original discussion about it in: https://lists.apache.org/list.html?legal-discuss@apache.org:lte=36M:echarts + + Check the original discussion about it at: https://lists.apache.org/list.html?legal-discuss@apache.org:lte=36M:echarts + About adding the license/header of 3rd-party work: + https://www.apache.org/legal/src-headers.html#3party + Licenses that are compatible with the Apache license: - + BSD and MIT are compatible with the Apache license but CC_BY_SA is not (https://apache.org/legal/resolved.html#cc-sa). + + BSD and MIT are compatible with the Apache license, but CC_BY_SA is not (https://apache.org/legal/resolved.html#cc-sa). + Stack Overflow: - + before intending to copy code from Stack Overflow, we must check: + + before intending to copy code from Stack Overflow, we must check the following: + https://apache.org/legal/resolved.html#stackoverflow + https://issues.apache.org/jira/browse/LEGAL-471 + Wikipedia (and most Wikimedia Foundation projects): - + Wikipedia, and most Wikimedia Foundation projects, are licensed under CC 4.0 BY_SA (and sometimes GFDL) and is incompatible with the Apache license. Therefore, we should not copy code from Wikipedia, or Wikimedia Foundation projects. + + Wikipedia, and most Wikimedia Foundation projects, are licensed under CC 4.0 BY_SA (and sometimes GFDL) and are incompatible with the Apache license. Therefore, we should not copy code from Wikipedia or Wikimedia Foundation projects. diff --git a/NOTICE b/NOTICE index 2d697411ee..0877faab81 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache ECharts -Copyright 2017-2022 The Apache Software Foundation +Copyright 2017-2023 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/). diff --git a/README.md b/README.md index 78472efa78..35164a15e3 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ logo -Apache ECharts is a free, powerful charting and visualization library offering an easy way of adding intuitive, interactive, and highly customizable charts to your commercial products. It is written in pure JavaScript and based on zrender, which is a whole new lightweight canvas library. +Apache ECharts is a free, powerful charting and visualization library offering easy ways to add intuitive, interactive, and highly customizable charts to your commercial products. It is written in pure JavaScript and based on zrender, which is a whole new lightweight canvas library. **[中文官网](https://echarts.apache.org/zh/index.html)** | **[ENGLISH HOMEPAGE](https://echarts.apache.org/en/index.html)** @@ -45,12 +45,12 @@ Execute the instructions in the root directory of the echarts: npm install # Rebuild source code immediately in watch mode when changing the source code. -# It opens the `./test` directory and you may open `-cases.html` to get the list +# It opens the `./test` directory, and you may open `-cases.html` to get the list # of all test cases. # If you wish to create a test case, run `npm run mktest:help` to learn more. npm run dev -# Check correctness of TypeScript code. +# Check the correctness of TypeScript code. npm run checktype # If intending to build and get all types of the "production" files: @@ -61,7 +61,7 @@ Then the "production" files are generated in the `dist` directory. ## Contribution -If you wish to debug locally or make pull requests, please refer to the [contributing](https://github.com/apache/echarts/blob/master/CONTRIBUTING.md) document. +Please refer to the [contributing](https://github.com/apache/echarts/blob/master/CONTRIBUTING.md) document if you wish to debug locally or make pull requests. ## Resources diff --git a/package-lock.json b/package-lock.json index 35748ab176..6cb83c5c63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "serve-handler": "6.1.1", "slugify": "1.3.4", "socket.io": "2.5.0", - "terser": "^5.3.8", + "terser": "^5.16.1", "ts-jest": "^26.4.3", "typescript": "4.4.3" } @@ -4194,9 +4194,9 @@ "dev": true }, "node_modules/decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true, "engines": { "node": ">=0.10" @@ -9273,13 +9273,10 @@ "dev": true }, "node_modules/json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, - "dependencies": { - "minimist": "^1.2.5" - }, "bin": { "json5": "lib/cli.js" }, @@ -10565,9 +10562,9 @@ } }, "node_modules/qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true, "engines": { "node": ">=0.6" @@ -12264,9 +12261,9 @@ } }, "node_modules/terser": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", - "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.2", @@ -16783,9 +16780,9 @@ "dev": true }, "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz", + "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==", "dev": true }, "decompress": { @@ -20848,13 +20845,10 @@ "dev": true }, "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true }, "jsonfile": { "version": "4.0.0", @@ -21887,9 +21881,9 @@ "dev": true }, "qs": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true }, "query-string": { @@ -23302,9 +23296,9 @@ } }, "terser": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", - "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", + "version": "5.16.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.16.1.tgz", + "integrity": "sha512-xvQfyfA1ayT0qdK47zskQgRZeWLoOQ8JQ6mIgRGVNwZKdQMU+5FkCBjmv4QjcrTzyZquRw2FVtlJSRUmMKQslw==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.2", diff --git a/package.json b/package.json index 1ebccac91f..802b21d409 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "serve-handler": "6.1.1", "slugify": "1.3.4", "socket.io": "2.5.0", - "terser": "^5.3.8", + "terser": "^5.16.1", "ts-jest": "^26.4.3", "typescript": "4.4.3" } diff --git a/src/chart/bar/BarSeries.ts b/src/chart/bar/BarSeries.ts index eb838c11ff..de03a19eaf 100644 --- a/src/chart/bar/BarSeries.ts +++ b/src/chart/bar/BarSeries.ts @@ -53,8 +53,8 @@ interface BarStatesMixin { } export interface BarItemStyleOption extends ItemStyleOption { - // Border radius is not supported for bar on polar - borderRadius?: number | number[] + // for polar bars, this is used for sector's cornerRadius + borderRadius?: (number | string)[] | number | string } export interface BarDataItemOption extends BarStateOption, StatesOptionMixin, diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 0de06c481f..54cc6ec72e 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -21,6 +21,8 @@ import Path, {PathProps} from 'zrender/src/graphic/Path'; import Group from 'zrender/src/graphic/Group'; import {extend, each, map} from 'zrender/src/core/util'; import {BuiltinTextPosition} from 'zrender/src/core/types'; +import {SectorProps} from 'zrender/src/graphic/shape/Sector'; +import {RectProps} from 'zrender/src/graphic/shape/Rect'; import { Rect, Sector, @@ -66,6 +68,7 @@ import { warn } from '../../util/log'; import {createSectorCalculateTextPosition, SectorTextPosition, setSectorTextRotation} from '../../label/sectorLabel'; import { saveOldStyle } from '../../animation/basicTransition'; import Element from 'zrender/src/Element'; +import { getSectorCornerRadius } from '../helper/sectorHelper'; const mathMax = Math.max; const mathMin = Math.min; @@ -243,6 +246,9 @@ class BarView extends ChartView { if (coord.type === 'cartesian2d') { (bgEl as Rect).setShape('r', barBorderRadius); } + else { + (bgEl as Sector).setShape('cornerRadius', barBorderRadius); + } bgEls[dataIndex] = bgEl; return bgEl; }; @@ -334,11 +340,14 @@ class BarView extends ChartView { if (coord.type === 'cartesian2d') { (bgEl as Rect).setShape('r', barBorderRadius); } + else { + (bgEl as Sector).setShape('cornerRadius', barBorderRadius); + } bgEls[newIndex] = bgEl; } const bgLayout = getLayout[coord.type](data, newIndex); const shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord); - updateProps(bgEl, { shape }, animationModel, newIndex); + updateProps(bgEl, { shape }, animationModel, newIndex); } let el = oldData.getItemGraphicEl(oldIndex) as BarPossiblePath; @@ -803,7 +812,7 @@ const elementCreator: { const sectorShape = sector.shape; const animateProperty = isRadial ? 'r' : 'endAngle' as 'r' | 'endAngle'; const animateTarget = {} as SectorShape; - sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle; + sectorShape[animateProperty] = isRadial ? layout.r0 : layout.startAngle; animateTarget[animateProperty] = layout[animateProperty]; (isUpdate ? updateProps : initProps)(sector, { shape: animateTarget @@ -971,7 +980,8 @@ function createPolarPositionMapping(isRadial: boolean) function updateStyle( el: BarPossiblePath, - data: SeriesData, dataIndex: number, + data: SeriesData, + dataIndex: number, itemModel: Model, layout: RectLayout | SectorLayout, seriesModel: BarSeriesModel, @@ -981,7 +991,19 @@ function updateStyle( const style = data.getItemVisual(dataIndex, 'style'); if (!isPolar) { - (el as Rect).setShape('r', itemModel.get(['itemStyle', 'borderRadius']) || 0); + const borderRadius = itemModel + .get(['itemStyle', 'borderRadius']) as number | number[] || 0; + (el as Rect).setShape('r', borderRadius); + } + else if (!seriesModel.get('roundCap')) { + const sectorShape = (el as Sector).shape; + const cornerRadius = getSectorCornerRadius( + itemModel.getModel('itemStyle'), + sectorShape, + true + ); + extend(sectorShape, cornerRadius); + (el as Sector).setShape(sectorShape); } el.useStyle(style); diff --git a/src/chart/bar/BaseBarSeries.ts b/src/chart/bar/BaseBarSeries.ts index bff11b8837..81d3415202 100644 --- a/src/chart/bar/BaseBarSeries.ts +++ b/src/chart/bar/BaseBarSeries.ts @@ -94,20 +94,77 @@ class BaseBarSeriesModel = BaseBarSeri const coordSys = this.coordinateSystem; if (coordSys && coordSys.clampData) { // PENDING if clamp ? - const pt = coordSys.dataToPoint(coordSys.clampData(value)); + const clampData = coordSys.clampData(value); + const pt = coordSys.dataToPoint(clampData); if (startingAtTick) { each(coordSys.getAxes(), function (axis: Axis2D, idx: number) { // If axis type is category, use tick coords instead - if (axis.type === 'category') { + if (axis.type === 'category' && dims != null) { const tickCoords = axis.getTicksCoords(); - let tickIdx = coordSys.clampData(value)[idx]; + + let targetTickId = clampData[idx]; // The index of rightmost tick of markArea is 1 larger than x1/y1 index - if (dims && (dims[idx] === 'x1' || dims[idx] === 'y1')) { - tickIdx += 1; + const isEnd = dims[idx] === 'x1' || dims[idx] === 'y1'; + if (isEnd) { + targetTickId += 1; + } + + // The only contains one tick, tickCoords is + // like [{coord: 0, tickValue: 0}, {coord: 0}] + // to the length should always be larger than 1 + if (tickCoords.length < 2) { + return; + } + else if (tickCoords.length === 2) { + // The left value and right value of the axis are + // the same. coord is 0 in both items. Use the max + // value of the axis as the coord + pt[idx] = axis.toGlobalCoord( + axis.getExtent()[isEnd ? 1 : 0] + ); + return; + } + + let leftCoord; + let coord; + let stepTickValue = 1; + for (let i = 0; i < tickCoords.length; i++) { + const tickCoord = tickCoords[i].coord; + // The last item of tickCoords doesn't contain + // tickValue + const tickValue = i === tickCoords.length - 1 + ? tickCoords[i - 1].tickValue + stepTickValue + : tickCoords[i].tickValue; + if (tickValue === targetTickId) { + coord = tickCoord; + break; + } + else if (tickValue < targetTickId) { + leftCoord = tickCoord; + } + else if (leftCoord != null && tickValue > targetTickId) { + coord = (tickCoord + leftCoord) / 2; + break; + } + if (i === 1) { + // Here we assume the step of category axes is + // the same + stepTickValue = tickValue - tickCoords[0].tickValue; + } + } + if (coord == null) { + if (!leftCoord) { + // targetTickId is smaller than all tick ids in the + // visible area, use the leftmost tick coord + coord = tickCoords[0].coord; + } + else if (leftCoord) { + // targetTickId is larger than all tick ids in the + // visible area, use the rightmost tick coord + coord = tickCoords[tickCoords.length - 1].coord; + } } - (tickIdx > tickCoords.length - 1) && (tickIdx = tickCoords.length - 1); - (tickIdx < 0) && (tickIdx = 0); - tickCoords[tickIdx] && (pt[idx] = axis.toGlobalCoord(tickCoords[tickIdx].coord)); + pt[idx] = axis.toGlobalCoord(coord); } }); } diff --git a/src/chart/helper/pieHelper.ts b/src/chart/helper/sectorHelper.ts similarity index 100% rename from src/chart/helper/pieHelper.ts rename to src/chart/helper/sectorHelper.ts diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts index daf1cbfb52..d16e341a72 100644 --- a/src/chart/line/LineView.ts +++ b/src/chart/line/LineView.ts @@ -644,7 +644,7 @@ class LineView extends ChartView { const lineGroup = this._lineGroup; - const hasAnimation = seriesModel.get('animation'); + const hasAnimation = !ecModel.ssr && seriesModel.isAnimationEnabled(); const isAreaChart = !areaStyleModel.isEmpty(); @@ -1085,10 +1085,10 @@ class LineView extends ChartView { if (zrUtil.isFunction(seriesDuration)) { seriesDuration = seriesDuration(null); } - const seriesDalay = seriesModel.get('animationDelay') || 0; - const seriesDalayValue = zrUtil.isFunction(seriesDalay) - ? seriesDalay(null) - : seriesDalay; + const seriesDelay = seriesModel.get('animationDelay') || 0; + const seriesDelayValue = zrUtil.isFunction(seriesDelay) + ? seriesDelay(null) + : seriesDelay; data.eachItemGraphicEl(function (symbol: SymbolExtended, idx) { const el = symbol; @@ -1131,8 +1131,8 @@ class LineView extends ChartView { ratio = 1 - ratio; } - const delay = zrUtil.isFunction(seriesDalay) ? seriesDalay(idx) - : (seriesDuration * ratio) + seriesDalayValue; + const delay = zrUtil.isFunction(seriesDelay) ? seriesDelay(idx) + : (seriesDuration * ratio) + seriesDelayValue; const symbolPath = el.getSymbolPath(); const text = symbolPath.getTextContent(); diff --git a/src/chart/pie/PieView.ts b/src/chart/pie/PieView.ts index 77f5c445e3..cb0e1d6357 100644 --- a/src/chart/pie/PieView.ts +++ b/src/chart/pie/PieView.ts @@ -31,7 +31,7 @@ import PieSeriesModel, {PieDataItemOption} from './PieSeries'; import labelLayout from './labelLayout'; import { setLabelLineStyle, getLabelLineStatesModels } from '../../label/labelGuideHelper'; import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; -import { getSectorCornerRadius } from '../helper/pieHelper'; +import { getSectorCornerRadius } from '../helper/sectorHelper'; import { saveOldStyle } from '../../animation/basicTransition'; import { getBasicPieLayout } from './pieLayout'; diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 873a686f17..f4e1598dc1 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -28,10 +28,11 @@ import { PathStyleProps } from 'zrender/src/graphic/Path'; import { ColorString } from '../../util/types'; import Model from '../../model/Model'; import { getECData } from '../../util/innerStore'; -import { getSectorCornerRadius } from '../helper/pieHelper'; +import { getSectorCornerRadius } from '../helper/sectorHelper'; import {createOrUpdatePatternFromDecal} from '../../util/decal'; import ExtensionAPI from '../../core/ExtensionAPI'; import { saveOldStyle } from '../../animation/basicTransition'; +import { normalizeRadian } from 'zrender/src/contain/util'; const DEFAULT_SECTOR_Z = 2; const DEFAULT_TEXT_Z = 4; @@ -116,7 +117,7 @@ class SunburstPiece extends graphic.Sector { if (firstCreate) { sector.setShape(sectorShape); sector.shape.r = layout.r0; - graphic.updateProps( + graphic.initProps( sector, { shape: { @@ -251,8 +252,8 @@ class SunburstPiece extends graphic.Sector { const rotateType = getLabelAttr(labelStateModel, 'rotate'); let rotate = 0; if (rotateType === 'radial') { - rotate = -midAngle; - if (rotate < -Math.PI / 2) { + rotate = normalizeRadian(-midAngle); + if (((rotate > Math.PI / 2 && rotate <= Math.PI * 1.5))) { rotate += Math.PI; } } diff --git a/src/chart/sunburst/SunburstSeries.ts b/src/chart/sunburst/SunburstSeries.ts index 402de0110d..185fc14129 100644 --- a/src/chart/sunburst/SunburstSeries.ts +++ b/src/chart/sunburst/SunburstSeries.ts @@ -50,7 +50,7 @@ interface SunburstItemStyleOption extends ItemStyleOption { +interface SunburstLabelOption extends Omit, 'rotate' | 'position'> { rotate?: 'radial' | 'tangential' | number minAngle?: number silent?: boolean @@ -77,8 +77,8 @@ export interface SunburstStateOption { } export interface SunburstSeriesNodeItemOption extends - SunburstStateOption, - StatesOptionMixin, SunburstStatesMixin>, + SunburstStateOption, + StatesOptionMixin, SunburstStatesMixin>, OptionDataItemObject { nodeClick?: 'rootToNode' | 'link' | false @@ -92,8 +92,9 @@ export interface SunburstSeriesNodeItemOption extends cursor?: string } -export interface SunburstSeriesLevelOption - extends SunburstStateOption, StatesOptionMixin { +export interface SunburstSeriesLevelOption extends + SunburstStateOption, + StatesOptionMixin, SunburstStatesMixin> { radius?: (number | string)[] /** @@ -118,7 +119,8 @@ interface SortParam { getValue(): number } export interface SunburstSeriesOption extends - SeriesOption, SunburstStateOption, + SeriesOption, SunburstStatesMixin>, + SunburstStateOption, SunburstColorByMixin, CircleLayoutOptionMixin { @@ -142,6 +144,8 @@ export interface SunburstSeriesOption extends renderLabelForZeroData?: boolean + data?: SunburstSeriesNodeItemOption[] + levels?: SunburstSeriesLevelOption[] animationType?: 'expansion' | 'scale' diff --git a/src/chart/tree/TreeSeries.ts b/src/chart/tree/TreeSeries.ts index 245bf91dc8..820c3c99ba 100644 --- a/src/chart/tree/TreeSeries.ts +++ b/src/chart/tree/TreeSeries.ts @@ -82,7 +82,7 @@ export interface TreeSeriesLeavesOption export interface TreeSeriesOption extends SeriesOption, TreeSeriesStateOption, - SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin { + SymbolOptionMixin, BoxLayoutOptionMixin, RoamOptionMixin { type?: 'tree' layout?: 'orthogonal' | 'radial' diff --git a/src/component/axis/AxisBuilder.ts b/src/component/axis/AxisBuilder.ts index d01d20d660..c7b48dcafd 100644 --- a/src/component/axis/AxisBuilder.ts +++ b/src/component/axis/AxisBuilder.ts @@ -152,7 +152,7 @@ class AxisBuilder { ); - // FIXME Not use a seperate text group? + // FIXME Not use a separate text group? const transformGroup = new graphic.Group({ x: opt.position[0], y: opt.position[1], @@ -796,7 +796,7 @@ function buildAxisLabel( // in category axis. // (2) Compatible with previous version, which always use formatted label as // input. But in interval scale the formatted label is like '223,445', which - // maked user repalce ','. So we modify it to return original val but remain + // maked user replace ','. So we modify it to return original val but remain // it as 'string' to avoid error in replacing. axis.type === 'category' ? rawLabel diff --git a/src/component/axisPointer/BaseAxisPointer.ts b/src/component/axisPointer/BaseAxisPointer.ts index 003fa28496..5b91847b19 100644 --- a/src/component/axisPointer/BaseAxisPointer.ts +++ b/src/component/axisPointer/BaseAxisPointer.ts @@ -135,7 +135,7 @@ class BaseAxisPointer implements AxisPointer { this._axisPointerModel = axisPointerModel; this._api = api; - // Optimize: `render` will be called repeatly during mouse move. + // Optimize: `render` will be called repeatedly during mouse move. // So it is power consuming if performing `render` each time, // especially on mobile device. if (!forceRender @@ -251,7 +251,7 @@ class BaseAxisPointer implements AxisPointer { axisPointerModel: AxisPointerModel, api: ExtensionAPI ) { - // Shoule be implemenented by sub-class. + // Should be implemenented by sub-class. } /** @@ -360,7 +360,7 @@ class BaseAxisPointer implements AxisPointer { cursor: 'move', draggable: true, onmousemove(e) { - // Fot mobile devicem, prevent screen slider on the button. + // For mobile device, prevent screen slider on the button. eventTool.stop(e.event); }, onmousedown: bind(this._onHandleDragMove, this, 0, 0), @@ -576,4 +576,4 @@ function updateMandatoryProps( }); } -export default BaseAxisPointer; \ No newline at end of file +export default BaseAxisPointer; diff --git a/src/component/axisPointer/axisTrigger.ts b/src/component/axisPointer/axisTrigger.ts index bae5d0938b..810108d866 100644 --- a/src/component/axisPointer/axisTrigger.ts +++ b/src/component/axisPointer/axisTrigger.ts @@ -425,8 +425,8 @@ function dispatchTooltipActually( } // In most case only one axis (or event one series is used). It is - // convinient to fetch payload.seriesIndex and payload.dataIndex - // dirtectly. So put the first seriesIndex and dataIndex of the first + // convenient to fetch payload.seriesIndex and payload.dataIndex + // directly. So put the first seriesIndex and dataIndex of the first // axis on the payload. const sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {} as DataIndex; @@ -450,7 +450,7 @@ function dispatchHighDownActually( api: ExtensionAPI ) { // FIXME - // highlight status modification shoule be a stage of main process? + // highlight status modification should be a stage of main process? // (Consider confilct (e.g., legend and axisPointer) and setOption) const zr = api.getZr(); diff --git a/src/component/axisPointer/modelHelper.ts b/src/component/axisPointer/modelHelper.ts index c991ae0c29..81c8568741 100644 --- a/src/component/axisPointer/modelHelper.ts +++ b/src/component/axisPointer/modelHelper.ts @@ -130,8 +130,8 @@ function collectAxesInfo(result: CollectionResult, ecModel: GlobalModel, api: Ex result.coordSysAxesInfo[coordSysKey] = {}; result.coordSysMap[coordSysKey] = coordSys; - // Set tooltip (like 'cross') is a convienent way to show axisPointer - // for user. So we enable seting tooltip on coordSys model. + // Set tooltip (like 'cross') is a convenient way to show axisPointer + // for user. So we enable setting tooltip on coordSys model. const coordSysModel = coordSys.model as ComponentModel; @@ -250,8 +250,8 @@ function makeAxisPointerModel( // triggered from tooltip and trigger tooltip. volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; - // Compatibel with previous behavior, tooltip axis do not show label by default. - // Only these properties can be overrided from tooltip to axisPointer. + // Compatible with previous behavior, tooltip axis does not show label by default. + // Only these properties can be overridden from tooltip to axisPointer. if (tooltipAxisPointerModel.get('type') === 'cross') { volatileOption.type = 'line'; } diff --git a/src/component/axisPointer/viewHelper.ts b/src/component/axisPointer/viewHelper.ts index aea2c9fe25..c31daa1d07 100644 --- a/src/component/axisPointer/viewHelper.ts +++ b/src/component/axisPointer/viewHelper.ts @@ -129,7 +129,7 @@ export function buildLabelElOption( padding: paddings, backgroundColor: bgColor as ColorString }), - // Lable should be over axisPointer. + // Label should be over axisPointer. z2: 10 }; } diff --git a/src/component/dataZoom/SliderZoomView.ts b/src/component/dataZoom/SliderZoomView.ts index 1f98f15923..a6545fdb3e 100644 --- a/src/component/dataZoom/SliderZoomView.ts +++ b/src/component/dataZoom/SliderZoomView.ts @@ -286,7 +286,7 @@ class SliderZoomView extends DataZoomView { ? {scaleY: otherAxisInverse ? 1 : -1, scaleX: -1 } : (orient === VERTICAL && !inverse) ? {scaleY: otherAxisInverse ? -1 : 1, scaleX: 1, rotation: Math.PI / 2} - // Dont use Math.PI, considering shadow direction. + // Don't use Math.PI, considering shadow direction. : {scaleY: otherAxisInverse ? -1 : 1, scaleX: -1, rotation: Math.PI / 2} ); @@ -1055,7 +1055,7 @@ class SliderZoomView extends DataZoomView { } private _findCoordRect() { - // Find the grid coresponding to the first axis referred by dataZoom. + // Find the grid corresponding to the first axis referred by dataZoom. let rect: RectLike; const coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList; diff --git a/src/component/helper/BrushController.ts b/src/component/helper/BrushController.ts index 647f17c9e6..38cf197499 100644 --- a/src/component/helper/BrushController.ts +++ b/src/component/helper/BrushController.ts @@ -32,10 +32,10 @@ import { PathStyleProps } from 'zrender/src/graphic/Path'; /** - * BrushController not only used in "brush component", - * but also used in "tooltip DataZoom", and other possible - * futher brush behavior related scenarios. - * So `BrushController` should not depends on "brush component model". + * BrushController is not only used in "brush component", + * but is also used in "tooltip DataZoom", and other possible + * further brush behavior related scenarios. + * So `BrushController` should not depend on "brush component model". */ @@ -410,7 +410,7 @@ class BrushController extends Eventful<{ function addOrUpdate(newIndex: number, oldIndex?: number): void { const newBrushInternal = coverConfigList[newIndex]; // Consider setOption in event listener of brushSelect, - // where updating cover when creating should be forbiden. + // where updating cover when creating should be forbidden. if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { newCovers[newIndex] = oldCovers[oldIndex]; } @@ -998,7 +998,7 @@ function handleDragEnd(controller: BrushController, e: ElementEvent) { controller._track = []; controller._creatingCover = null; - // trigger event shoule be at final, after procedure will be nested. + // trigger event should be at final, after procedure will be nested. eventParams && trigger(controller, eventParams); } } diff --git a/src/component/helper/BrushTargetManager.ts b/src/component/helper/BrushTargetManager.ts index a7aac46ff7..9a378fd001 100644 --- a/src/component/helper/BrushTargetManager.ts +++ b/src/component/helper/BrushTargetManager.ts @@ -194,7 +194,7 @@ class BrushTargetManager { // convert coordRange to global range and set panelId. if (targetInfo && targetInfo !== true) { area.panelId = targetInfo.panelId; - // (1) area.range shoule always be calculate from coordRange but does + // (1) area.range should always be calculate from coordRange but does // not keep its original value, for the sake of the dataZoom scenario, // where area.coordRange remains unchanged but area.range may be changed. // (2) Only support converting one coordRange to pixel range in brush @@ -244,7 +244,7 @@ class BrushTargetManager { /** * If return Object, a coord found. - * If reutrn true, global found. + * If return true, global found. * Otherwise nothing found. */ findTargetInfo( diff --git a/src/component/helper/MapDraw.ts b/src/component/helper/MapDraw.ts index 89827f9570..2ec2c5af2f 100644 --- a/src/component/helper/MapDraw.ts +++ b/src/component/helper/MapDraw.ts @@ -466,11 +466,11 @@ class MapDraw { viewBuildCtx: ViewBuildContext ): void { // It's a little complicated to support blurring the entire geoSVG in series-map. - // So do not suport it until some requirements come. + // So do not support it until some requirements come. // At present, in series-map, only regions can be blurred. if (focusSelf && viewBuildCtx.isGeo) { const blurStyle = (viewBuildCtx.mapOrGeoModel as GeoModel).getModel(['blur', 'itemStyle']).getItemStyle(); - // Only suport `opacity` here. Because not sure that other props are suitable for + // Only support `opacity` here. Because not sure that other props are suitable for // all of the elements generated by SVG (especially for Text/TSpan/Image/... ). const opacity = blurStyle.opacity; this._svgGraphicRecord.root.traverse(el => { @@ -677,7 +677,7 @@ function applyOptionStyleForRegion( // polyline and polygon is "open" or "close" but not fill or not). // (2) For the common props like opacity, if some use itemStyle // and some use `lineStyle`, it might confuse users. - // (3) Most SVG use , where can not detect wether draw a "line" + // (3) Most SVG use , where can not detect whether to draw a "line" // or a filled shape, so use `itemStyle` for . const normalStyleModel = regionModel.getModel('itemStyle'); @@ -685,7 +685,7 @@ function applyOptionStyleForRegion( const blurStyleModel = regionModel.getModel(['blur', 'itemStyle']); const selectStyleModel = regionModel.getModel(['select', 'itemStyle']); - // NOTE: DONT use 'style' in visual when drawing map. + // NOTE: DON'T use 'style' in visual when drawing map. // This component is used for drawing underlying map for both geo component and map series. const normalStyle = getFixedItemStyle(normalStyleModel); const emphasisStyle = getFixedItemStyle(emphasisStyleModel); diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index 2777b137f4..f5e5b7ddf3 100644 --- a/src/component/marker/markerHelper.ts +++ b/src/component/marker/markerHelper.ts @@ -105,14 +105,14 @@ export function dataTransform( const data = seriesModel.getData(); const coordSys = seriesModel.coordinateSystem; - const dims = coordSys.dimensions; + const dims = coordSys && coordSys.dimensions; // 1. If not specify the position with pixel directly // 2. If `coord` is not a data array. Which uses `xAxis`, // `yAxis` to specify the coord on each dimension // parseFloat first because item.x and item.y can be percent string like '20%' - if (!hasXAndY(item) && !isArray(item.coord) && coordSys) { + if (!hasXAndY(item) && !isArray(item.coord) && isArray(dims)) { const axisInfo = getAxisInfo(item, data, coordSys, seriesModel); // Clone the option @@ -144,7 +144,7 @@ export function dataTransform( } } // x y is provided - if (item.coord == null) { + if (item.coord == null || !isArray(dims)) { item.coord = []; } else { diff --git a/src/component/toolbox/ToolboxView.ts b/src/component/toolbox/ToolboxView.ts index faa3404184..e24be3cd96 100644 --- a/src/component/toolbox/ToolboxView.ts +++ b/src/component/toolbox/ToolboxView.ts @@ -117,7 +117,7 @@ class ToolboxView extends ComponentView { } else { feature = features[oldName]; - // If feature does not exsit. + // If feature does not exist. if (!feature) { return; } @@ -169,7 +169,7 @@ class ToolboxView extends ComponentView { const iconStyleModel = featureModel.getModel('iconStyle'); const iconStyleEmphasisModel = featureModel.getModel(['emphasis', 'iconStyle']); - // If one feature has mutiple icon. they are orginaized as + // If one feature has multiple icons, they are organized as // { // icon: { // foo: '', diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts index 02496857b0..b326acd091 100644 --- a/src/component/tooltip/TooltipHTMLContent.ts +++ b/src/component/tooltip/TooltipHTMLContent.ts @@ -262,6 +262,7 @@ class TooltipHTMLContent { private _enterable = true; private _zr: ZRenderType; + private _alwaysShowContent: boolean = false; private _hideTimeout: number; /** * Hide delay time @@ -360,6 +361,9 @@ class TooltipHTMLContent { const alwaysShowContent = tooltipModel.get('alwaysShowContent'); alwaysShowContent && this._moveIfResized(); + // update alwaysShowContent + this._alwaysShowContent = alwaysShowContent; + // update className this.el.className = tooltipModel.get('className') || ''; @@ -488,7 +492,7 @@ class TooltipHTMLContent { } hideLater(time?: number) { - if (this._show && !(this._inContent && this._enterable)) { + if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { if (time) { this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times diff --git a/src/component/tooltip/TooltipRichContent.ts b/src/component/tooltip/TooltipRichContent.ts index c78da5ef49..d8f038dcbf 100644 --- a/src/component/tooltip/TooltipRichContent.ts +++ b/src/component/tooltip/TooltipRichContent.ts @@ -37,6 +37,8 @@ class TooltipRichContent { private _hideTimeout: number; + private _alwaysShowContent: boolean = false; + private _enterable = true; private _inContent: boolean; @@ -56,6 +58,9 @@ class TooltipRichContent { update(tooltipModel: Model) { const alwaysShowContent = tooltipModel.get('alwaysShowContent'); alwaysShowContent && this._moveIfResized(); + + // update alwaysShowContent + this._alwaysShowContent = alwaysShowContent; } show() { @@ -190,7 +195,7 @@ class TooltipRichContent { } hideLater(time?: number) { - if (this._show && !(this._inContent && this._enterable)) { + if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) { if (time) { this._hideDelay = time; // Set show false to avoid invoke hideLater multiple times diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index f99d863811..82a222cb1d 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -147,8 +147,6 @@ class TooltipView extends ComponentView { private _api: ExtensionAPI; - private _alwaysShowContent: boolean; - private _tooltipContent: TooltipHTMLContent | TooltipRichContent; private _refreshUpdateTimeout: number; @@ -196,12 +194,6 @@ class TooltipView extends ComponentView { this._api = api; - /** - * @private - * @type {boolean} - */ - this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); - const tooltipContent = this._tooltipContent; tooltipContent.update(tooltipModel); tooltipContent.setEnterable(tooltipModel.get('enterable')); @@ -396,7 +388,7 @@ class TooltipView extends ComponentView { ) { const tooltipContent = this._tooltipContent; - if (!this._alwaysShowContent && this._tooltipModel) { + if (this._tooltipModel) { tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); } @@ -745,8 +737,8 @@ class TooltipView extends ComponentView { tooltipModelCascade.push(cmpt as Model); } // In most cases, component tooltip formatter has different params with series tooltip formatter, - // so that they can not share the same formatter. Since the global tooltip formatter is used for series - // by convension, we do not use it as the default formatter for component. + // so that they cannot share the same formatter. Since the global tooltip formatter is used for series + // by convention, we do not use it as the default formatter for component. tooltipModelCascade.push({ formatter: tooltipOpt.content }); const positionDefault = e.positionDefault; @@ -1091,7 +1083,7 @@ function refixTooltipPosition( if (gapH != null) { // Add extra 2 pixels for this case: - // At present the "values" in defaut tooltip are using CSS `float: right`. + // At present the "values" in default tooltip are using CSS `float: right`. // When the right edge of the tooltip box is on the right side of the // viewport, the `float` layout might push the "values" to the second line. if (x + width + gapH + 2 > viewWidth) { diff --git a/src/component/tooltip/seriesFormatTooltip.ts b/src/component/tooltip/seriesFormatTooltip.ts index 18197bec28..6e5f7be099 100644 --- a/src/component/tooltip/seriesFormatTooltip.ts +++ b/src/component/tooltip/seriesFormatTooltip.ts @@ -78,8 +78,8 @@ export function defaultSeriesFormatTooltip(opt: { return createTooltipMarkup('section', { header: seriesName, - // When series name not specified, do not show a header line with only '-'. - // This case alway happen in tooltip.trigger: 'item'. + // When series name is not specified, do not show a header line with only '-'. + // This case always happens in tooltip.trigger: 'item'. noHeader: multipleSeries || !seriesNameSpecified, sortParam: sortParam, blocks: [ diff --git a/src/component/tooltip/tooltipMarkup.ts b/src/component/tooltip/tooltipMarkup.ts index b893cd8c0a..c8296b7e62 100644 --- a/src/component/tooltip/tooltipMarkup.ts +++ b/src/component/tooltip/tooltipMarkup.ts @@ -494,8 +494,8 @@ export function getPaddingFromTooltipModel( export class TooltipMarkupStyleCreator { readonly richTextStyles: Dictionary> = {}; - // Notice that "generate a style name" usuall happens repeatly when mouse moving and - // displaying a tooltip. So we put the `_nextStyleNameId` as a member of each creator + // Notice that "generate a style name" usually happens repeatedly when mouse is moving and + // a tooltip is displayed. So we put the `_nextStyleNameId` as a member of each creator // rather than static shared by all creators (which will cause it increase to fast). private _nextStyleNameId: number = getRandomIdBase(); diff --git a/src/component/transform/filterTransform.ts b/src/component/transform/filterTransform.ts index 627f3724c0..5b557a34dc 100644 --- a/src/component/transform/filterTransform.ts +++ b/src/component/transform/filterTransform.ts @@ -35,12 +35,12 @@ export const filterTransform: ExternalDataTransform = { type: 'echarts:filter', - // PEDING: enhance to filter by index rather than create new data + // PENDING: enhance to filter by index rather than create new data transform: function (params) { // [Caveat] Fail-Fast: - // Do not return the whole dataset unless user config indicate it explicitly. - // For example, if no condition specified by mistake, return an empty result - // is better than return the entire raw soruce for user to find the mistake. + // Do not return the whole dataset unless user config indicates it explicitly. + // For example, if no condition is specified by mistake, returning an empty result + // is better than returning the entire raw source for the user to find the mistake. const upstream = params.upstream; let rawItem: DataTransformDataItem; diff --git a/src/component/visualMap/ContinuousModel.ts b/src/component/visualMap/ContinuousModel.ts index ef62a7ca55..d8281bcec8 100644 --- a/src/component/visualMap/ContinuousModel.ts +++ b/src/component/visualMap/ContinuousModel.ts @@ -46,7 +46,7 @@ export interface ContinousVisualMapOption extends VisualMapOption { /** * selected range. In default case `range` is [min, max] * and can auto change along with modification of min max, - * util user specifid a range. + * until user specified a range. */ range?: number[] /** @@ -121,7 +121,7 @@ class ContinuousModel extends VisualMapModel { const range = this.option.range; if (!range || (range as RangeWithAuto).auto) { - // `range` should always be array (so we dont use other + // `range` should always be array (so we don't use other // value like 'auto') for user-friend. (consider getOption). (dataExtent as RangeWithAuto).auto = 1; this.option.range = dataExtent; diff --git a/src/component/visualMap/ContinuousView.ts b/src/component/visualMap/ContinuousView.ts index 9886945161..2b2248ef28 100644 --- a/src/component/visualMap/ContinuousView.ts +++ b/src/component/visualMap/ContinuousView.ts @@ -296,7 +296,7 @@ class ContinuousView extends VisualMapView { draggable: true, drift: onDrift, onmousemove(e) { - // Fot mobile devicem, prevent screen slider on the button. + // For mobile device, prevent screen slider on the button. eventTool.stop(e.event); }, ondragend: onDragEnd, @@ -453,7 +453,7 @@ class ContinuousView extends VisualMapView { handleEnds, sizeExtent, handleIndex, - // cross is forbiden + // cross is forbidden 0 ); @@ -532,7 +532,7 @@ class ContinuousView extends VisualMapView { } ) { // Considering colorHue, which is not linear, so we have to sample - // to calculate gradient color stops, but not only caculate head + // to calculate gradient color stops, but not only calculate head // and tail. const sampleNumber = 100; // Arbitrary value. const colorStops: LinearGradientObject['colorStops'] = []; @@ -930,7 +930,7 @@ function createPolygon( cursor: cursor, drift: onDrift, onmousemove(e) { - // Fot mobile devicem, prevent screen slider on the button. + // For mobile device, prevent screen slider on the button. eventTool.stop(e.event); }, ondragend: onDragEnd diff --git a/src/component/visualMap/PiecewiseModel.ts b/src/component/visualMap/PiecewiseModel.ts index a0fff4b7bb..7dcd63aa46 100644 --- a/src/component/visualMap/PiecewiseModel.ts +++ b/src/component/visualMap/PiecewiseModel.ts @@ -531,7 +531,7 @@ const resetMethods: Dictionary & ThisType = { } else { // `min` `max` is legacy option. - // `lt` `gt` `lte` `gte` is recommanded. + // `lt` `gt` `lte` `gte` is recommended. const interval = item.interval = [] as unknown as [number, number]; const close: typeof item.close = item.close = [0, 0]; @@ -597,4 +597,4 @@ function normalizeReverse(thisOption: PiecewiseVisualMapOption, pieceList: Inner } } -export default PiecewiseModel; \ No newline at end of file +export default PiecewiseModel; diff --git a/src/component/visualMap/VisualMapModel.ts b/src/component/visualMap/VisualMapModel.ts index 6f9c486849..85b3162e51 100644 --- a/src/component/visualMap/VisualMapModel.ts +++ b/src/component/visualMap/VisualMapModel.ts @@ -373,7 +373,7 @@ class VisualMapModel extends Com * PENDING: * delete this method if no outer usage. * - * Return Concrete dimention. If return null/undefined, no dimension used. + * Return Concrete dimension. If null/undefined is returned, no dimension is used. */ // getDataDimension(data: SeriesData) { // const optDim = this.option.dimension; @@ -449,7 +449,7 @@ class VisualMapModel extends Com base.inRange = {color: thisOption.color.slice().reverse()}; } - // Compatible with previous logic, always give a defautl color, otherwise + // Compatible with previous logic, always give a default color, otherwise // simple config with no inRange and outOfRange will not work. // Originally we use visualMap.color as the default color, but setOption at // the second time the default color will be erased. So we change to use diff --git a/src/data/DataStore.ts b/src/data/DataStore.ts index abc3bb4b9e..36f7373a74 100644 --- a/src/data/DataStore.ts +++ b/src/data/DataStore.ts @@ -161,7 +161,7 @@ class DataStore { private _provider: DataProvider; - // It will not be calculated util needed. + // It will not be calculated until needed. private _rawExtent: [number, number][] = []; private _extent: [number, number][] = []; @@ -601,7 +601,7 @@ class DataStore { // When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`, // we'd better not push both of them to `nearestIndices`, otherwise it is easy to // get more than one item in `nearestIndices` (more specifically, in `tooltip`). - // So we chose the one that `diff >= 0` in this csae. + // So we choose the one that `diff >= 0` in this case. // But if `this.get(dim, i)` and `this.get(dim, j)` get the same value, both of them // should be push to `nearestIndices`. if (dist < minDist @@ -970,7 +970,7 @@ class DataStore { let firstNaNIndex = -1; let countNaN = 0; - // Find a point from current frame that construct a triangel with largest area with previous selected point + // Find a point from current frame that construct a triangle with largest area with previous selected point // And the average of next frame. for (let idx = frameStart; idx < frameEnd; idx++) { const rawIndex = this.getRawIndex(idx); diff --git a/src/data/Graph.ts b/src/data/Graph.ts index f7939a5304..c12350e70a 100644 --- a/src/data/Graph.ts +++ b/src/data/Graph.ts @@ -109,7 +109,7 @@ class Graph { const nodesMap = this._nodesMap; const edgesMap = this._edgesMap; - // PNEDING + // PENDING if (zrUtil.isNumber(n1)) { n1 = this.nodes[n1]; } diff --git a/src/data/Source.ts b/src/data/Source.ts index 7e27cc6aa8..95a341041f 100644 --- a/src/data/Source.ts +++ b/src/data/Source.ts @@ -19,7 +19,7 @@ import { isTypedArray, HashMap, clone, createHashMap, isArray, isObject, isArrayLike, - hasOwn, assert, each, map, isNumber, isString + hasOwn, assert, each, map, isNumber, isString, keys } from 'zrender/src/core/util'; import { SourceFormat, SeriesLayoutBy, DimensionDefinition, @@ -405,11 +405,7 @@ function objectRowsCollectDimensions(data: OptionSourceDataObjectRows): Dimensio let obj; while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line if (obj) { - const dimensions: DimensionDefinitionLoose[] = []; - each(obj, function (value, key) { - dimensions.push(key); - }); - return dimensions; + return keys(obj); } } diff --git a/src/i18n/langCS.ts b/src/i18n/langCS.ts index 792172af3b..f5e4d812db 100644 --- a/src/i18n/langCS.ts +++ b/src/i18n/langCS.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Czech. @@ -139,4 +139,4 @@ } } } -}; \ No newline at end of file +}; diff --git a/src/i18n/langDE.ts b/src/i18n/langDE.ts index 9d8e435d06..3d8b6e73f2 100644 --- a/src/i18n/langDE.ts +++ b/src/i18n/langDE.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: German. @@ -139,4 +139,4 @@ export default { } } } -}; \ No newline at end of file +}; diff --git a/src/i18n/langEN.ts b/src/i18n/langEN.ts index 311c6a22af..266280cf6c 100644 --- a/src/i18n/langEN.ts +++ b/src/i18n/langEN.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: English. diff --git a/src/i18n/langFR.ts b/src/i18n/langFR.ts index c41007ae78..2a501aff87 100644 --- a/src/i18n/langFR.ts +++ b/src/i18n/langFR.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Français. diff --git a/src/i18n/langHU.ts b/src/i18n/langHU.ts index 172582c89b..3cdce9b837 100644 --- a/src/i18n/langHU.ts +++ b/src/i18n/langHU.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Hungarian. diff --git a/src/i18n/langIT.ts b/src/i18n/langIT.ts index d5db5fa705..75199920ce 100644 --- a/src/i18n/langIT.ts +++ b/src/i18n/langIT.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Italian. diff --git a/src/i18n/langJA.ts b/src/i18n/langJA.ts index e894921b25..cd431d5046 100644 --- a/src/i18n/langJA.ts +++ b/src/i18n/langJA.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Japanese. diff --git a/src/i18n/langKO.ts b/src/i18n/langKO.ts index bc364eae14..6901ac1b9f 100644 --- a/src/i18n/langKO.ts +++ b/src/i18n/langKO.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Korean. diff --git a/src/i18n/langPL.ts b/src/i18n/langPL.ts index 1b8fca468a..c84be2ebee 100644 --- a/src/i18n/langPL.ts +++ b/src/i18n/langPL.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Polish diff --git a/src/i18n/langPT-br.ts b/src/i18n/langPT-br.ts index 8d6eb014f7..47c098661b 100644 --- a/src/i18n/langPT-br.ts +++ b/src/i18n/langPT-br.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Portuguese (Brazil). diff --git a/src/i18n/langRO.ts b/src/i18n/langRO.ts index 5dab83dcba..51ee51ef12 100644 --- a/src/i18n/langRO.ts +++ b/src/i18n/langRO.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Romanian. diff --git a/src/i18n/langSI.ts b/src/i18n/langSI.ts index 7042da01dc..6a1d287463 100644 --- a/src/i18n/langSI.ts +++ b/src/i18n/langSI.ts @@ -1,21 +1,21 @@ /* -* 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. -*/ + * 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. + */ /** * Language: Slovenian. @@ -139,4 +139,4 @@ export default { } } } -}; \ No newline at end of file +}; diff --git a/src/i18n/langTR.ts b/src/i18n/langTR.ts new file mode 100644 index 0000000000..f984abcd71 --- /dev/null +++ b/src/i18n/langTR.ts @@ -0,0 +1,142 @@ +/* + * 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. + */ + +/** + * Language: Türkçe. + */ + +export default { + time: { + month: [ + 'Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', + 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık' + ], + monthAbbr: [ + 'Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', + 'Tem', 'Agu', 'Eyl', 'Eki', 'Kas', 'Ara' + ], + dayOfWeek: [ + 'Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi' + ], + dayOfWeekAbbr: [ + 'Paz', 'Pzt', 'Sal', 'Çrş', 'Prş', 'Cum', 'Cts' + ] + }, + legend: { + selector: { + all: 'Tümünü Seç', + inverse: 'Seçimi Ters Çevir' + } + }, + toolbox: { + brush: { + title: { + rect: 'Dikdörtgen Seçimi', + polygon: 'Kement Seçimi', + lineX: 'Yatay Seçim', + lineY: 'Dikey Seçim', + keep: 'Seçimi Koru', + clear: 'Seçimi Sil' + } + }, + dataView: { + title: 'Veri Görünümü', + lang: ['Veri Görünümü', 'Kapat', 'Yenile'] + }, + dataZoom: { + title: { + zoom: 'Yakınlaştır/Uzaklaştır', + back: 'Yakınlaştırmayı Sıfırla' + } + }, + magicType: { + title: { + line: 'Çizgisel Grafiğe Çevir', + bar: 'Çubuk Grafiğe Çevir', + stack: 'Yığın', + tiled: 'Blok' + } + }, + restore: { + title: 'Eski Haline Getir' + }, + saveAsImage: { + title: 'Resim Olarak Kaydet', + lang: ['Resim Olarak Kaydetmek için Sağ Tıklayın'] + } + }, + series: { + typeNames: { + pie: 'Pasta Grafiği', + bar: 'Çubuk Grafik', + line: 'Çizgi Grafiği', + scatter: 'Dağılım Grafiği', + effectScatter: 'Dalga Efekt Dağılım Grafiği', + radar: 'Radar Grafiği', + tree: 'Ağaç Grafiği', + treemap: 'Ağaç Haritası', + boxplot: 'Kutu Grafiği', + candlestick: 'Şamdan Grafik', + k: 'K Çizgi Grafiği', + heatmap: 'Sıcaklık Haritası', + map: 'Harita', + parallel: 'Paralel Koordinat Haritası', + lines: 'Çizgisel Grafik', + graph: 'İlişkisel Grafik', + sankey: 'Sankey Diagramı', + funnel: 'Huni Grafik', + gauge: 'Gösterge', + pictorialBar: 'Resimli Çubuk Grafiği', + themeRiver: 'Akış Haritası', + sunburst: 'Güeş Patlaması Tablosu' + } + }, + aria: { + general: { + withTitle: 'Bu grafik "{title}" içindir.', + withoutTitle: 'Bu Bir Grafiktir.' + }, + series: { + single: { + prefix: '', + withName: ' Grafik Türü {seriesType} ve {seriesName} gösteriyor.', + withoutName: ' {seriesType} tipinde grafik.' + }, + multiple: { + prefix: '. {seriesCount} kadar grafik sayısından oluşur.', + withName: ' {seriesId}.serisi {seriesName} adını temsil eden bir {seriesType} temsil eder.', + withoutName: ' {seriesId}. serisi bir {seriesType}.', + separator: { + middle: '', + end: '' + } + } + }, + data: { + allData: 'Veriler Aşağıdaki Gibidir: ', + partialData: 'İlk {displayCnt} öğesi: ', + withName: ' {value} için {name}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } +}; diff --git a/src/i18n/langVI.ts b/src/i18n/langVI.ts new file mode 100644 index 0000000000..287e2e39c5 --- /dev/null +++ b/src/i18n/langVI.ts @@ -0,0 +1,167 @@ +/* + * 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. + */ + +/** + * Language: Vietnamese. + */ + +export default { + time: { + month: [ + 'Tháng 1', + 'Tháng 2', + 'Tháng 3', + 'Tháng 4', + 'Tháng 5', + 'Tháng 6', + 'Tháng 7', + 'Tháng 8', + 'Tháng 9', + 'Tháng 10', + 'Tháng 11', + 'Tháng 12' + ], + monthAbbr: [ + 'Th01', + 'Th02', + 'Th03', + 'Th04', + 'Th05', + 'Th06', + 'Th07', + 'Th08', + 'Th09', + 'Th10', + 'Th11', + 'Th12' + ], + dayOfWeek: [ + 'Chủ nhật', + 'Thứ hai', + 'Thứ ba', + 'Thứ tư', + 'Thứ năm', + 'Thứ sáu', + 'Thứ bảy' + ], + dayOfWeekAbbr: ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'] + }, + legend: { + selector: { + all: 'Tất cả', + inverse: 'Ngược lại' + } + }, + toolbox: { + brush: { + title: { + rect: 'Chọn theo ô', + polygon: 'Chọn theo đường bất kỳ', + lineX: 'Chọn theo chiều ngang', + lineY: 'Chọn theo chiều dọc', + keep: 'Giữ đã chọn', + clear: 'Bỏ đã chọn' + } + }, + dataView: { + title: 'Xem dữ liệu', + lang: ['Xem dữ liệu', 'Đóng', 'Làm mới'] + }, + dataZoom: { + title: { + zoom: 'Phóng to', + back: 'Bỏ phóng to' + } + }, + magicType: { + title: { + line: 'Chuyển sang biểu đồ đường', + bar: 'Chuyển sang biểu đồ cột', + stack: 'Xếp chồng', + tiled: 'Lát' + } + }, + restore: { + title: 'Khôi phục' + }, + saveAsImage: { + title: 'Lưu thành ảnh', + lang: ['Bấm phải chuột để lưu ảnh'] + } + }, + series: { + typeNames: { + pie: 'Biều đồ tròn', + bar: 'Biểu đồ cột', + line: 'Biểu đồ đường', + scatter: 'Biểu đồ phân tán', + effectScatter: 'Biểu đồ gợn sóng', + radar: 'Biểu đồ Radar', + tree: 'Biểu đồ cây', + treemap: 'Sơ đồ cây', + boxplot: 'Biểu đồ hộp', + candlestick: 'Biều đồ nến', + k: 'Biểu đồ đường K', + heatmap: 'Bản đồ nhiệt', + map: 'Bản đồ', + parallel: 'Bản đồ tọa độ song song', + lines: 'Biểu đồ đường', + graph: 'Đồ thị quan hệ', + sankey: 'Sơ đồ dòng', + funnel: 'Biểu đồ hình phễu', + gauge: 'Biểu đồ cung tròn', + pictorialBar: 'Biểu diễn hình ảnh', + themeRiver: 'Bản đồ sông', + sunburst: 'Biểu đồ bậc' + } + }, + aria: { + general: { + withTitle: 'Đây là biểu đồ "{title}"', + withoutTitle: 'Đây là biểu đồ' + }, + series: { + single: { + prefix: '', + withName: ' với kiểu {seriesType} tên là {seriesName}.', + withoutName: ' với kiểu {seriesType}.' + }, + multiple: { + prefix: '. Nó bao gồm {seriesCount} chuỗi.', + withName: + ' Chuỗi {seriesId} có kiểu {seriesType} đại diện cho {seriesName}.', + withoutName: ' Chuỗi {seriesId} có kiểu {seriesType}.', + separator: { + middle: '', + end: '' + } + } + }, + data: { + allData: 'Dữ liệu như sau: ', + partialData: 'Các mục {displayCnt} đầu tiên là: ', + withName: 'dữ liệu cho {name} là {value}', + withoutName: '{value}', + separator: { + middle: ', ', + end: '. ' + } + } + } +}; diff --git a/src/i18n/langZH.ts b/src/i18n/langZH.ts index 4f1bd661a4..3bd239cdec 100644 --- a/src/i18n/langZH.ts +++ b/src/i18n/langZH.ts @@ -135,4 +135,4 @@ export default { } } } -}; \ No newline at end of file +}; diff --git a/src/legacy/dataSelectAction.ts b/src/legacy/dataSelectAction.ts index 20aa742144..14eeb1544e 100644 --- a/src/legacy/dataSelectAction.ts +++ b/src/legacy/dataSelectAction.ts @@ -28,7 +28,7 @@ import { queryDataIndex } from '../util/model'; import ExtensionAPI from '../core/ExtensionAPI'; // Legacy data selection action. -// Inlucdes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect +// Includes: pieSelect, pieUnSelect, pieToggleSelect, mapSelect, mapUnSelect, mapToggleSelect export function createLegacyDataSelectAction(seriesType: string, ecRegisterAction: typeof registerAction) { function getSeriesIndices(ecModel: GlobalModel, payload: Payload) { diff --git a/src/model/Series.ts b/src/model/Series.ts index e2a5577b9e..89be20c7d1 100644 --- a/src/model/Series.ts +++ b/src/model/Series.ts @@ -146,7 +146,7 @@ class SeriesModel extends ComponentMode // @readonly seriesIndex: number; - // coodinateSystem will be injected in the echarts/CoordinateSystem + // coordinateSystem will be injected in the echarts/CoordinateSystem coordinateSystem: CoordinateSystem; // Injected outside @@ -718,7 +718,7 @@ function dataTaskReset(context: SeriesTaskContext) { } function dataTaskProgress(param: StageHandlerProgressParams, context: SeriesTaskContext): void { - // Avoid repead cloneShallow when data just created in reset. + // Avoid repeat cloneShallow when data just created in reset. if (context.outputData && param.end > context.outputData.count()) { context.model.getRawData().cloneShallow(context.outputData); } diff --git a/src/util/types.ts b/src/util/types.ts index 56c7b6983b..5338446122 100644 --- a/src/util/types.ts +++ b/src/util/types.ts @@ -1064,8 +1064,8 @@ export interface LabelOption extends TextCommonOption { rich?: Dictionary } -export interface SeriesLabelOption extends LabelOption { - formatter?: string | LabelFormatterCallback +export interface SeriesLabelOption extends LabelOption { + formatter?: string | LabelFormatterCallback } /** diff --git a/test/bar-markArea.html b/test/bar-markArea.html index 2f96ce9f7d..8473f0a43c 100644 --- a/test/bar-markArea.html +++ b/test/bar-markArea.html @@ -38,7 +38,11 @@
- +
+
+
+
+
+ + + + + + + + + - diff --git a/test/bar-polar-animation.html b/test/bar-polar-animation.html new file mode 100644 index 0000000000..4b6f698147 --- /dev/null +++ b/test/bar-polar-animation.html @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + diff --git a/test/bar-polar-borderRadius.html b/test/bar-polar-borderRadius.html new file mode 100644 index 0000000000..2bdc1b0146 --- /dev/null +++ b/test/bar-polar-borderRadius.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + diff --git a/test/dataset-category.html b/test/dataset-category.html index 175e4d1213..6cee1d53f3 100644 --- a/test/dataset-category.html +++ b/test/dataset-category.html @@ -47,6 +47,7 @@
+
@@ -671,7 +672,45 @@ + diff --git a/test/gauge-distance.html b/test/gauge-distance.html index e065db7d3c..e94a0087e0 100644 --- a/test/gauge-distance.html +++ b/test/gauge-distance.html @@ -182,7 +182,7 @@ }, pointer: { itemStyle: { - color: 'auto' + color: 'inherit' } }, axisTick: { @@ -200,13 +200,13 @@ } }, axisLabel: { - color: 'auto', + color: 'inherit', distance: 35, fontSize: 20 }, detail: { formatter: '{value}%', - color: 'auto' + color: 'inherit' }, data: [{value: 70, name: '完成率'}] } @@ -264,19 +264,19 @@ pointer: { length: '80%', itemStyle: { - color: 'auto' + color: 'inherit' } }, axisTick: { length: 15, lineStyle: { - color: 'auto' + color: 'inherit' } }, splitLine: { length: 20, lineStyle: { - color: 'auto', + color: 'inherit', width: 5 } }, @@ -309,7 +309,7 @@ formatter: function(value) { return value * 100 + '%'; }, - color: 'auto' + color: 'inherit' }, data: [{value: 0.75, name: '成绩评定'}] } diff --git a/test/gauge-group-title-detail.html b/test/gauge-group-title-detail.html index ab1aaf299a..73f134fee1 100644 --- a/test/gauge-group-title-detail.html +++ b/test/gauge-group-title-detail.html @@ -118,8 +118,8 @@ width: 30, height: 12, fontSize: 12, - color: 'auto', - borderColor: 'auto', + color: 'inherit', + borderColor: 'inherit', borderWidth: 1, borderRadius: 3, formatter: '{value}%', @@ -204,7 +204,7 @@ width: 30, height: 12, fontSize: 12, - color: 'auto', + color: 'inherit', formatter: '{value}%' } } @@ -288,7 +288,7 @@ height: 12, fontSize: 12, color: '#fff', - backgroundColor: 'auto', + backgroundColor: 'inherit', borderRadius: 3, formatter: '{value}%' } @@ -372,8 +372,8 @@ width: 30, height: 12, fontSize: 12, - color: 'auto', - borderColor: 'auto', + color: 'inherit', + borderColor: 'inherit', borderRadius: 3, borderWidth: 1, formatter: '{value}%' @@ -458,11 +458,11 @@ width: 30, height: 12, fontSize: 12, - color: 'auto', + color: 'inherit', borderRadius: 3, - borderColor: 'auto', + borderColor: 'inherit', borderWidth: 1, - // backgroundColor: 'auto', + // backgroundColor: 'inherit', formatter: '{value}%' }, } @@ -546,7 +546,7 @@ height: 12, fontSize: 12, color: '#fff', - backgroundColor: 'auto', + backgroundColor: 'inherit', borderRadius: 3, formatter: '{value}%' }, diff --git a/test/gauge-simple.html b/test/gauge-simple.html index 076e0af123..cbf4d865d6 100644 --- a/test/gauge-simple.html +++ b/test/gauge-simple.html @@ -190,19 +190,19 @@ pointer: { length: '80%', itemStyle: { - color: 'auto' + color: 'inherit' } }, axisTick: { length: 15, lineStyle: { - color: 'auto' + color: 'inherit' } }, splitLine: { length: 20, lineStyle: { - color: 'auto', + color: 'inherit', width: 5 } }, @@ -234,7 +234,7 @@ formatter: function(value) { return Math.round(value * 100) + '%'; }, - color: 'auto' + color: 'inherit' }, data: [{ value: 0.75, diff --git a/test/gauge.html b/test/gauge.html index 7e54c078fd..19b0a85f15 100644 --- a/test/gauge.html +++ b/test/gauge.html @@ -145,8 +145,8 @@ width: 30, height: 12, fontSize: 12, - color: 'auto', - borderColor: 'auto', + color: 'inherit', + borderColor: 'inherit', borderWidth: 1, borderRadius: 3, formatter: '{value}%', @@ -199,14 +199,14 @@ length :15, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle控制线条样式 - color: 'auto' + color: 'inherit' } }, splitLine: { // 分隔线 length :20, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: 'auto' + color: 'inherit' } }, axisLabel: { @@ -216,7 +216,7 @@ color: '#222', textBorderColor: '#fff', textBorderWidth: 2, - backgroundColor: 'auto', + backgroundColor: 'inherit', padding: [2, 4], borderRadius: 3 } @@ -263,7 +263,7 @@ rich: { a: { fontSize: 34, - color: 'auto', + color: 'inherit', }, b: { fontSize: 20, @@ -332,14 +332,14 @@ length :12, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle控制线条样式 - color: 'auto' + color: 'inherit' } }, splitLine: { // 分隔线 length :20, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: 'auto' + color: 'inherit' } }, pointer: { @@ -378,7 +378,7 @@ length :10, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle控制线条样式 - color: 'auto' + color: 'inherit' } }, axisLabel: { @@ -394,7 +394,7 @@ length :15, // 属性length控制线长 distance: 10, lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: 'auto' + color: 'inherit' } }, pointer: { @@ -439,7 +439,7 @@ splitLine: { // 分隔线 length :15, // 属性length控制线长 lineStyle: { // 属性lineStyle(详见lineStyle)控制线条样式 - color: 'auto' + color: 'inherit' } }, pointer: { diff --git a/test/graph-grid.html b/test/graph-grid.html index 85843850ec..75469d2473 100644 --- a/test/graph-grid.html +++ b/test/graph-grid.html @@ -53,7 +53,7 @@ value: val, label: { normal: { - borderColor: 'auto', + borderColor: 'inherit', borderWidth: 1, padding: 5, position: 'top' diff --git a/test/marker-case.html b/test/marker-case.html index a02e9e1f6e..0b5efb126b 100644 --- a/test/marker-case.html +++ b/test/marker-case.html @@ -39,6 +39,7 @@
+
@@ -143,7 +144,70 @@ option: option }); }); + + + - diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 8a4a0c0b36..46d6b8e41a 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -22,6 +22,7 @@ "bar-label-rotation": 2, "bar-large": 2, "bar-overflow-time-plot": 3, + "bar-polar-animation": 2, "bar-polar-clockwise": 1, "bar-polar-multi-series": 1, "bar-polar-multi-series-radial": 1, @@ -173,6 +174,7 @@ "stackBar-dataZoom": 7, "sunburst-book": 1, "sunburst-canvas": 1, + "svg-ssr": 1, "symbol": 1, "symbol2": 1, "themeRiver": 1, diff --git a/test/runTest/actions/bar-polar-animation.json b/test/runTest/actions/bar-polar-animation.json new file mode 100644 index 0000000000..1eb0c95558 --- /dev/null +++ b/test/runTest/actions/bar-polar-animation.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":430,"x":572,"y":200},{"type":"mousemove","time":629,"x":533,"y":202},{"type":"mousemove","time":829,"x":491,"y":213},{"type":"mousemove","time":1029,"x":477,"y":214},{"type":"mousemove","time":1229,"x":467,"y":218},{"type":"mousemove","time":1395,"x":467,"y":218},{"type":"mousemove","time":1595,"x":492,"y":204},{"type":"mousemove","time":1796,"x":538,"y":187},{"type":"mousemove","time":1996,"x":581,"y":227},{"type":"mousemove","time":2202,"x":531,"y":327},{"type":"mousemove","time":2412,"x":471,"y":348},{"type":"mousemove","time":2612,"x":456,"y":337},{"type":"mousemove","time":2812,"x":438,"y":320},{"type":"mousemove","time":3012,"x":432,"y":313},{"type":"mousemove","time":3212,"x":454,"y":340},{"type":"mousemove","time":3412,"x":502,"y":366},{"type":"mousemove","time":3612,"x":529,"y":376},{"type":"mousemove","time":3817,"x":532,"y":378}],"scrollY":0,"scrollX":0,"timestamp":1669801169309},{"name":"Action 2","ops":[{"type":"mousemove","time":287,"x":510,"y":358},{"type":"mousemove","time":488,"x":492,"y":365},{"type":"mousemove","time":703,"x":555,"y":353},{"type":"mousemove","time":903,"x":591,"y":351},{"type":"mousemove","time":1110,"x":593,"y":352}],"scrollY":317,"scrollX":0,"timestamp":1669801208534}] \ No newline at end of file diff --git a/test/runTest/actions/svg-ssr.json b/test/runTest/actions/svg-ssr.json new file mode 100644 index 0000000000..639333deb2 --- /dev/null +++ b/test/runTest/actions/svg-ssr.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":394,"x":138,"y":49},{"type":"mousedown","time":588,"x":113,"y":47},{"type":"mousemove","time":599,"x":113,"y":47},{"type":"mouseup","time":740,"x":113,"y":47},{"time":741,"delay":400,"type":"screenshot-auto"}],"scrollY":0,"scrollX":0,"timestamp":1670398010436}] \ No newline at end of file diff --git a/test/sunburst-label.html b/test/sunburst-label.html index f7b7c2cf87..51f2c14ef1 100644 --- a/test/sunburst-label.html +++ b/test/sunburst-label.html @@ -28,6 +28,7 @@ + @@ -37,6 +38,7 @@ +
@@ -112,6 +114,124 @@ }); + + diff --git a/test/svg-ssr.html b/test/svg-ssr.html new file mode 100644 index 0000000000..af9a4dab77 --- /dev/null +++ b/test/svg-ssr.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + diff --git a/test/tooltip-alwaysShowContent.html b/test/tooltip-alwaysShowContent.html new file mode 100644 index 0000000000..67a1ea3f1b --- /dev/null +++ b/test/tooltip-alwaysShowContent.html @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + +

alwaysShowContent: true

+
+ + +

alwaysShowContent: true, renderMode: "richText", triggerOn: 'click',

+
+ + + + + + + +