From bd767e20f0fc8ba227e3c430ac529d107ab6fe32 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 30 Nov 2022 16:46:33 +0800 Subject: [PATCH 01/33] fix(polar): support borderRadius for polar bars #17980 --- src/chart/bar/BarSeries.ts | 4 +- src/chart/bar/BarView.ts | 23 +++- src/chart/helper/pieHelper.ts | 41 ------- src/chart/pie/PieView.ts | 2 +- src/chart/sunburst/SunburstPiece.ts | 2 +- test/bar-polar-borderRadius.html | 180 ++++++++++++++++++++++++++++ 6 files changed, 204 insertions(+), 48 deletions(-) delete mode 100644 src/chart/helper/pieHelper.ts create mode 100644 test/bar-polar-borderRadius.html 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..346f3d9da5 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; @@ -338,7 +341,7 @@ class BarView extends ChartView { } 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; @@ -971,7 +974,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 +985,20 @@ 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 sector = el as Sector; + const sectorShape = (el as Sector).shape; + const cornerRadius = getSectorCornerRadius( + itemModel.getModel('itemStyle'), + sectorShape, + true + ); + extend(sectorShape, cornerRadius); + sector.setShape(sectorShape); } el.useStyle(style); diff --git a/src/chart/helper/pieHelper.ts b/src/chart/helper/pieHelper.ts deleted file mode 100644 index e55ded398b..0000000000 --- a/src/chart/helper/pieHelper.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* -* 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. -*/ - -import type Model from '../../model/Model'; -import type Sector from 'zrender/src/graphic/shape/Sector'; -import { isArray, map } from 'zrender/src/core/util'; -import { parsePercent } from 'zrender/src/contain/text'; - -export function getSectorCornerRadius( - model: Model<{ borderRadius?: string | number | (string | number)[] }>, - shape: Pick, - zeroIfNull?: boolean -) { - let cornerRadius = model.get('borderRadius'); - if (cornerRadius == null) { - return zeroIfNull ? { cornerRadius: 0 } : null; - } - if (!isArray(cornerRadius)) { - cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; - } - const dr = Math.abs(shape.r || 0 - shape.r0 || 0); - return { - cornerRadius: map(cornerRadius, cr => parsePercent(cr, dr)) - }; -} 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..8c7be8c1a7 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -28,7 +28,7 @@ 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'; diff --git a/test/bar-polar-borderRadius.html b/test/bar-polar-borderRadius.html new file mode 100644 index 0000000000..9fbf9e973a --- /dev/null +++ b/test/bar-polar-borderRadius.html @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + From 566743232967d95ea3a7b0ac688076f402db9ee7 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 30 Nov 2022 16:50:55 +0800 Subject: [PATCH 02/33] fix(polar): forgot to commit a new file --- src/chart/helper/sectorHelper.ts | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/chart/helper/sectorHelper.ts diff --git a/src/chart/helper/sectorHelper.ts b/src/chart/helper/sectorHelper.ts new file mode 100644 index 0000000000..e55ded398b --- /dev/null +++ b/src/chart/helper/sectorHelper.ts @@ -0,0 +1,41 @@ +/* +* 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. +*/ + +import type Model from '../../model/Model'; +import type Sector from 'zrender/src/graphic/shape/Sector'; +import { isArray, map } from 'zrender/src/core/util'; +import { parsePercent } from 'zrender/src/contain/text'; + +export function getSectorCornerRadius( + model: Model<{ borderRadius?: string | number | (string | number)[] }>, + shape: Pick, + zeroIfNull?: boolean +) { + let cornerRadius = model.get('borderRadius'); + if (cornerRadius == null) { + return zeroIfNull ? { cornerRadius: 0 } : null; + } + if (!isArray(cornerRadius)) { + cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius]; + } + const dr = Math.abs(shape.r || 0 - shape.r0 || 0); + return { + cornerRadius: map(cornerRadius, cr => parsePercent(cr, dr)) + }; +} From 4fad608487e428c0594fc4555907cc9f622ffb22 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Wed, 30 Nov 2022 17:48:38 +0800 Subject: [PATCH 03/33] fix(polar): polar bar animation should start from r0 rather than 0 --- src/chart/bar/BarView.ts | 2 +- src/chart/sunburst/SunburstPiece.ts | 2 +- test/bar-polar-animation.html | 131 ++++++++++++++++++ test/runTest/actions/__meta__.json | 1 + test/runTest/actions/bar-polar-animation.json | 1 + 5 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 test/bar-polar-animation.html create mode 100644 test/runTest/actions/bar-polar-animation.json diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 0de06c481f..5445a1defc 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -803,7 +803,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 diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 873a686f17..91ac0f4559 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -116,7 +116,7 @@ class SunburstPiece extends graphic.Sector { if (firstCreate) { sector.setShape(sectorShape); sector.shape.r = layout.r0; - graphic.updateProps( + graphic.initProps( sector, { shape: { 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/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 8a4a0c0b36..812e7da82d 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, 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 From d78340592ba871c6fc72189a3c2f496eab0a8ac5 Mon Sep 17 00:00:00 2001 From: Telat Kaya Date: Fri, 2 Dec 2022 17:05:29 +0300 Subject: [PATCH 04/33] feat(i18n): add Turkish(TR) translation (#18012) --- src/i18n/langTR.ts | 142 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 src/i18n/langTR.ts diff --git a/src/i18n/langTR.ts b/src/i18n/langTR.ts new file mode 100644 index 0000000000..c3b40d14f5 --- /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: '. ' + } + } + } +}; From 45a06897879baa99c3d0ff6a9f5cace4c9a93bec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 4 Dec 2022 23:55:48 +0000 Subject: [PATCH 05/33] chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0961bebd50..ab1b3a7df0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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" @@ -16784,9 +16784,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": { From 47b6407f9b89358899dd78244d44040728241c04 Mon Sep 17 00:00:00 2001 From: plainheart Date: Wed, 7 Dec 2022 15:30:40 +0800 Subject: [PATCH 06/33] fix(ssr): fix label doesn't show in line series when `ssr` is enabled.` --- src/chart/line/LineView.ts | 14 ++-- test/runTest/actions/__meta__.json | 1 + test/runTest/actions/svg-ssr.json | 1 + test/svg-ssr.html | 122 +++++++++++++++++++++++++++++ 4 files changed, 131 insertions(+), 7 deletions(-) create mode 100644 test/runTest/actions/svg-ssr.json create mode 100644 test/svg-ssr.html 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/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 8a4a0c0b36..e44e384566 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -173,6 +173,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/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/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 @@ + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + From 0707a15b43ab14dc84ec918dad6c7f497f42661d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Dec 2022 16:55:59 +0000 Subject: [PATCH 07/33] chore(deps): bump qs from 6.5.2 to 6.5.3 Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b9a71b9452..a6e04cdd92 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10565,9 +10565,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" @@ -21887,9 +21887,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": { From b0eeb4192d81058b02cd8a36d81da727bb343f86 Mon Sep 17 00:00:00 2001 From: neostfox Date: Mon, 12 Dec 2022 11:47:40 +0800 Subject: [PATCH 08/33] chore(deps-dev): bump terser from 5.3.8 to 5.14.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } From a9330a130d20550ec0bf4bb0a60b583aae968064 Mon Sep 17 00:00:00 2001 From: plainheart Date: Mon, 12 Dec 2022 15:27:33 +0800 Subject: [PATCH 09/33] chore: update package-lock.json --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index a6e04cdd92..9e2440ff26 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" } @@ -12264,9 +12264,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", @@ -23302,9 +23302,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", From a29290ad7748d9e3e864445ab81629c3279187b5 Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Wed, 14 Dec 2022 01:21:49 +0100 Subject: [PATCH 10/33] chore: fix several typos --- src/component/axisPointer/BaseAxisPointer.ts | 8 ++++---- src/component/axisPointer/axisTrigger.ts | 6 +++--- src/component/axisPointer/modelHelper.ts | 8 ++++---- src/component/axisPointer/viewHelper.ts | 2 +- src/component/dataZoom/SliderZoomView.ts | 4 ++-- src/component/helper/BrushController.ts | 12 ++++++------ src/component/helper/BrushTargetManager.ts | 4 ++-- src/component/helper/MapDraw.ts | 8 ++++---- src/component/toolbox/ToolboxView.ts | 4 ++-- src/component/tooltip/TooltipView.ts | 6 +++--- src/component/tooltip/seriesFormatTooltip.ts | 4 ++-- src/component/tooltip/tooltipMarkup.ts | 4 ++-- src/component/visualMap/ContinuousModel.ts | 4 ++-- src/component/visualMap/ContinuousView.ts | 8 ++++---- src/component/visualMap/PiecewiseModel.ts | 4 ++-- src/component/visualMap/VisualMapModel.ts | 4 ++-- 16 files changed, 45 insertions(+), 45 deletions(-) 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/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/TooltipView.ts b/src/component/tooltip/TooltipView.ts index f99d863811..e64c2d19d4 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -745,8 +745,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 +1091,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/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 From 4b4a732aea9771e59fc9b1d84ac258dae33949e8 Mon Sep 17 00:00:00 2001 From: Catalin Cheptea Date: Thu, 15 Dec 2022 22:43:38 +0200 Subject: [PATCH 11/33] fix(tree): change symbol type. close #17946 --- src/chart/tree/TreeSeries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' From 1c579089c4c450a825ddff43fe438f657084652b Mon Sep 17 00:00:00 2001 From: Dirk Stolle Date: Sun, 25 Dec 2022 14:30:21 +0100 Subject: [PATCH 12/33] chore: fix a few typos --- src/component/axis/AxisBuilder.ts | 4 ++-- src/component/transform/filterTransform.ts | 8 ++++---- src/model/Series.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) 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/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/model/Series.ts b/src/model/Series.ts index e2a5577b9e..158174c75f 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 From c5eb4fa28b44f1724b2956d476259614fd2f2e54 Mon Sep 17 00:00:00 2001 From: huangyulie <1279072972@qq.com> Date: Tue, 27 Dec 2022 18:11:39 +0200 Subject: [PATCH 13/33] upload example --- test/gauge-distance.html | 14 +++++++------- test/gauge-group-title-detail.html | 20 ++++++++++---------- test/gauge-simple.html | 8 ++++---- test/gauge.html | 22 +++++++++++----------- test/graph-grid.html | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) 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' From c91620ee36732a82b72bbc8b7c610ddf480d7683 Mon Sep 17 00:00:00 2001 From: Zhongxiang Wang Date: Sat, 31 Dec 2022 18:54:00 +0800 Subject: [PATCH 14/33] chore: update notice year to 2023 --- NOTICE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/). From 3e22c04d68f827fcac137507513899ec6c32f9ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:45:40 +0000 Subject: [PATCH 15/33] chore(deps): bump json5 from 2.1.3 to 2.2.3 Bumps [json5](https://github.com/json5/json5) from 2.1.3 to 2.2.3. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v2.1.3...v2.2.3) --- updated-dependencies: - dependency-name: json5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9e2440ff26..6cb83c5c63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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" }, @@ -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", From 2d8bc8f29f984cde410d655bf569e698516feebb Mon Sep 17 00:00:00 2001 From: AMAN SINGH <89124765+Aman1919@users.noreply.github.com> Date: Mon, 23 Jan 2023 23:21:18 +0530 Subject: [PATCH 16/33] chore: fix few typos (#18203) --- src/data/DataStore.ts | 6 +++--- src/data/Graph.ts | 2 +- src/legacy/dataSelectAction.ts | 2 +- src/model/Series.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) 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/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 158174c75f..89be20c7d1 100644 --- a/src/model/Series.ts +++ b/src/model/Series.ts @@ -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); } From 6af586f691cd3e2cc2c32c9b7fc4a49857075d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B5=A9=E7=84=B6?= Date: Wed, 1 Feb 2023 18:54:31 +0800 Subject: [PATCH 17/33] (tooltip): fix alwaysShowContent doesn't work after leaving the tooltip . close #18111 --- src/component/tooltip/TooltipHTMLContent.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts index 02496857b0..3dcfc3761c 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 @@ -336,7 +337,7 @@ class TooltipHTMLContent { self._inContent = false; if (self._enterable) { - if (self._show) { + if (self._show && !self._alwaysShowContent) { self.hideLater(self._hideDelay); } } @@ -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') || ''; From 376e45580a995d67291f1e9c5865e979e4cd509c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B5=A9=E7=84=B6?= Date: Thu, 2 Feb 2023 16:21:16 +0800 Subject: [PATCH 18/33] (tooltip): fix alwaysShowContent doesn't work after leaving the tooltip . close #18111 --- src/component/tooltip/TooltipHTMLContent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component/tooltip/TooltipHTMLContent.ts b/src/component/tooltip/TooltipHTMLContent.ts index 3dcfc3761c..b326acd091 100644 --- a/src/component/tooltip/TooltipHTMLContent.ts +++ b/src/component/tooltip/TooltipHTMLContent.ts @@ -337,7 +337,7 @@ class TooltipHTMLContent { self._inContent = false; if (self._enterable) { - if (self._show && !self._alwaysShowContent) { + if (self._show) { self.hideLater(self._hideDelay); } } @@ -492,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 From ac64e3f1c0a009c404e0f33454a9e38964426537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B5=A9=E7=84=B6?= Date: Thu, 2 Feb 2023 17:23:42 +0800 Subject: [PATCH 19/33] (tooltip): fix alwaysShowContent doesn't work after leaving the tooltip . close #18111 --- src/component/tooltip/TooltipRichContent.ts | 7 +- src/component/tooltip/TooltipView.ts | 6 +- test/tooltip-alwaysShowContent.html | 265 ++++++++++++++++++++ 3 files changed, 274 insertions(+), 4 deletions(-) create mode 100644 test/tooltip-alwaysShowContent.html 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 e64c2d19d4..e9865f3f64 100644 --- a/src/component/tooltip/TooltipView.ts +++ b/src/component/tooltip/TooltipView.ts @@ -147,7 +147,7 @@ class TooltipView extends ComponentView { private _api: ExtensionAPI; - private _alwaysShowContent: boolean; + // private _alwaysShowContent: boolean; private _tooltipContent: TooltipHTMLContent | TooltipRichContent; @@ -200,7 +200,7 @@ class TooltipView extends ComponentView { * @private * @type {boolean} */ - this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); + // this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); const tooltipContent = this._tooltipContent; tooltipContent.update(tooltipModel); @@ -396,7 +396,7 @@ class TooltipView extends ComponentView { ) { const tooltipContent = this._tooltipContent; - if (!this._alwaysShowContent && this._tooltipModel) { + if (this._tooltipModel) { tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); } 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',

+
+ + + + + + + + From 8401d1abedbea13206016898db2e8669b2e781c2 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Thu, 2 Feb 2023 18:23:54 +0800 Subject: [PATCH 20/33] fix(markArea): markArea range in bar series #18130 --- src/chart/bar/BaseBarSeries.ts | 71 ++++++- test/bar-markArea.html | 326 ++++++++++++++++++++++++++++++++- 2 files changed, 388 insertions(+), 9 deletions(-) diff --git a/src/chart/bar/BaseBarSeries.ts b/src/chart/bar/BaseBarSeries.ts index bff11b8837..d9349ac2e6 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') { 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 (dims && 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/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 @@
- +
+
+
+
+
+ + + + + + + + + - From 9335a76cfba0c1fc902bb32883b1590bc7019aa9 Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Sat, 4 Feb 2023 15:35:21 +0800 Subject: [PATCH 21/33] fix(sunburst): `radial` rotation label might upside down --- src/chart/sunburst/SunburstPiece.ts | 2 +- test/sunburst-label.html | 99 +++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 91ac0f4559..4f1b1fab90 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -252,7 +252,7 @@ class SunburstPiece extends graphic.Sector { let rotate = 0; if (rotateType === 'radial') { rotate = -midAngle; - if (rotate < -Math.PI / 2) { + if (rotate < -Math.PI / 2 || rotate > Math.PI / 2) { rotate += Math.PI; } } diff --git a/test/sunburst-label.html b/test/sunburst-label.html index f7b7c2cf87..cc3d7be262 100644 --- a/test/sunburst-label.html +++ b/test/sunburst-label.html @@ -38,6 +38,7 @@
+
@@ -112,6 +113,104 @@ }); + + From 8120aaba4b523e8dee1aca0f8089d36c5096f0e5 Mon Sep 17 00:00:00 2001 From: Shaheer Ahmad <110221120+Shaheer-Ahmd@users.noreply.github.com> Date: Sun, 5 Feb 2023 17:24:16 +0500 Subject: [PATCH 22/33] docs: fix a lot of grammatical errors in CONTRIBUTING.md (#18244) * Made some grammatical changes in the Readme.md Files * Fixed Grammatical errors in CONTRIBUTING.md --- CONTRIBUTING.md | 24 ++++++++++++------------ README.md | 8 ++++---- 2 files changed, 16 insertions(+), 16 deletions(-) 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/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 From da29a8d28cd096f1efe83006687a91c8501dd722 Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Thu, 16 Feb 2023 00:13:03 +0800 Subject: [PATCH 23/33] fix(dataset): object source contains `length` breaks render --- src/data/Source.ts | 8 ++------ test/dataset-category.html | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 6 deletions(-) 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/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 @@ + From fc2be1895c357f00020061273fdb383afaabcc99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nghi=E1=BB=87p?= Date: Thu, 16 Feb 2023 16:10:55 +0700 Subject: [PATCH 24/33] feat(i18n): add Vietnamese(vi_VN) translation (#18279) * feat(i18n): add Vietnamese(vi_VN) translation * style(i18n): use single quote instead of double quotes * style(i18n): fix style flaw in copyright header comment --------- Co-authored-by: plainheart --- src/i18n/langCS.ts | 36 ++++----- src/i18n/langDE.ts | 36 ++++----- src/i18n/langEN.ts | 34 ++++----- src/i18n/langFR.ts | 34 ++++----- src/i18n/langHU.ts | 34 ++++----- src/i18n/langIT.ts | 34 ++++----- src/i18n/langJA.ts | 34 ++++----- src/i18n/langKO.ts | 34 ++++----- src/i18n/langPL.ts | 34 ++++----- src/i18n/langPT-br.ts | 34 ++++----- src/i18n/langRO.ts | 34 ++++----- src/i18n/langSI.ts | 36 ++++----- src/i18n/langTR.ts | 34 ++++----- src/i18n/langVI.ts | 167 ++++++++++++++++++++++++++++++++++++++++++ src/i18n/langZH.ts | 2 +- 15 files changed, 392 insertions(+), 225 deletions(-) create mode 100644 src/i18n/langVI.ts 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 index c3b40d14f5..f984abcd71 100644 --- a/src/i18n/langTR.ts +++ b/src/i18n/langTR.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: Türkçe. 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 +}; From 3941fc9d21564fed9e8e0cc2e479c19c8d0c05fd Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Fri, 17 Feb 2023 21:52:38 +0800 Subject: [PATCH 25/33] fix(sunburst): adjust label rotation --- src/chart/sunburst/SunburstPiece.ts | 5 +++-- test/sunburst-label.html | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 4f1b1fab90..0b5760ef30 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -32,6 +32,7 @@ import { getSectorCornerRadius } from '../helper/pieHelper'; 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; @@ -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 > Math.PI / 2) { + rotate = normalizeRadian(-midAngle); + if (((rotate > Math.PI / 2 && rotate <= Math.PI) || (rotate > Math.PI && rotate <= Math.PI * 1.5))) { rotate += Math.PI; } } diff --git a/test/sunburst-label.html b/test/sunburst-label.html index cc3d7be262..0c775cc4ff 100644 --- a/test/sunburst-label.html +++ b/test/sunburst-label.html @@ -28,6 +28,7 @@ + @@ -37,8 +38,8 @@ -
+
@@ -188,7 +189,7 @@ option = { series: { type: 'sunburst', - startAngle: 180, + startAngle: 0, // emphasis: { // focus: 'ancestor' // }, @@ -201,13 +202,29 @@ }; var chart = testHelper.create(echarts, 'main1', { title: [ - 'Put label in the center if it\'s a circle' + 'Label rotation under different startAngle ' ], - option: option - // height: 300, + option: option, + height: 600, // buttons: [{text: 'btn-txt', onclick: function () {}}], // recordCanvas: true, }); + + var config = { + startAngle: 0 + }; + + function update() { + chart.setOption({ + series: [{ + startAngle: config.startAngle + }] + }); + } + + var gui = new dat.GUI(); + gui.add(config, 'startAngle', 0, 360) + .onChange(update); }); From 19c3c9d453eb900ed2ae4e7d7933e27466b1b72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=B5=A9=E7=84=B6?= Date: Tue, 21 Feb 2023 10:43:46 +0800 Subject: [PATCH 26/33] (tooltip): fix alwaysShowContent doesn't work after leaving the tooltip . close #18111 --- src/component/tooltip/TooltipView.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/component/tooltip/TooltipView.ts b/src/component/tooltip/TooltipView.ts index e9865f3f64..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')); From c206dc33dc08355373320ea718dd96c06e9c4d41 Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Wed, 22 Feb 2023 21:58:35 +0800 Subject: [PATCH 27/33] chore: simplify code --- src/chart/sunburst/SunburstPiece.ts | 2 +- test/sunburst-label.html | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/chart/sunburst/SunburstPiece.ts b/src/chart/sunburst/SunburstPiece.ts index 0b5760ef30..6bd8f597e7 100644 --- a/src/chart/sunburst/SunburstPiece.ts +++ b/src/chart/sunburst/SunburstPiece.ts @@ -253,7 +253,7 @@ class SunburstPiece extends graphic.Sector { let rotate = 0; if (rotateType === 'radial') { rotate = normalizeRadian(-midAngle); - if (((rotate > Math.PI / 2 && rotate <= Math.PI) || (rotate > Math.PI && rotate <= Math.PI * 1.5))) { + if (((rotate > Math.PI / 2 && rotate <= Math.PI * 1.5))) { rotate += Math.PI; } } diff --git a/test/sunburst-label.html b/test/sunburst-label.html index 0c775cc4ff..51f2c14ef1 100644 --- a/test/sunburst-label.html +++ b/test/sunburst-label.html @@ -211,13 +211,15 @@ }); var config = { - startAngle: 0 + startAngle: 0, + clockwise: true }; function update() { chart.setOption({ series: [{ - startAngle: config.startAngle + startAngle: config.startAngle, + clockwise: config.clockwise }] }); } @@ -225,6 +227,8 @@ var gui = new dat.GUI(); gui.add(config, 'startAngle', 0, 360) .onChange(update); + gui.add(config, 'clockwise') + .onChange(update); }); From 6d1f49149fbbe928ae879e213bcb01494f70fd18 Mon Sep 17 00:00:00 2001 From: lathesky <43309591+fullmooooon@users.noreply.github.com> Date: Thu, 23 Feb 2023 19:19:59 +0800 Subject: [PATCH 28/33] chore: ignore files about 'contributing' when publishing to npm (#18301) --- .npmignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 +.* From a208201173c3340e66f77a2c5145fa03f1067278 Mon Sep 17 00:00:00 2001 From: plainheart Date: Sat, 25 Feb 2023 17:20:49 +0800 Subject: [PATCH 29/33] fix(type): fix `treePathInfo` is missing in the type of sunburst formatter callback & add missing type definition for the `data` option --- src/chart/sunburst/SunburstSeries.ts | 16 ++++++++++------ src/util/types.ts | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) 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/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 } /** From d5ea9373cc54de245a10cd3e393994e8de643218 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 27 Feb 2023 14:55:57 +0800 Subject: [PATCH 30/33] fix(markArea): fix situations when dims is not defined --- src/chart/bar/BaseBarSeries.ts | 4 ++-- src/component/marker/markerHelper.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chart/bar/BaseBarSeries.ts b/src/chart/bar/BaseBarSeries.ts index d9349ac2e6..81d3415202 100644 --- a/src/chart/bar/BaseBarSeries.ts +++ b/src/chart/bar/BaseBarSeries.ts @@ -99,13 +99,13 @@ class BaseBarSeriesModel = BaseBarSeri 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 targetTickId = clampData[idx]; // The index of rightmost tick of markArea is 1 larger than x1/y1 index const isEnd = dims[idx] === 'x1' || dims[idx] === 'y1'; - if (dims && isEnd) { + if (isEnd) { targetTickId += 1; } diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index 2777b137f4..a0e648f661 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?.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 { From 710e79d92691689c91f35393fd56234f8b133790 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Fri, 3 Mar 2023 15:09:14 +0800 Subject: [PATCH 31/33] test: add test case for markers --- test/marker-case.html | 66 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) 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 }); }); + + + - From dca62c973b4d8e09ac722334ac01920d04e5bbe2 Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 6 Mar 2023 15:38:27 +0800 Subject: [PATCH 32/33] feat: support bar background borderRadius --- src/chart/bar/BarView.ts | 9 +++++++-- test/bar-polar-borderRadius.html | 12 ++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts index 346f3d9da5..63120dda72 100644 --- a/src/chart/bar/BarView.ts +++ b/src/chart/bar/BarView.ts @@ -246,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; }; @@ -337,6 +340,9 @@ 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); @@ -990,7 +996,6 @@ function updateStyle( (el as Rect).setShape('r', borderRadius); } else if (!seriesModel.get('roundCap')) { - const sector = el as Sector; const sectorShape = (el as Sector).shape; const cornerRadius = getSectorCornerRadius( itemModel.getModel('itemStyle'), @@ -998,7 +1003,7 @@ function updateStyle( true ); extend(sectorShape, cornerRadius); - sector.setShape(sectorShape); + (el as Sector).setShape(sectorShape); } el.useStyle(style); diff --git a/test/bar-polar-borderRadius.html b/test/bar-polar-borderRadius.html index 9fbf9e973a..2bdc1b0146 100644 --- a/test/bar-polar-borderRadius.html +++ b/test/bar-polar-borderRadius.html @@ -67,6 +67,10 @@ series: [{ type: 'bar', data: [2, -1, 3], + showBackground: true, + backgroundStyle: { + borderRadius: [5, 10, 20, 30] + }, itemStyle: { borderRadius: [5, 10, 20, 30] }, @@ -109,6 +113,10 @@ series: [{ type: 'bar', data: [2, -1, 3], + showBackground: true, + backgroundStyle: { + borderRadius: [10, 20] + }, itemStyle: { borderRadius: [10, 20] }, @@ -156,6 +164,10 @@ borderRadius: [20, 5] } }, -1, 3], + showBackground: true, + backgroundStyle: { + borderRadius: [20, 5] + }, itemStyle: { borderRadius: 10 }, From e02ca3816eb0d7de1bb4609dd638b6537e1e950b Mon Sep 17 00:00:00 2001 From: Ovilia Date: Mon, 6 Mar 2023 15:40:14 +0800 Subject: [PATCH 33/33] style(marker): improve code --- src/component/marker/markerHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index a0e648f661..f5e5b7ddf3 100644 --- a/src/component/marker/markerHelper.ts +++ b/src/component/marker/markerHelper.ts @@ -105,7 +105,7 @@ 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`,