(echarts) branch master updated (bb12cee67 -> 869ec5e3d)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from bb12cee67 Merge pull request #20380 from sz-p/fix-20336 add bc065fd0c test(pictorial): add test case when value is 0 add fd51f71d8 fix(pictorialBar): symbol should not flip with zero data #20260 add 65ac3c3c9 style(pictorialBar): remove console log add 869ec5e3d Merge pull request #20300 from apache/fix-pictorial-zero No new revisions were added by this update. Summary of changes: src/chart/bar/PictorialBarView.ts | 2 +- test/pictorial-zero-value.html| 54 +++ 2 files changed, 55 insertions(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix-pictorial-zero deleted (was 65ac3c3c9)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-pictorial-zero in repository https://gitbox.apache.org/repos/asf/echarts.git was 65ac3c3c9 style(pictorialBar): remove console log The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) branch main updated: feat(stage): add dist
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 1969317 feat(stage): add dist 1969317 is described below commit 19693178b8d7f2e4f2020db2ce5c6ce8ee8ed029 Author: Ovilia AuthorDate: Mon Sep 30 14:07:03 2024 +0800 feat(stage): add dist --- custom-series/stage/dist/index.js | 201 +- custom-series/stage/dist/index.min.js | 2 +- custom-series/stage/dist/index.min.js.map | 2 +- 3 files changed, 198 insertions(+), 7 deletions(-) diff --git a/custom-series/stage/dist/index.js b/custom-series/stage/dist/index.js index 8691357..2bbb0ff 100644 --- a/custom-series/stage/dist/index.js +++ b/custom-series/stage/dist/index.js @@ -17,17 +17,208 @@ * under the License. */ (function (global, factory) { -typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : -typeof define === 'function' && define.amd ? define(factory) : -(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.stageCustomSeriesInstaller = factory()); -})(this, (function () { 'use strict'; +typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('echarts')) : +typeof define === 'function' && define.amd ? define(['echarts'], factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.stageCustomSeriesInstaller = factory(global.echarts)); +})(this, (function (echarts) { 'use strict'; var renderItem = function (params, api) { +var _a; +var start = api.value(0); +var end = api.value(1); +var stageIndex = api.value(2); +var startCoord = api.coord([start, stageIndex]); +var endCoord = api.coord([end, stageIndex]); +var bandWidth = api.coord([0, 0])[1] - api.coord([0, 1])[1]; +var fontSize = 14; +var textMargin = 5; +var color = api.visual('color'); +var itemPayload = params.itemPayload; +var itemStyle = itemPayload.itemStyle || {}; +var borderRadius = itemStyle.borderRadius || 8; +var externalRadius = echarts.zrUtil.retrieve2((_a = itemPayload.envelope) === null || _a === void 0 ? void 0 : _a.externalRadius, 6); +var barVerticalMargin = echarts.zrUtil.retrieve2(itemStyle.verticalMargin, 8); +var barMinWidth = echarts.zrUtil.retrieve2(itemStyle.minHorizontalSize, 3); +var children = []; +var boxes = params.context.boxes || []; +var span = endCoord[0] - startCoord[0]; +var height = Math.max(span, barMinWidth); +var shape = { +x: startCoord[0] - (height - span) / 2, +y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barVerticalMargin, +width: height, +height: bandWidth - fontSize - textMargin - 2 * barVerticalMargin, +}; +children.push({ +type: 'rect', +shape: { +x: shape.x, +y: shape.y, +width: shape.width, +height: shape.height, +r: borderRadius, +}, +style: { +fill: color, +}, +}); +boxes.push(shape); +params.context.boxes = boxes; +if (!params.context.renderedStages) { +params.context.renderedStages = []; +} +var renderedStages = params.context.renderedStages; +if (!renderedStages[stageIndex]) { +var axisLabel = itemPayload.axisLabel || {}; +var text = api.ordinalRawValue(2); +if (typeof axisLabel.formatter === 'function') { +text = axisLabel.formatter(text, stageIndex); +} +children.push({ +type: 'text', +style: { +x: params.coordSys.x + textMargin, +y: startCoord[1] - bandWidth / 2 + textMargin + fontSize, +fill: axisLabel.color || '#8A8A8A', +text: text, +verticalAlign: 'bottom', +}, +}); +renderedStages[stageIndex] = true; +} +if (params.dataIndex === params.dataInsideLength - 1) { +var allColors = []; +for (var i = 0; i < params.dataInsideLength; i++) { +var color_1 = api.visual('color', i); +if (allColors.indexOf(color_1) < 0) { +allColors.push(color_1); +} +} +
(echarts-custom-series) branch main updated: feat(stage): complete stage chart
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new eb08a50 feat(stage): complete stage chart eb08a50 is described below commit eb08a502b6cb48222b0b1099a159e12b2a209048 Author: Ovilia AuthorDate: Sun Sep 29 17:07:00 2024 +0800 feat(stage): complete stage chart --- custom-series/stage/src/index.ts| 157 custom-series/stage/test/index.html | 52 +--- 2 files changed, 144 insertions(+), 65 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 13e6e61..71eb248 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -17,7 +17,7 @@ * under the License. */ -import echarts from 'echarts'; +import echarts, { zrUtil } from 'echarts'; import type { CustomElementOption, CustomRootElementOption, @@ -25,12 +25,31 @@ import type { } from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; import type { EChartsExtensionInstallRegisters } from 'echarts/src/extension.ts'; -type Envelope = { +interface Envelope { show?: boolean; color?: 'auto' | string; + externalRadius?: number; opacity?: number; margin?: number; -}; + dpr?: number; +} + +interface ItemStyle { + borderRadius?: number; + verticalMargin?: number; + minHorizontalSize?: number; +} + +interface AxisLabel { + color?: string; + formatter?: (value: string, index: number) => string; +} + +interface StageItemPayload { + itemStyle?: ItemStyle; + axisLabel?: AxisLabel; + envelope?: Envelope; +} const renderItem = ( params: echarts.CustomSeriesRenderItemParams, @@ -46,10 +65,22 @@ const renderItem = ( const bandWidth = api.coord([0, 0])[1] - api.coord([0, 1])[1]; const fontSize = 14; const textMargin = 5; - const barMargin = 8; const color = api.visual('color'); - const borderRadius = (params.itemPayload.borderRadius as number) || 8; - const barMinHeight = 2; + const itemPayload = params.itemPayload as StageItemPayload; + const itemStyle = itemPayload.itemStyle || {}; + const borderRadius = itemStyle.borderRadius || 8; + const externalRadius = zrUtil.retrieve2( +itemPayload.envelope?.externalRadius, +6 + ) as number; + const barVerticalMargin = zrUtil.retrieve2( +itemStyle.verticalMargin, +8 + ) as number; + const barMinWidth = zrUtil.retrieve2( +itemStyle.minHorizontalSize, +3 + ) as number; const children: CustomElementOption[] = []; const boxes: { x: number; y: number; width: number; height: number }[] = @@ -61,12 +92,13 @@ const renderItem = ( }[]) || []; const span = endCoord[0] - startCoord[0]; - const height = Math.max(span, barMinHeight); + const height = Math.max(span, barMinWidth); const shape = { x: startCoord[0] - (height - span) / 2, -y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, +y: + startCoord[1] - bandWidth / 2 + textMargin + fontSize + barVerticalMargin, width: height, -height: bandWidth - fontSize - textMargin - 2 * barMargin, +height: bandWidth - fontSize - textMargin - 2 * barVerticalMargin, }; children.push({ type: 'rect', @@ -89,14 +121,19 @@ const renderItem = ( } const renderedStages = params.context.renderedStages as boolean[]; if (!renderedStages[stageIndex]) { +const axisLabel: AxisLabel = itemPayload.axisLabel || {}; +let text = api.ordinalRawValue(2) as string; +if (typeof axisLabel.formatter === 'function') { + text = axisLabel.formatter(text, stageIndex as number); +} // Each stage only render once as axis label children.push({ type: 'text', style: { x: (params.coordSys as any).x + textMargin, y: startCoord[1] - bandWidth / 2 + textMargin + fontSize, -fill: (params.itemPayload.axisLabelColor as string) || '#777', -text: api.ordinalRawValue(2) as string, +fill: axisLabel.color || '#8A8A8A', +text, verticalAlign: 'bottom', }, }); @@ -107,51 +144,58 @@ const renderItem = ( if (params.dataIndex === params.dataInsideLength - 1) { const allColors: string[] = []; for (let i = 0; i < params.dataInsideLength; i++) { - allColors.push(api.visual('color', i) as string); + const color = api.visual('color', i) as string; + if (allColors.indexOf(color) < 0) { +allColors.push(color); + } } -const envelope: Envelope = params.itemPayload.envelope || {}; +const envelope: Envelope = itemPayload.envelope || {}; if (envelope.show !== false && boxes.length > 1) { - const margin = echarts.zrUt
(echarts-custom-series) branch main updated: WIP(stage): using offline canvas
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 329543d WIP(stage): using offline canvas 329543d is described below commit 329543dd881fb1394fa275bbbd3ad066f1a5ee03 Author: Ovilia AuthorDate: Thu Sep 26 18:16:01 2024 +0800 WIP(stage): using offline canvas --- custom-series/stage/src/index.ts| 273 custom-series/stage/test/index.html | 4 +- 2 files changed, 156 insertions(+), 121 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 35522d0..13e6e61 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -105,6 +105,11 @@ const renderItem = ( // If is the last item, render envelope if (params.dataIndex === params.dataInsideLength - 1) { +const allColors: string[] = []; +for (let i = 0; i < params.dataInsideLength; i++) { + allColors.push(api.visual('color', i) as string); +} + const envelope: Envelope = params.itemPayload.envelope || {}; if (envelope.show !== false && boxes.length > 1) { const margin = echarts.zrUtil.retrieve2(envelope.margin as number, 5); @@ -113,138 +118,137 @@ const renderItem = ( boxes.sort((a, b) => a.x - b.x || a.y - b.y); console.log(boxes); - // Top-left of the first box - const firstBox = boxes[0]; - const firstRadius = -Math.min(firstBox.height, Math.min(firstBox.width, borderRadius * 2)) / - 2 + -margin; - let path: string = `M ${firstBox.x - margin} ${ -firstBox.y - margin + firstRadius - }`; - for (let i = 0; i < boxes.length - 1; i++) { -const box = boxes[i]; -const innerRadius = - Math.min(box.height, Math.min(box.width, borderRadius * 2)) / 2; -const radius = innerRadius + margin; -const nextBox = boxes[i + 1]; + const canvas = document.createElement('canvas'); + const coordSys = params.coordSys as any; + const dpr = window.devicePixelRatio || 1; + const canvasWidth = coordSys.width * dpr; + const canvasHeight = coordSys.height * dpr; + canvas.width = canvasWidth; + canvas.height = canvasHeight; -// Go downside -path += `L ${box.x - margin} ${box.y + box.height + margin - radius}`; -path += `A ${radius} ${radius} 0 0 0 ${Math.min( - box.x - margin + radius, - nextBox.x - margin -)} ${box.y + box.height + margin}`; + const ctx = canvas.getContext('2d') as CanvasRenderingContext2D; -if (nextBox.y + nextBox.height > box.y + box.height) { - // Go right - path += `L ${nextBox.x - margin - radius} ${ -box.y + box.height + margin - }`; - path += `A ${radius} ${radius} 0 0 1 ${nextBox.x - margin} ${ -box.y + box.height + margin + radius - }`; - // Go down to the bottom of the next box - path += `L ${nextBox.x - margin} ${ -nextBox.y + nextBox.height + margin - radius - }`; - path += `A ${radius} ${radius} 0 0 0 ${nextBox.x - margin + radius} ${ -nextBox.y + nextBox.height + margin - }`; -} else { - // Go right to the right of the current box - path += `L ${box.x + box.width + margin - radius} ${ -box.y + box.height + margin - }`; - path += `A ${radius} ${radius} 0 0 0 ${box.x + box.width + margin} ${ -box.y + box.height + margin - radius - }`; - // Go up till the bottom of the next box - path += `L ${box.x + box.width + margin} ${ -nextBox.y + nextBox.height + margin + radius - }`; - path += `A ${radius} ${radius} 0 0 1 ${ -box.x + box.width + margin + radius - } ${nextBox.y + nextBox.height + margin}`; + if (allColors.length > 0 && !envelope.color) { +const gradient = ctx.createLinearGradient(0, 0, 0, canvasHeight); +for (let i = 0; i < allColors.length; i++) { + gradient.addColorStop(i / (allColors.length - 1), allColors[i]); } +ctx.fillStyle = gradient; + } else { +ctx.fillStyle = envelope.color || '#888'; } - // Go right and up for the last box - const lastBox = boxes[boxes.length - 1]; - const lastRadius = -Math.min(lastBox.height, Math.min(lastBox.width, borderRadius * 2)) / - 2 + -margin; - path += `L ${lastBox.x + lastBox.width + margin - lastRadius} ${ -lastBox.y + lastBox.height + margin - }`; - path += `A ${lastRadius} ${lastRadius} 0 0 0 ${ -lastBox.x + lastBox.width + margin -
(echarts) branch master updated (2c6ecb046 -> 38613d21c)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 2c6ecb046 Merge pull request #20324 from jonoshearman/fix-boxplot-category-encode-20319 add 69232edc2 fix: #20363 The polar coord clip should include center point in scatter add b0ef6c802 test: #20363 The polar coord clip should include center point in scatter add 80438d224 fix: 修复 The polar coord clip should include center point in scatter new 38613d21c Merge pull request #20370 from sz-p/fix-20363 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/coord/polar/Polar.ts | 9 + test/clip.html | 39 +++ 2 files changed, 44 insertions(+), 4 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20370 from sz-p/fix-20363
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 38613d21c9607d14d1deac307a3ee86512941b3a Merge: 2c6ecb046 80438d224 Author: Wenli Zhang AuthorDate: Thu Sep 26 10:12:08 2024 +0800 Merge pull request #20370 from sz-p/fix-20363 Fix 20363 src/coord/polar/Polar.ts | 9 + test/clip.html | 39 +++ 2 files changed, 44 insertions(+), 4 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) branch main updated: WIP(stage): envelop with border-radius
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 735e7b2 WIP(stage): envelop with border-radius 735e7b2 is described below commit 735e7b2406cce38a2adf7bdfd3ee242b16fb3537 Author: Ovilia AuthorDate: Wed Sep 25 15:33:43 2024 +0800 WIP(stage): envelop with border-radius --- README.md| 4 custom-series/stage/src/index.ts | 11 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5c54bf3..5f2125e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ Note: Building requires the lib files of ECharts v6. So before ECharts v6 is rel ```bash # Under the directory of echarts +git checkout v6 +npm install npm link +npm run prepare +npm run build # Under the directory of echarts-custom-series/custom-series/ npm link echarts diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 1057fe7..35522d0 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -127,14 +127,15 @@ const renderItem = ( const innerRadius = Math.min(box.height, Math.min(box.width, borderRadius * 2)) / 2; const radius = innerRadius + margin; +const nextBox = boxes[i + 1]; // Go downside path += `L ${box.x - margin} ${box.y + box.height + margin - radius}`; -path += `A ${radius} ${radius} 0 0 0 ${box.x - margin + radius} ${ - box.y + box.height + margin -}`; +path += `A ${radius} ${radius} 0 0 0 ${Math.min( + box.x - margin + radius, + nextBox.x - margin +)} ${box.y + box.height + margin}`; -const nextBox = boxes[i + 1]; if (nextBox.y + nextBox.height > box.y + box.height) { // Go right path += `L ${nextBox.x - margin - radius} ${ @@ -235,7 +236,7 @@ const renderItem = ( }, style: { fill: 'blue', - opacity: 0.4, + opacity: 0.3, }, silent: true, }; - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) 03/03: WIP(stage): envelop with border-radius
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit 417d6223a211f7819e2bb52f27fe8e758bbdf5e4 Author: Ovilia AuthorDate: Tue Sep 24 14:40:39 2024 +0800 WIP(stage): envelop with border-radius --- custom-series/stage/src/index.ts | 88 +--- 1 file changed, 73 insertions(+), 15 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index c2de927..1057fe7 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -108,67 +108,124 @@ const renderItem = ( const envelope: Envelope = params.itemPayload.envelope || {}; if (envelope.show !== false && boxes.length > 1) { const margin = echarts.zrUtil.retrieve2(envelope.margin as number, 5); + // Sort boxes by x, then by y boxes.sort((a, b) => a.x - b.x || a.y - b.y); console.log(boxes); // Top-left of the first box - let path: string = `M ${boxes[0].x - margin} ${boxes[0].y - margin}`; + const firstBox = boxes[0]; + const firstRadius = +Math.min(firstBox.height, Math.min(firstBox.width, borderRadius * 2)) / + 2 + +margin; + let path: string = `M ${firstBox.x - margin} ${ +firstBox.y - margin + firstRadius + }`; for (let i = 0; i < boxes.length - 1; i++) { const box = boxes[i]; +const innerRadius = + Math.min(box.height, Math.min(box.width, borderRadius * 2)) / 2; +const radius = innerRadius + margin; // Go downside -path += `L ${box.x - margin} ${box.y + box.height + margin}`; +path += `L ${box.x - margin} ${box.y + box.height + margin - radius}`; +path += `A ${radius} ${radius} 0 0 0 ${box.x - margin + radius} ${ + box.y + box.height + margin +}`; const nextBox = boxes[i + 1]; if (nextBox.y + nextBox.height > box.y + box.height) { // Go right - path += `L ${nextBox.x - margin} ${box.y + box.height + margin}`; + path += `L ${nextBox.x - margin - radius} ${ +box.y + box.height + margin + }`; + path += `A ${radius} ${radius} 0 0 1 ${nextBox.x - margin} ${ +box.y + box.height + margin + radius + }`; // Go down to the bottom of the next box path += `L ${nextBox.x - margin} ${ +nextBox.y + nextBox.height + margin - radius + }`; + path += `A ${radius} ${radius} 0 0 0 ${nextBox.x - margin + radius} ${ nextBox.y + nextBox.height + margin }`; } else { // Go right to the right of the current box - path += `L ${box.x + box.width + margin} ${ + path += `L ${box.x + box.width + margin - radius} ${ box.y + box.height + margin }`; + path += `A ${radius} ${radius} 0 0 0 ${box.x + box.width + margin} ${ +box.y + box.height + margin - radius + }`; // Go up till the bottom of the next box path += `L ${box.x + box.width + margin} ${ -nextBox.y + nextBox.height + margin +nextBox.y + nextBox.height + margin + radius }`; + path += `A ${radius} ${radius} 0 0 1 ${ +box.x + box.width + margin + radius + } ${nextBox.y + nextBox.height + margin}`; } } // Go right and up for the last box const lastBox = boxes[boxes.length - 1]; - path += `L ${lastBox.x + lastBox.width + margin} ${ + const lastRadius = +Math.min(lastBox.height, Math.min(lastBox.width, borderRadius * 2)) / + 2 + +margin; + path += `L ${lastBox.x + lastBox.width + margin - lastRadius} ${ lastBox.y + lastBox.height + margin }`; - path += `L ${lastBox.x + lastBox.width + margin} ${lastBox.y - margin}`; + path += `A ${lastRadius} ${lastRadius} 0 0 0 ${ +lastBox.x + lastBox.width + margin + } ${lastBox.y + lastBox.height + margin - lastRadius}`; + path += `L ${lastBox.x + lastBox.width + margin} ${ +lastBox.y - margin + lastRadius + }`; + path += `A ${lastRadius} ${lastRadius} 0 0 0 ${ +lastBox.x + lastBox.width + margin - lastRadius + } ${lastBox.y - margin}`; // Then, there's a similar progress to close the path for (let i = boxes.length - 1; i > 0; i--) { const box = boxes[i]; +const innerRadius = + Math.min(box.height, Math.min(box.width, borderRadius * 2)) / 2; +const radius = innerRadius + margin; + path += `L ${box.x + box.width + margin} ${box.y - margin}`; const prevBox = boxes[i - 1]; if (prevBox.y < box.y) { // Go left - path += `L ${prevBox.x + prevBox.w
(echarts-custom-series) branch main updated (61146e0 -> 417d622)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git from 61146e0 feat(stage): refactor code new 43aaebf WIP(stage): debug envelope new 79eab6c WIP(stage): polygon envelop new 417d622 WIP(stage): envelop with border-radius The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: custom-series/stage/src/index.ts | 174 ++- 1 file changed, 170 insertions(+), 4 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) 02/03: WIP(stage): polygon envelop
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit 79eab6ce86820a8bb47b75a7c6272a2ce581c10b Author: Ovilia AuthorDate: Mon Sep 23 18:13:59 2024 +0800 WIP(stage): polygon envelop --- custom-series/stage/src/index.ts | 114 --- 1 file changed, 71 insertions(+), 43 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 1a9ebd7..c2de927 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -106,58 +106,86 @@ const renderItem = ( // If is the last item, render envelope if (params.dataIndex === params.dataInsideLength - 1) { const envelope: Envelope = params.itemPayload.envelope || {}; -if (envelope.show !== false) { +if (envelope.show !== false && boxes.length > 1) { const margin = echarts.zrUtil.retrieve2(envelope.margin as number, 5); // Sort boxes by x, then by y boxes.sort((a, b) => a.x - b.x || a.y - b.y); console.log(boxes); - // Render envelope so that the stage chart looks exactly like - // the Apple Health sleep chart - const paths: CustomElementOption[] = []; - for (let i = 0; i < boxes.length; i++) { -// Expand by margin + // Top-left of the first box + let path: string = `M ${boxes[0].x - margin} ${boxes[0].y - margin}`; + for (let i = 0; i < boxes.length - 1; i++) { const box = boxes[i]; -paths.push({ - type: 'rect', - shape: { -x: box.x - margin, -y: box.y - margin, -width: box.width + 2 * margin, -height: box.height + 2 * margin, -// r: borderRadius + margin, - }, - style: { -fill: 'red', -opacity: 0.2, - }, - z2: -1, -}); - -if (i > 0) { - const prev = boxes[i - 1]; - const current = boxes[i]; - paths.push({ -type: 'rect', -shape: { - x: prev.x + prev.width + margin, - y: prev.y - margin, - width: current.x - prev.x - prev.width - margin * 2, - height: current.y + current.height + margin - (prev.y - margin), -}, -style: { - fill: 'blue', - opacity: 0.2, -}, -z2: -1, - }); + +// Go downside +path += `L ${box.x - margin} ${box.y + box.height + margin}`; + +const nextBox = boxes[i + 1]; +if (nextBox.y + nextBox.height > box.y + box.height) { + // Go right + path += `L ${nextBox.x - margin} ${box.y + box.height + margin}`; + // Go down to the bottom of the next box + path += `L ${nextBox.x - margin} ${ +nextBox.y + nextBox.height + margin + }`; +} else { + // Go right to the right of the current box + path += `L ${box.x + box.width + margin} ${ +box.y + box.height + margin + }`; + // Go up till the bottom of the next box + path += `L ${box.x + box.width + margin} ${ +nextBox.y + nextBox.height + margin + }`; +} + } + // Go right and up for the last box + const lastBox = boxes[boxes.length - 1]; + path += `L ${lastBox.x + lastBox.width + margin} ${ +lastBox.y + lastBox.height + margin + }`; + path += `L ${lastBox.x + lastBox.width + margin} ${lastBox.y - margin}`; + + // Then, there's a similar progress to close the path + for (let i = boxes.length - 1; i > 0; i--) { +const box = boxes[i]; +path += `L ${box.x + box.width + margin} ${box.y - margin}`; +const prevBox = boxes[i - 1]; +if (prevBox.y < box.y) { + // Go left + path += `L ${prevBox.x + prevBox.width + margin} ${box.y - margin}`; + // Go up to the top of the prev box + path += `L ${prevBox.x + prevBox.width + margin} ${ +prevBox.y - margin + }`; +} else { + // Go left to the left of the current box + path += `L ${box.x - margin} ${box.y - margin}`; + // Go down till the top of the prev box + path += `L ${box.x - margin} ${prevBox.y - margin}`; } } + const firstBox = boxes[0]; + path += `L ${firstBox.x - margin} ${firstBox.y - margin}`; + path += `L ${firstBox.x - margin} ${ +firstBox.y + firstBox.height + margin + }`; + + const envelopeEl = { +type: 'path' as const, +shape: { + d: path, +}, +style: { + fill: 'blue', + opacity: 0.4, +}, + }; + console.log(path); + +
(echarts-custom-series) 01/03: WIP(stage): debug envelope
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit 43aaebff8500c0f9dab1b9556f3e3419cfd46500 Author: Ovilia AuthorDate: Fri Sep 20 15:23:37 2024 +0800 WIP(stage): debug envelope --- custom-series/stage/src/index.ts | 88 ++-- 1 file changed, 84 insertions(+), 4 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 68dcda2..1a9ebd7 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -25,6 +25,13 @@ import type { } from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; import type { EChartsExtensionInstallRegisters } from 'echarts/src/extension.ts'; +type Envelope = { + show?: boolean; + color?: 'auto' | string; + opacity?: number; + margin?: number; +}; + const renderItem = ( params: echarts.CustomSeriesRenderItemParams, api: echarts.CustomSeriesRenderItemAPI @@ -45,22 +52,37 @@ const renderItem = ( const barMinHeight = 2; const children: CustomElementOption[] = []; + const boxes: { x: number; y: number; width: number; height: number }[] = +(params.context.boxes as { + x: number; + y: number; + width: number; + height: number; +}[]) || []; const span = endCoord[0] - startCoord[0]; const height = Math.max(span, barMinHeight); + const shape = { +x: startCoord[0] - (height - span) / 2, +y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, +width: height, +height: bandWidth - fontSize - textMargin - 2 * barMargin, + }; children.push({ type: 'rect', shape: { - x: startCoord[0] - (height - span) / 2, - y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, - width: height, - height: bandWidth - fontSize - textMargin - 2 * barMargin, + x: shape.x, + y: shape.y, + width: shape.width, + height: shape.height, r: borderRadius, }, style: { fill: color, }, }); + boxes.push(shape); + params.context.boxes = boxes; if (!params.context.renderedStages) { params.context.renderedStages = []; @@ -81,6 +103,64 @@ const renderItem = ( renderedStages[stageIndex] = true; } + // If is the last item, render envelope + if (params.dataIndex === params.dataInsideLength - 1) { +const envelope: Envelope = params.itemPayload.envelope || {}; +if (envelope.show !== false) { + const margin = echarts.zrUtil.retrieve2(envelope.margin as number, 5); + // Sort boxes by x, then by y + boxes.sort((a, b) => a.x - b.x || a.y - b.y); + console.log(boxes); + // Render envelope so that the stage chart looks exactly like + // the Apple Health sleep chart + + const paths: CustomElementOption[] = []; + for (let i = 0; i < boxes.length; i++) { +// Expand by margin +const box = boxes[i]; +paths.push({ + type: 'rect', + shape: { +x: box.x - margin, +y: box.y - margin, +width: box.width + 2 * margin, +height: box.height + 2 * margin, +// r: borderRadius + margin, + }, + style: { +fill: 'red', +opacity: 0.2, + }, + z2: -1, +}); + +if (i > 0) { + const prev = boxes[i - 1]; + const current = boxes[i]; + paths.push({ +type: 'rect', +shape: { + x: prev.x + prev.width + margin, + y: prev.y - margin, + width: current.x - prev.x - prev.width - margin * 2, + height: current.y + current.height + margin - (prev.y - margin), +}, +style: { + fill: 'blue', + opacity: 0.2, +}, +z2: -1, + }); +} + } + + children.push({ +type: 'group', +children: paths, + }); +} + } + return { type: 'group', children, - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-sankey-roam updated (041ae2228 -> e3cad60c5)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-sankey-roam in repository https://gitbox.apache.org/repos/asf/echarts.git from 041ae2228 fix(sankey): fix a lint problem add e3cad60c5 fix(sankey): fix a lint problem No new revisions were added by this update. Summary of changes: src/chart/sankey/SankeyView.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-sankey-roam updated (396236405 -> 041ae2228)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-sankey-roam in repository https://gitbox.apache.org/repos/asf/echarts.git from 396236405 feat(sankey): sankey support roam add 041ae2228 fix(sankey): fix a lint problem No new revisions were added by this update. Summary of changes: src/chart/sankey/SankeyView.ts | 1 + 1 file changed, 1 insertion(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (ce7c12287 -> 6639b231a)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from ce7c12287 Merge pull request #20304 from ribeirompl/ribeirompl-patch-1 add 1f6b148e2 feat(custom): use installer for resuable custom series new 6639b231a Merge pull request #20329 from apache/feat-custom-series The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/extension.ts | 5 + 1 file changed, 5 insertions(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20329 from apache/feat-custom-series
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit 6639b231aa4cf7f62ba6cd9d3cc22a5b97ce652a Merge: ce7c12287 1f6b148e2 Author: Wenli Zhang AuthorDate: Fri Sep 20 11:28:52 2024 +0800 Merge pull request #20329 from apache/feat-custom-series feat(custom): use installer for reusable custom series src/extension.ts | 5 + 1 file changed, 5 insertions(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom-series deleted (was 1f6b148e2)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom-series in repository https://gitbox.apache.org/repos/asf/echarts.git was 1f6b148e2 feat(custom): use installer for resuable custom series The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) branch main updated: feat(stage): refactor code
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 61146e0 feat(stage): refactor code 61146e0 is described below commit 61146e0dd41d85f4141f3ea7f06362ada959cfe8 Author: Ovilia AuthorDate: Thu Sep 19 10:26:18 2024 +0800 feat(stage): refactor code --- custom-series/stage/src/index.ts| 40 +++ custom-series/stage/test/index.html | 47 +++ screenshots/stage.svg | 65 + 3 files changed, 89 insertions(+), 63 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 41d5db4..68dcda2 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -36,39 +36,37 @@ const renderItem = ( const startCoord = api.coord([start, stageIndex]); const endCoord = api.coord([end, stageIndex]); - const stages = params.itemPayload.stages || []; const bandWidth = api.coord([0, 0])[1] - api.coord([0, 1])[1]; const fontSize = 14; const textMargin = 5; const barMargin = 8; - const seriesColor = api.visual('color'); + const color = api.visual('color'); const borderRadius = (params.itemPayload.borderRadius as number) || 8; - const isGrouping = params.itemPayload.grouping as boolean; + const barMinHeight = 2; const children: CustomElementOption[] = []; - const stage = stages[stageIndex]; - if (stage && !isGrouping) { -children.push({ - type: 'rect', - shape: { -x: startCoord[0], -y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, -width: endCoord[0] - startCoord[0], -height: bandWidth - fontSize - textMargin - 2 * barMargin, -r: borderRadius, - }, - style: { -fill: stage.color || seriesColor, - }, -}); - } + const span = endCoord[0] - startCoord[0]; + const height = Math.max(span, barMinHeight); + children.push({ +type: 'rect', +shape: { + x: startCoord[0] - (height - span) / 2, + y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, + width: height, + height: bandWidth - fontSize - textMargin - 2 * barMargin, + r: borderRadius, +}, +style: { + fill: color, +}, + }); if (!params.context.renderedStages) { params.context.renderedStages = []; } const renderedStages = params.context.renderedStages as boolean[]; - if (stage && !renderedStages[stageIndex]) { + if (!renderedStages[stageIndex]) { // Each stage only render once as axis label children.push({ type: 'text', @@ -76,7 +74,7 @@ const renderItem = ( x: (params.coordSys as any).x + textMargin, y: startCoord[1] - bandWidth / 2 + textMargin + fontSize, fill: (params.itemPayload.axisLabelColor as string) || '#777', -text: stage.name, +text: api.ordinalRawValue(2) as string, verticalAlign: 'bottom', }, }); diff --git a/custom-series/stage/test/index.html b/custom-series/stage/test/index.html index ad52b47..fdaa116 100644 --- a/custom-series/stage/test/index.html +++ b/custom-series/stage/test/index.html @@ -47,12 +47,20 @@ tooltip: { show: true, valueFormatter: (params) => { -console.log(params); return formatTime(params[0]) + ' - ' + formatTime(params[1]); } }, xAxis: { type: 'time', +splitLine: { +show: true, +lineStyle: { +type: 'dashed', +opacity: 0.8 +} +}, +min: value => value.min - 10 * 60 * 1000, +max: value => value.max + 10 * 60 * 1000 }, yAxis: { type: 'category', @@ -65,6 +73,11 @@ }, axisLabel: { show: false +}, +axisLine: { +lineStyle: { +color: '#ccc' +} } }, dataset: { @@ -73,20 +86,8 @@ series: { type: 'custom', renderItem: 'stage', +colorBy: 'data', itemPayload: { -stages: [{ -name: 'Deep', -color: '#33379D' -}, { -name: 'Core', -
(echarts-custom-series) branch main updated: feat(stage): add thumbnails
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new cac0195 feat(stage): add thumbnails cac0195 is described below commit cac0195d7ff3e0caa80bf5ff52cd93a325fe76a6 Author: Ovilia AuthorDate: Wed Sep 18 16:01:14 2024 +0800 feat(stage): add thumbnails --- README.md | 1 + screenshots/stage.svg | 64 +++ scripts/generate.js | 2 +- 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 086757c..5c54bf3 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ This repo provides some custom series for [Apache ECharts](https://github.com/ap | [barRange](custom-series/barRange) ![barRange](screenshots/barRange.svg) | [violin](custom-series/violin) ![violin](screenshots/violin.svg) | | - | - | +| [stage](custom-series/stage) ![stage](screenshots/stage.svg) | | ## Setup diff --git a/screenshots/stage.svg b/screenshots/stage.svg new file mode 100644 index 000..74ebe7a --- /dev/null +++ b/screenshots/stage.svg @@ -0,0 +1,64 @@ +http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; version="1.1" baseProfile="full" viewBox="0 0 600 400"> + + + + + + + +04:00 +05:00 +06:00 +07:00 +08:00 +09:00 +10:00 + +Awake + + + +REM + + + + + +Core + + + + + + + + + +Deep + + +<![CDATA[ +.zr0-cls-0:hover { +pointer-events:none; +} +.zr0-cls-1:hover { +cursor:pointer; +fill:rgba(255,141,121,1); +} +.zr0-cls-2:hover { +cursor:pointer; +fill:rgba(97,218,255,1); +} +.zr0-cls-3:hover { +cursor:pointer; +fill:rgba(20,163,255,1); +} +.zr0-cls-4:hover { +cursor:pointer; +fill:rgba(56,60,172,1); +} + +]]> + + + \ No newline at end of file diff --git a/scripts/generate.js b/scripts/generate.js index b840024..c1e409e 100644 --- a/scripts/generate.js +++ b/scripts/generate.js @@ -59,7 +59,7 @@ function create(name) { console.log( chalk.gray(`Installing dependencies for custom series ${name}...`) ); - // require('child_process').execSync(`npm install`, { cwd: seriesPath }); + require('child_process').execSync(`npm install`, { cwd: seriesPath }); console.log(chalk.green(`Custom series ${name} created successfully.\n`)); } - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) 01/02: chore: add stage chart template
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit 421c83daa6658dc7080daedefb49ecb6d5e5b846 Author: Ovilia AuthorDate: Sat Sep 14 16:10:18 2024 +0800 chore: add stage chart template --- custom-series/stage/dist/index.js | 39 ++ custom-series/stage/dist/index.min.js | 19 +++ custom-series/stage/dist/index.min.js.map | 1 + custom-series/stage/package-lock.json | 54 +++ custom-series/stage/package.json | 18 +++ custom-series/stage/rollup.config.js | 38 ++ custom-series/stage/src/index.ts | 44 + custom-series/stage/test/index.html | 36 + 8 files changed, 249 insertions(+) diff --git a/custom-series/stage/dist/index.js b/custom-series/stage/dist/index.js new file mode 100644 index 000..8691357 --- /dev/null +++ b/custom-series/stage/dist/index.js @@ -0,0 +1,39 @@ +/* +* 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. +*/ +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : +typeof define === 'function' && define.amd ? define(factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.stageCustomSeriesInstaller = factory()); +})(this, (function () { 'use strict'; + +var renderItem = function (params, api) { +return { +type: 'group', +children: [], +}; +}; +var index = { +install: function (registers) { +registers.registerCustomSeries('stage', renderItem); +}, +}; + +return index; + +})); diff --git a/custom-series/stage/dist/index.min.js b/custom-series/stage/dist/index.min.js new file mode 100644 index 000..72872b7 --- /dev/null +++ b/custom-series/stage/dist/index.min.js @@ -0,0 +1,19 @@ +/* +* 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. +*/ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).stageCustomSeriesInstaller=t()}(this,(function(){"use strict";var e=function(e,t){return{type:"group",children:[]}};return{install:function(t){t.registerCustomSeries("stage",e)}}})); \ No newline at end of file diff --git a/custom-series/stage/dist/index.min.js.map b/custom-series/stage/dist/index.min.js.map new file mode 100644 index 000..d14b65f --- /dev/null +++ b/custom-series/stage/dist/index.min.js.map @@ -0,0 +1 @@ +{"version":3,"names":["global","factory","exports","module","define","amd","globalThis","self","stageCustomSeriesInstaller","this","renderItem","params","api","type","children","install","registers","registerCustomSeries"],"sources":["/Users/zhangwenli01/workspace/echarts/echarts-custom-series/custom-series/stage/dist/ind
(echarts-custom-series) branch main updated (ffeb026 -> 8882940)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git from ffeb026 chore: add screenshots new 421c83d chore: add stage chart template new 8882940 feat(stage): basic stage bars The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../rollup.config.js => stage/dist/index.js} | 43 - .../rollup.config.js => stage/dist/index.min.js} | 23 + custom-series/stage/dist/index.min.js.map | 1 + .../{barRange => stage}/package-lock.json | 4 +- .../template => custom-series/stage}/package.json | 2 +- custom-series/{violin => stage}/rollup.config.js | 2 +- custom-series/stage/src/index.ts | 99 +++ custom-series/stage/test/index.html| 105 + 8 files changed, 233 insertions(+), 46 deletions(-) copy custom-series/{violin/rollup.config.js => stage/dist/index.js} (54%) copy custom-series/{barRange/rollup.config.js => stage/dist/index.min.js} (67%) create mode 100644 custom-series/stage/dist/index.min.js.map copy custom-series/{barRange => stage}/package-lock.json (96%) copy {scripts/template => custom-series/stage}/package.json (88%) copy custom-series/{violin => stage}/rollup.config.js (96%) create mode 100644 custom-series/stage/src/index.ts create mode 100644 custom-series/stage/test/index.html - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) 02/02: feat(stage): basic stage bars
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit 8882940acfb0af5880d58197d8c37894e4caafed Author: Ovilia AuthorDate: Wed Sep 18 15:57:17 2024 +0800 feat(stage): basic stage bars --- custom-series/stage/src/index.ts| 57 - custom-series/stage/test/index.html | 73 - 2 files changed, 127 insertions(+), 3 deletions(-) diff --git a/custom-series/stage/src/index.ts b/custom-series/stage/src/index.ts index 89c025c..41d5db4 100644 --- a/custom-series/stage/src/index.ts +++ b/custom-series/stage/src/index.ts @@ -19,6 +19,7 @@ import echarts from 'echarts'; import type { + CustomElementOption, CustomRootElementOption, CustomSeriesRenderItem, } from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; @@ -28,9 +29,63 @@ const renderItem = ( params: echarts.CustomSeriesRenderItemParams, api: echarts.CustomSeriesRenderItemAPI ) => { + const start = api.value(0); + const end = api.value(1); + const stageIndex = api.value(2); + + const startCoord = api.coord([start, stageIndex]); + const endCoord = api.coord([end, stageIndex]); + + const stages = params.itemPayload.stages || []; + const bandWidth = api.coord([0, 0])[1] - api.coord([0, 1])[1]; + const fontSize = 14; + const textMargin = 5; + const barMargin = 8; + const seriesColor = api.visual('color'); + const borderRadius = (params.itemPayload.borderRadius as number) || 8; + const isGrouping = params.itemPayload.grouping as boolean; + + const children: CustomElementOption[] = []; + + const stage = stages[stageIndex]; + if (stage && !isGrouping) { +children.push({ + type: 'rect', + shape: { +x: startCoord[0], +y: startCoord[1] - bandWidth / 2 + textMargin + fontSize + barMargin, +width: endCoord[0] - startCoord[0], +height: bandWidth - fontSize - textMargin - 2 * barMargin, +r: borderRadius, + }, + style: { +fill: stage.color || seriesColor, + }, +}); + } + + if (!params.context.renderedStages) { +params.context.renderedStages = []; + } + const renderedStages = params.context.renderedStages as boolean[]; + if (stage && !renderedStages[stageIndex]) { +// Each stage only render once as axis label +children.push({ + type: 'text', + style: { +x: (params.coordSys as any).x + textMargin, +y: startCoord[1] - bandWidth / 2 + textMargin + fontSize, +fill: (params.itemPayload.axisLabelColor as string) || '#777', +text: stage.name, +verticalAlign: 'bottom', + }, +}); +renderedStages[stageIndex] = true; + } + return { type: 'group', -children: [], +children, } as CustomRootElementOption; }; diff --git a/custom-series/stage/test/index.html b/custom-series/stage/test/index.html index 6cba74b..ad52b47 100644 --- a/custom-series/stage/test/index.html +++ b/custom-series/stage/test/index.html @@ -17,14 +17,83 @@ const chart = echarts.init(document.getElementById('main')); const data = [ -[new Date()] -] +[new Date('2024-09-07 06:12'), new Date('2024-09-07 06:12'), 'Awake'], +[new Date('2024-09-07 06:15'), new Date('2024-09-07 06:18'), 'Awake'], +[new Date('2024-09-07 08:59'), new Date('2024-09-07 09:00'), 'Awake'], +[new Date('2024-09-07 05:45'), new Date('2024-09-07 06:12'), 'REM'], +[new Date('2024-09-07 07:37'), new Date('2024-09-07 07:56'), 'REM'], +[new Date('2024-09-07 08:56'), new Date('2024-09-07 08:59'), 'REM'], +[new Date('2024-09-07 09:08'), new Date('2024-09-07 09:29'), 'REM'], +[new Date('2024-09-07 05:45'), new Date('2024-09-07 06:12'), 'REM'], +[new Date('2024-09-07 03:12'), new Date('2024-09-07 03:27'), 'Core'], +[new Date('2024-09-07 04:02'), new Date('2024-09-07 04:36'), 'Core'], +[new Date('2024-09-07 04:40'), new Date('2024-09-07 04:48'), 'Core'], +[new Date('2024-09-07 04:57'), new Date('2024-09-07 05:45'), 'Core'], +[new Date('2024-09-07 06:12'), new Date('2024-09-07 06:15'), 'Core'], +[new Date('2024-09-07 06:18'), new Date('2024-09-07 07:37'), 'Core'], +[new Date
(echarts-custom-series) branch main updated: chore: add screenshots
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new ffeb026 chore: add screenshots ffeb026 is described below commit ffeb0264877c182d73c53c170538ea4bec59f475 Author: Ovilia AuthorDate: Fri Sep 13 14:53:46 2024 +0800 chore: add screenshots --- README.md | 19 ++- custom-series/barRange/README.md| 73 custom-series/barRange/src/index.ts | 6 +- custom-series/violin/README.md | 60 +++ custom-series/violin/src/index.ts | 5 +- package-lock.json | 26 +++ package.json| 6 +- screenshots/barRange.svg| 62 +++ screenshots/violin.svg | 331 scripts/template/README.md | 23 +++ scripts/thumbnail.js| 104 +++ 11 files changed, 709 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4b1f680..086757c 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ This repo provides some custom series for [Apache ECharts](https://github.com/ap ## List of Custom Series -TODO +| [barRange](custom-series/barRange) ![barRange](screenshots/barRange.svg) | [violin](custom-series/violin) ![violin](screenshots/violin.svg) | +| - | - | ## Setup @@ -25,10 +26,10 @@ npm link echarts ## Create A New Custom Series ```bash -npm run create +npm run generate ``` -The generated files are in `custom-series/`. Note that if there are multiple words in the series name, they should be in camel case like `npm run create barRange`. +The generated files are in `custom-series/`. Note that if there are multiple words in the series name, they should be in camel case like `npm run generate barRange`. ## Build @@ -51,3 +52,15 @@ For example, to build `custom-series/violin`, run: ```bash npm run build violin ``` + +## Generate Thumbnails + +```bash +npm run thumbnail +# or +npm run thumbnail +``` + +## Publish to the npm registry + +TODO diff --git a/custom-series/barRange/README.md b/custom-series/barRange/README.md new file mode 100644 index 000..7a96eda --- /dev/null +++ b/custom-series/barRange/README.md @@ -0,0 +1,73 @@ +# barRange + +`barRange` is a custom series for [Apache ECharts](https://github.com/apache/echarts). It's typically used to display the range of data using bars. + +![barRange](../../screenshots/barRange.svg) + +## Usage + +Import the custom series JavaScript file and ECharts, then use `echarts.use` to install it. + +```html + + + + echarts.use(window.barRangeCustomSeriesInstaller); + const chart = echarts.init(...); + // ... + +``` + +Or, if using module bundler, install the package from npm and import it. + +```bash +npm install @echarts/custom-bar-range +``` + +```js +import echarts from 'echarts'; +import barRangeCustomSeriesInstaller from '@echarts/custom-bar-range'; + +echarts.use(barRangeCustomSeriesInstaller); +``` + +See [test](./test/index.html) for more details. + +## API + +### series.data + +The data of the series is an array of arrays. Each sub-array represents a bar. + +```js +const data = [ + [0, 26.7, 32.5], + [1, 25.3, 32.4], +]; +``` + +The first element of the sub-array is the x value. The second and third elements are the lower and upper bounds of the bar. + +### series.itemPayload + +The `itemPayload` is an object that contains the following properties: + +| Property | Type | Default | Description | +| -- | | --- | - | - | +| `barWidth` | `number | string` | `70%` | The width of the bar. | +| `borderRadius` | `number` | `0` | The border radius of the bar. | +| `margin` | `number` | `10`| The margin between the bars and the text. | + +### series.encode + +To make sure the value axis and tooltip take the correct range, `encode` should be set as follows: + +```js +encode: { +x: 0, +y: [1, 2], +tooltip: [1, 2] +} +``` + +See [test](./test/index.html) for more details. diff --git a/custom-series/barRange/src/index.ts b/custom-series/barRange/src/index.ts index 1d209d2..9ba2c3f 100644 --- a/custom-series/barRange/src/index.ts +++ b/custom-series/barRange/src/index.ts @@ -34,7 +34,11 @@ const renderItem = ( const valueEnd = api.value(2); const coordEnd = api.coord([x, valueEnd]); const bandWidth = api.coord([1, 0])[0] - api.coord([0, 0])[0]; - const barWidthRaw = params.itemPayload.barWidth as number | string; + + let barWidthRaw = params.itemP
(echarts-custom-series) branch main updated: chore: update npm package name
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 26dee60 chore: update npm package name 26dee60 is described below commit 26dee60bfef04a6b1f74e5182c577e54437245b7 Author: Ovilia AuthorDate: Thu Sep 12 15:20:59 2024 +0800 chore: update npm package name --- README.md | 2 +- custom-series/barRange/package.json | 4 +-- custom-series/violin/package.json | 2 +- package-lock.json | 11 +++ package.json| 8 +++-- scripts/build.js| 24 ++- scripts/{create.js => generate.js} | 61 + scripts/serve.js| 57 ++ scripts/template/README.md | 28 + scripts/template/package.json | 4 +-- 10 files changed, 147 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index f6a059b..4b1f680 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ npm link echarts npm run create ``` -The generated files are in `custom-series/`. +The generated files are in `custom-series/`. Note that if there are multiple words in the series name, they should be in camel case like `npm run create barRange`. ## Build diff --git a/custom-series/barRange/package.json b/custom-series/barRange/package.json index 2d41349..ba26967 100644 --- a/custom-series/barRange/package.json +++ b/custom-series/barRange/package.json @@ -1,5 +1,5 @@ { - "name": "echarts-barRange", + "name": "@echarts/custom-bar-range", "version": "0.0.1", "description": "", "main": "dist/index.js", @@ -15,4 +15,4 @@ "devDependencies": { "typescript": "^5.5.4" } -} \ No newline at end of file +} diff --git a/custom-series/violin/package.json b/custom-series/violin/package.json index c856d37..e1131c8 100644 --- a/custom-series/violin/package.json +++ b/custom-series/violin/package.json @@ -1,5 +1,5 @@ { - "name": "echarts-violin", + "name": "@echarts/custom-violin", "version": "0.0.1-beta", "description": "", "main": "dist/index.js", diff --git a/package-lock.json b/package-lock.json index f385c3b..0dca759 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,9 @@ "name": "echarts-custom-series", "version": "1.0.0", "license": "Apache-2.0", + "dependencies": { +"chalk": "^4.1.2" + }, "devDependencies": { "chokidar": "^3.6.0", "http-server": "^14.1.1", @@ -304,7 +307,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz";, "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -402,7 +404,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz";, "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -442,7 +443,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz";, "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -453,8 +453,7 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz";, - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules
(echarts-custom-series) branch main updated: feat: bar-range chart
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new d17e444 feat: bar-range chart d17e444 is described below commit d17e4447404ac9826bdfd80900a4a5b2d72caebb Author: Ovilia AuthorDate: Thu Sep 12 14:08:59 2024 +0800 feat: bar-range chart --- custom-series/barRange/dist/index.js | 87 + custom-series/barRange/dist/index.min.js | 19 ++ custom-series/barRange/dist/index.min.js.map | 1 + custom-series/barRange/package-lock.json | 54 custom-series/barRange/package.json | 18 ++ custom-series/barRange/rollup.config.js | 38 +++ custom-series/barRange/src/index.ts | 97 custom-series/barRange/test/index.html | 59 + 8 files changed, 373 insertions(+) diff --git a/custom-series/barRange/dist/index.js b/custom-series/barRange/dist/index.js new file mode 100644 index 000..77c2567 --- /dev/null +++ b/custom-series/barRange/dist/index.js @@ -0,0 +1,87 @@ +/* +* 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. +*/ +(function (global, factory) { +typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : +typeof define === 'function' && define.amd ? define(factory) : +(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.barRangeCustomSeriesInstaller = factory()); +})(this, (function () { 'use strict'; + +var renderItem = function (params, api) { +var x = api.value(0); +var valueStart = api.value(1); +var coordStart = api.coord([x, valueStart]); +var valueEnd = api.value(2); +var coordEnd = api.coord([x, valueEnd]); +var bandWidth = api.coord([1, 0])[0] - api.coord([0, 0])[0]; +var barWidthRaw = params.itemPayload.barWidth; +var barWidth = typeof barWidthRaw === 'string' && barWidthRaw.endsWith('%') +? (parseFloat(barWidthRaw) / 100) * bandWidth +: barWidthRaw; +var borderRadius = params.itemPayload.borderRadius || 0; +var bar = { +type: 'rect', +shape: { +x: coordStart[0] - barWidth / 2, +y: coordStart[1], +width: barWidth, +height: coordEnd[1] - coordStart[1], +r: borderRadius, +}, +style: { +fill: api.visual('color'), +}, +}; +var marginRaw = params.itemPayload.margin; +var margin = marginRaw == null ? 10 : marginRaw; +var textTop = { +type: 'text', +x: coordEnd[0], +y: coordEnd[1] - margin, +style: { +text: valueEnd.toString() + '℃', +textAlign: 'center', +textVerticalAlign: 'bottom', +fill: '#333', +}, +}; +var textBottom = { +type: 'text', +x: coordStart[0], +y: coordStart[1] + margin, +style: { +text: valueStart.toString() + '℃', +textAlign: 'center', +textVerticalAlign: 'top', +fill: '#333', +}, +}; +return { +type: 'group', +children: [bar, textTop, textBottom], +}; +}; +var index = { +install: function (registers) { +registers.registerCustomSeries('barRange', renderItem); +}, +}; + +return index; + +})); diff --git a/custom-series/barRange/dist/index.min.js b/custom-series/barRange/dist/index.min.js new file mode 100644 index 000..f6115b6 --- /dev/null +++ b/custom-series/barRange/dist/index.min.js @@ -0,0 +1,19 @@ +/* +* Licensed to th
(echarts-custom-series) branch main updated: chore: update create template
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new 26770cc chore: update create template 26770cc is described below commit 26770cc8a2a42c17faa98b0c3273e3aba41bd819 Author: Ovilia AuthorDate: Wed Sep 11 10:13:02 2024 +0800 chore: update create template --- scripts/create.js | 39 ++- scripts/template/package.json | 2 +- scripts/template/rollup.config.js | 7 ++- scripts/template/src/index.ts | 20 ++-- scripts/template/test/index.html | 7 +++ 5 files changed, 62 insertions(+), 13 deletions(-) diff --git a/scripts/create.js b/scripts/create.js index 5f6feb8..dbf079d 100644 --- a/scripts/create.js +++ b/scripts/create.js @@ -1,3 +1,22 @@ +/* + * 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. + */ + const fs = require('fs'); const path = require('path'); @@ -16,7 +35,9 @@ function create(name) { fs.mkdirSync(seriesPath); copyDirectory(templatePath, seriesPath); - // Replace $$$ in package.json with + // Replace `$CUSTOM_SERIES_NAME$` in all files under seriesPath with + replaceCustomSeriesName(seriesPath, name); + const packageJsonPath = path.join(seriesPath, 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); packageJson.name = `echarts-${name}`; @@ -30,6 +51,22 @@ function create(name) { console.log(`Run "npm run build ${name}" to build the custom series`); } +/** + * Recursively replace the custom series name in the file + */ +function replaceCustomSeriesName(filePath, name) { + if (fs.statSync(filePath).isDirectory()) { +const items = fs.readdirSync(filePath); +items.forEach((item) => { + replaceCustomSeriesName(path.join(filePath, item), name); +}); + } else { +const content = fs.readFileSync(filePath, 'utf-8'); +const newContent = content.replace(/\$CUSTOM_SERIES_NAME\$/g, name); +fs.writeFileSync(filePath, newContent); + } +} + function copyDirectory(src, dest) { // Check if source directory exists if (!fs.existsSync(src)) { diff --git a/scripts/template/package.json b/scripts/template/package.json index 0e4c6f8..6001e14 100644 --- a/scripts/template/package.json +++ b/scripts/template/package.json @@ -1,5 +1,5 @@ { - "name": "echarts-$$$", + "name": "echarts-template", "version": "0.0.1", "description": "", "main": "dist/index.js", diff --git a/scripts/template/rollup.config.js b/scripts/template/rollup.config.js index fb381b8..44ccfb5 100644 --- a/scripts/template/rollup.config.js +++ b/scripts/template/rollup.config.js @@ -11,7 +11,7 @@ module.exports = { }, plugins: [ { - name: 'add-window-assignment', + name: 'add-license', renderChunk(code) { return `/* * Licensed to the Apache Software Foundation (ASF) under one @@ -31,10 +31,7 @@ module.exports = { * specific language governing permissions and limitations * under the License. */ -${code} -if (typeof window !== 'undefined') { - window.$CUSTOM_SERIES_NAME$CustomSeriesInstaller = violinCustomSeriesInstaller; -}`; +${code}`; }, }, ], diff --git a/scripts/template/src/index.ts b/scripts/template/src/index.ts index 154f721..cd848f8 100644 --- a/scripts/template/src/index.ts +++ b/scripts/template/src/index.ts @@ -17,8 +17,12 @@ * under the License. */ -import echarts, { CustomSeriesRenderItem } from 'echarts'; -import type { CustomRootElementOption } from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; +import echarts from 'echarts'; +import type { + CustomRootElementOption, + CustomSeriesRenderItem, +} from 'echarts/types/src/chart/custom/CustomSeries.d.ts'; +import type { EChartsExtensionInstallRegisters } from 'echarts/src/extension.ts';
(echarts-custom-series) branch main updated: chore: update rollup config
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new e5de49d chore: update rollup config e5de49d is described below commit e5de49d70dfacecdfebdec849656f925649eebd5 Author: Ovilia AuthorDate: Tue Sep 10 10:37:44 2024 +0800 chore: update rollup config --- custom-series/violin/dist/index.js | 3 - custom-series/violin/dist/index.min.js | 2 +- custom-series/violin/dist/index.min.js.map | 2 +- custom-series/violin/rollup.config.js | 7 +- package-lock.json | 173 + package.json | 1 + scripts/serve.js | 92 +++ .../violin => scripts/template}/rollup.config.js | 4 +- 8 files changed, 272 insertions(+), 12 deletions(-) diff --git a/custom-series/violin/dist/index.js b/custom-series/violin/dist/index.js index 76b122b..7d4520f 100644 --- a/custom-series/violin/dist/index.js +++ b/custom-series/violin/dist/index.js @@ -135,6 +135,3 @@ return index; })); -if (typeof window !== 'undefined') { - window.violinCustomSeriesInstaller = violinCustomSeriesInstaller; -} diff --git a/custom-series/violin/dist/index.min.js b/custom-series/violin/dist/index.min.js index 7240598..b4900dd 100644 --- a/custom-series/violin/dist/index.min.js +++ b/custom-series/violin/dist/index.min.js @@ -16,4 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).violinCustomSeriesInstaller=n()}(this,(function(){"use strict";function e(e){return Math.abs(e)<=1?.75*(1-e*e):0}var n=function(n,t){var i={};if(null==n.context.violins){n.context.violins=[],i=n.context.violins;for(var l=n.dataInsideLength,o=0;ohttps://github.com/chalk/ansi-styles?sponsor=1"; } }, +"node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz";, + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "dependencies": { +"normalize-path": "^3.0.0", +"picomatch": "^2.0.4" + }, + "engines": { +"node": ">= 8" + } +}, "node_modules/async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz";, @@ -335,6 +349,30 @@ "node": ">= 0.8" } }, +"node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz";, + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "engines": { +"node": ">=8" + }, + "funding": { +"url": "https://github.com/sponsors/sindresorhus"; + } +}, +"node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz";, + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "dependencies": { +"fill-range": "^7.1.1" + }, + "engines": { +"node": ">=8" + } +}, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz";, @@ -376,6 +414,30 @@ "url": "https://github.com/chalk/chalk?sponsor=1"; } }, +"node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz";, + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true
(echarts-custom-series) branch main updated: chore: update build script to support umd
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new b00cd7e chore: update build script to support umd b00cd7e is described below commit b00cd7e7d20a22ea3111e370092ea9329ea1c354 Author: Ovilia AuthorDate: Mon Sep 9 17:09:26 2024 +0800 chore: update build script to support umd --- .gitignore| 1 + package-lock.json | 976 ++ package.json | 6 +- scripts/build.js | 118 ++- 4 files changed, 1084 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index fd4f2b0..7721b4b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +lib .DS_Store diff --git a/package-lock.json b/package-lock.json index 82ca5f3..f385c3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,9 @@ "version": "1.0.0", "license": "Apache-2.0", "devDependencies": { +"chokidar": "^3.6.0", +"http-server": "^14.1.1", +"rollup": "^4.21.2", "terser": "^5.31.6", "typescript": "^5.5.4" } @@ -71,6 +74,220 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, +"node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz";, + "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", + "cpu": [ +"arm" + ], + "dev": true, + "optional": true, + "os": [ +"android" + ] +}, +"node_modules/@rollup/rollup-android-arm64": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz";, + "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", + "cpu": [ +"arm64" + ], + "dev": true, + "optional": true, + "os": [ +"android" + ] +}, +"node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz";, + "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", + "cpu": [ +"arm64" + ], + "dev": true, + "optional": true, + "os": [ +"darwin" + ] +}, +"node_modules/@rollup/rollup-darwin-x64": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz";, + "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", + "cpu": [ +"x64" + ], + "dev": true, + "optional": true, + "os": [ +"darwin" + ] +}, +"node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz";, + "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", + "cpu": [ +"arm" + ], + "dev": true, + "optional": true, + "os": [ +"linux" + ] +}, +"node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz";, + "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", + "cpu": [ +"arm" + ], + "dev": true, + "optional": true, + "os&q
(echarts) branch feat-custom-series created (now 1f6b148e2)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom-series in repository https://gitbox.apache.org/repos/asf/echarts.git at 1f6b148e2 feat(custom): use installer for resuable custom series This branch includes the following new commits: new 1f6b148e2 feat(custom): use installer for resuable custom series The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: feat(sankey): sankey support roam
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat-sankey-roam in repository https://gitbox.apache.org/repos/asf/echarts.git commit 396236405809dd697d6f9c64093f3c4a7e1636bd Author: Ovilia AuthorDate: Thu Sep 5 14:49:03 2024 +0800 feat(sankey): sankey support roam --- src/chart/sankey/SankeySeries.ts | 14 +++- src/chart/sankey/SankeyView.ts | 71 test/sankey-roam.html| 135 +++ 3 files changed, 218 insertions(+), 2 deletions(-) diff --git a/src/chart/sankey/SankeySeries.ts b/src/chart/sankey/SankeySeries.ts index 9dca447ca..1826ea4e7 100644 --- a/src/chart/sankey/SankeySeries.ts +++ b/src/chart/sankey/SankeySeries.ts @@ -34,12 +34,14 @@ import { GraphEdgeItemObject, OptionDataValueNumeric, DefaultEmphasisFocus, -CallbackDataParams +CallbackDataParams, +RoamOptionMixin } from '../../util/types'; import GlobalModel from '../../model/Global'; import SeriesData from '../../data/SeriesData'; import { LayoutRect } from '../../util/layout'; import { createTooltipMarkup } from '../../component/tooltip/tooltipMarkup'; +import View from '../../coord/View'; type FocusNodeAdjacency = boolean | 'inEdges' | 'outEdges' | 'allEdges'; @@ -95,7 +97,8 @@ export interface SankeyLevelOption extends SankeyNodeStateOption, SankeyEdgeStat export interface SankeySeriesOption extends SeriesOption, ExtraStateOption>, SankeyBothStateOption, -BoxLayoutOptionMixin { +BoxLayoutOptionMixin, +RoamOptionMixin { type?: 'sankey' /** @@ -148,6 +151,8 @@ class SankeySeriesModel extends SeriesModel { static readonly type = 'series.sankey'; readonly type = SankeySeriesModel.type; +coordinateSystem: View; + levelModels: Model[]; layoutInfo: LayoutRect; @@ -297,6 +302,11 @@ class SankeySeriesModel extends SeriesModel { layoutIterations: 32, +// true | false | 'move' | 'scale', see module:component/helper/RoamController. +roam: false, +center: null, +zoom: 1, + label: { show: true, position: 'right', diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts index e84b7f7ee..47cf89e51 100644 --- a/src/chart/sankey/SankeyView.ts +++ b/src/chart/sankey/SankeyView.ts @@ -31,6 +31,11 @@ import { setLabelStyle, getLabelStatesModels } from '../../label/labelStyle'; import { getECData } from '../../util/innerStore'; import { isString, retrieve3 } from 'zrender/src/core/util'; import type { GraphEdge } from '../../data/Graph'; +import RoamController from '../../component/helper/RoamController'; +import type { RoamControllerHost } from '../../component/helper/roamHelper'; +import { onIrrelevantElement } from '../../component/helper/cursorHelper'; +import * as roamHelper from '../../component/helper/roamHelper'; +import View from '../../coord/View'; class SankeyPathShape { x1 = 0; @@ -111,6 +116,17 @@ class SankeyView extends ChartView { private _data: SeriesData; +private _controller: RoamController; +private _controllerHost: RoamControllerHost; + +init(ecModel: GlobalModel, api: ExtensionAPI): void { +this._controller = new RoamController(api.getZr()); + +this._controllerHost = { +target: this.group +} as RoamControllerHost; +} + render(seriesModel: SankeySeriesModel, ecModel: GlobalModel, api: ExtensionAPI) { const sankeyView = this; const graph = seriesModel.getGraph(); @@ -131,6 +147,14 @@ class SankeyView extends ChartView { group.x = layoutInfo.x; group.y = layoutInfo.y; +const viewCoordSys = seriesModel.coordinateSystem = new View(); +viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); +viewCoordSys.setBoundingRect(layoutInfo.x, layoutInfo.y, width, height); +viewCoordSys.setCenter(seriesModel.get('center'), api); +viewCoordSys.setZoom(seriesModel.get('zoom')); + +this._updateController(seriesModel, ecModel, api); + // generate a bezire Curve for each edge graph.eachEdge(function (edge) { const curve = new SankeyPath(); @@ -346,6 +370,53 @@ class SankeyView extends ChartView { } dispose() { +this._controller && this._controller.dispose(); +this._controllerHost = null; +} + +private _updateController( +seriesModel: SankeySeriesModel, +ecModel: GlobalModel, +api: ExtensionAPI +) { +const controller = this._controller; +const controllerHost = this._controllerHost; +co
(echarts-custom-series) branch main updated: chore: minify
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new a74ce26 chore: minify a74ce26 is described below commit a74ce26f185cd15362c27a35a3cfee4cad631c3e Author: Ovilia AuthorDate: Wed Sep 4 12:04:24 2024 +0800 chore: minify --- README.md | 16 +++ custom-series/violin/dist/index.html | 163 ++ custom-series/violin/dist/index.js | 206 + custom-series/violin/dist/index.js.map | 2 +- custom-series/violin/dist/index.min.js | 1 + custom-series/violin/package-lock.json | 4 +- custom-series/violin/package.json | 2 +- custom-series/violin/test/index.html | 56 + package-lock.json | 120 +++ package.json | 1 + scripts/build.js | 13 ++- scripts/template/package.json | 2 +- 12 files changed, 482 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index 1833d64..f6a059b 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,22 @@ This repo provides some custom series for [Apache ECharts](https://github.com/ap TODO +## Setup + +```bash +npm install +``` + +Note: Building requires the lib files of ECharts v6. So before ECharts v6 is released, you need to clone `apache/echarts` locally and use `npm link` to link it. + +```bash +# Under the directory of echarts +npm link + +# Under the directory of echarts-custom-series/custom-series/ +npm link echarts +``` + ## Create A New Custom Series ```bash diff --git a/custom-series/violin/dist/index.html b/custom-series/violin/dist/index.html new file mode 100644 index 000..c33a193 --- /dev/null +++ b/custom-series/violin/dist/index.html @@ -0,0 +1,163 @@ + + + + + + +SVG Path in Canvas + +body { +display: flex; +justify-content: center; +align-items: center; +height: 100vh; +margin: 0; +background-color: #f0f0f0; +flex-direction: row; +} + +canvas { +border: 1px solid #00; +margin-bottom: 20px; +} + +svg { +border: 1px solid #00; +} + + + + + + + + +const generator = ({ size = 400, growth = 16, edges = 6, seed = null } = {}) => { +var { destPoints, seedValue } = _createPoints(size, growth, edges, seed); +var path = _createSvgPath(destPoints); +return { path, seedValue }; +}; + +const _toRad = (deg) => deg * (Math.PI / 180.0); + +const _divide = (count) => { +var deg = 360 / count; + +return Array(count) +.fill("a") +.map((_, i) => i * deg); +}; + +const _randomDoubleGenerator = (s) => { +var mask = 0x; +var m_w = (123456789 + s) & mask; +var m_z = (987654321 - s) & mask; + +return function () { +m_z = (36969 * (m_z & 65535) + (m_z >>> 16)) & mask; +m_w = (18000 * (m_w & 65535) + (m_w >>> 16)) & mask; + +var result = ((m_z << 16) + (m_w & 65535)) >>> 0; +result /= 4294967296; +return result; +}; +}; + +const _magicPoint = (value, min, max) => { +let radius = min + value * (max - min); +if (radius > max) { +radius = radius - min; +} else if (radius < min) { +radius = radius + min; +} +return radius; +}; + +const _point = (origin, radius, degree) => { +var x = origin + radius * Math.cos(_toRad(degree)); +var y = origin + radius * Math.sin(_toRad(degree)); +return [Math.round(x), Math.round(y)]; +}; + +const _shuffle = (array) => { +array.sort(() => Math.random() - 0.5); +return array; +}; + +const _createPoints = (size, minGrowth, edgesCount, seed) => { +let outerRad = size / 2; +let innerRad = minGrowth * (outerRad / 10); +let center = size / 2; + +let slices = _divide(edgesCount); +let maxRandomValue = _shuffle([99, 999, , 9, 99])[0]; +let id = Math.floor(Math.random() * maxRandomValue); +let seedValue = seed || id; +let randVal = _randomDoubleGenerator(seedValue); +let destPoints = []; + +slices.forEach((degree) => { +let O = _magicPoint(randVal(), i
(echarts-custom-series) branch main updated: chore: setup build scripts and templates
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new a6527aa chore: setup build scripts and templates a6527aa is described below commit a6527aac562ae7c0ca770cf33cb361f3f6abf355 Author: Ovilia AuthorDate: Tue Sep 3 15:23:33 2024 +0800 chore: setup build scripts and templates --- .gitignore | 2 +- LICENSE| 201 + README.md | 25 ++- custom-series/violin/dist/index.d.ts | 1 + custom-series/violin/dist/index.js | 125 + custom-series/violin/dist/index.js.map | 1 + custom-series/violin/package-lock.json | 2 +- custom-series/violin/package.json | 4 +- custom-series/violin/src/index.ts | 21 ++- custom-series/violin/tsconfig.json | 24 --- package-lock.json | 29 +++ package.json | 22 +++ scripts/build.js | 75 scripts/create.js | 71 .../violin => scripts/template}/package.json | 6 +- scripts/template/src/index.ts | 36 16 files changed, 601 insertions(+), 44 deletions(-) diff --git a/.gitignore b/.gitignore index 491fc35..fd4f2b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules -lib +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing list
(echarts-custom-series) branch main updated: chore: repo scaffold and violin series
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git The following commit(s) were added to refs/heads/main by this push: new fcc577f chore: repo scaffold and violin series fcc577f is described below commit fcc577f73624c32e494187b6881c05190d498705 Author: Ovilia AuthorDate: Mon Sep 2 17:41:39 2024 +0800 chore: repo scaffold and violin series --- .gitignore | 2 + .vscode/settings.json | 4 + README.md | 20 - custom-series/violin/package-lock.json | 54 + custom-series/violin/package.json | 18 + custom-series/violin/src/index.ts | 143 + custom-series/violin/tsconfig.json | 24 ++ 7 files changed, 264 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..491fc35 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +lib diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000..9bf4d12 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true +} diff --git a/README.md b/README.md index d840c22..154449b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # echarts-custom-series -Apache echarts + +This repo provides some custom series for [Apache ECharts](https://github.com/apache/echarts). The minial supported version is Apache ECharts v6, which is not released yet. + +## List of Custom Series + +TODO + +## Build + +Each of the directories in `custom-series/` is a custom series. You can `cd` to that path and build them by running: + +```bash +npm install +npm run build +``` + +The built files will be in the `lib/` directory. + +> Note: There is no bundling step for now. diff --git a/custom-series/violin/package-lock.json b/custom-series/violin/package-lock.json new file mode 100644 index 000..943d4e1 --- /dev/null +++ b/custom-series/violin/package-lock.json @@ -0,0 +1,54 @@ +{ + "name": "echarts-violin", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { +"": { + "name": "echarts-violin", + "version": "1.0.0", + "license": "ISC", + "dependencies": { +"echarts": "github:apache/echarts#v6" + }, + "devDependencies": { +"typescript": "^5.5.4" + } +}, +"node_modules/echarts": { + "version": "5.5.1", + "resolved": "git+ssh://g...@github.com/apache/echarts.git#d2eba0f23cdd077af4f82cebe726de6659cb", + "license": "Apache-2.0", + "dependencies": { +"tslib": "2.3.0", +"zrender": "5.6.0" + } +}, +"node_modules/tslib": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz";, + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" +}, +"node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz";, + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "bin": { +"tsc": "bin/tsc", +"tsserver": "bin/tsserver" + }, + "engines": { +"node": ">=14.17" + } +}, +"node_modules/zrender": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz";, + "integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==", + "dependencies": { +"tslib": "2.3.0" + } +} + } +} diff --git a/custom-series/violin/package.json b/custom-series/violin/package.json new file mode 100644 index 000..30f592c --- /dev/null +++ b/custom-series/violin/package.json @@ -0,0 +1,18 @@ +{ + "name": "echarts-violin", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { +"buil
(echarts) branch fix-roam deleted (was ccdc4b91e)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-roam in repository https://gitbox.apache.org/repos/asf/echarts.git was ccdc4b91e fix(roam): ignore duplicate-imports The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (a4b03df75 -> d2eba0f23)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from a4b03df75 Merge pull request #20226 from apache/feat-custom add 15c681f11 fix(roam): fix RoamControllerHost importing path add ccdc4b91e fix(roam): ignore duplicate-imports new d2eba0f23 Merge pull request #20313 from apache/fix-roam The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/treemap/TreemapView.ts | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20313 from apache/fix-roam
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit d2eba0f23cdd077af4f82cebe726de6659cb Merge: a4b03df75 ccdc4b91e Author: Wenli Zhang AuthorDate: Mon Sep 2 16:59:11 2024 +0800 Merge pull request #20313 from apache/fix-roam fix(roam): fix RoamControllerHost importing path src/chart/treemap/TreemapView.ts | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix-roam updated (15c681f11 -> ccdc4b91e)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-roam in repository https://gitbox.apache.org/repos/asf/echarts.git from 15c681f11 fix(roam): fix RoamControllerHost importing path add ccdc4b91e fix(roam): ignore duplicate-imports No new revisions were added by this update. Summary of changes: src/chart/treemap/TreemapView.ts | 2 ++ 1 file changed, 2 insertions(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix-roam created (now 15c681f11)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-roam in repository https://gitbox.apache.org/repos/asf/echarts.git at 15c681f11 fix(roam): fix RoamControllerHost importing path This branch includes the following new commits: new 15c681f11 fix(roam): fix RoamControllerHost importing path The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: fix(roam): fix RoamControllerHost importing path
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch fix-roam in repository https://gitbox.apache.org/repos/asf/echarts.git commit 15c681f113b21d9afe0c01e040397a7b8306daec Author: Ovilia AuthorDate: Mon Sep 2 16:43:31 2024 +0800 fix(roam): fix RoamControllerHost importing path --- src/chart/treemap/TreemapView.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/chart/treemap/TreemapView.ts b/src/chart/treemap/TreemapView.ts index a0b892e1e..2c0662c77 100644 --- a/src/chart/treemap/TreemapView.ts +++ b/src/chart/treemap/TreemapView.ts @@ -30,7 +30,9 @@ import { import DataDiffer from '../../data/DataDiffer'; import * as helper from '../helper/treeHelper'; import Breadcrumb from './Breadcrumb'; -import RoamController, { RoamEventParams, RoamControllerHost } from '../../component/helper/RoamController'; +import type { RoamControllerHost } from '../../component/helper/roamHelper'; +import type { RoamEventParams } from '../../component/helper/RoamController'; +import RoamController from '../../component/helper/RoamController'; import BoundingRect, { RectLike } from 'zrender/src/core/BoundingRect'; import * as matrix from 'zrender/src/core/matrix'; import * as animationUtil from '../../util/animation'; - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom deleted (was 78c072cc3)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git was 78c072cc3 fix(custom): import type The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20226 from apache/feat-custom
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit a4b03df7530c8ba5cd60500e02e238d81fd39eb4 Merge: f6c28b734 78c072cc3 Author: Wenli Zhang AuthorDate: Mon Sep 2 16:20:47 2024 +0800 Merge pull request #20226 from apache/feat-custom feat(custom): reusable custom series src/chart/custom/CustomSeries.ts | 2 + src/chart/custom/CustomView.ts | 17 +- src/chart/custom/customSeriesRegister.ts | 11 src/core/echarts.ts | 6 ++ src/model/Global.ts | 3 +- test/custom-register.html| 98 6 files changed, 134 insertions(+), 3 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (f6c28b734 -> a4b03df75)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from f6c28b734 Merge branch 'v6' into next-thumbnail add 197bacd2d feat(custom): custom series can be registered add 25132fdb5 fix(custom): use renderItem as registered custom name add a9f881ceb fix(custom): use function instead of class add a33c528dc fix(custom): support renderItemArgs add dafe12963 fix(custom): rename to itemPayload add 78c072cc3 fix(custom): import type new a4b03df75 Merge pull request #20226 from apache/feat-custom The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/custom/CustomSeries.ts | 2 + src/chart/custom/CustomView.ts | 17 +++- src/chart/custom/customSeriesRegister.ts | 11 ++ src/core/echarts.ts| 6 +++ src/model/Global.ts| 3 +- .../mktest-tpl.html => custom-register.html} | 46 +++--- 6 files changed, 68 insertions(+), 17 deletions(-) create mode 100644 src/chart/custom/customSeriesRegister.ts copy test/{build/mktest-tpl.html => custom-register.html} (62%) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) branch main created (now d56456d)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git at d56456d Initial commit This branch includes the following new commits: new d56456d Initial commit The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts-custom-series) 01/01: Initial commit
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/echarts-custom-series.git commit d56456d17210f04ed7a81e5300551d7edce47b8f Author: Wenli Zhang AuthorDate: Mon Sep 2 16:05:13 2024 +0800 Initial commit --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md new file mode 100644 index 000..d840c22 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# echarts-custom-series +Apache echarts - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix-pictorial-zero updated (fd51f71d8 -> 65ac3c3c9)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-pictorial-zero in repository https://gitbox.apache.org/repos/asf/echarts.git from fd51f71d8 fix(pictorialBar): symbol should not flip with zero data #20260 add 65ac3c3c9 style(pictorialBar): remove console log No new revisions were added by this update. Summary of changes: src/chart/bar/PictorialBarView.ts | 1 - 1 file changed, 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/02: test(pictorial): add test case when value is 0
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch fix-pictorial-zero in repository https://gitbox.apache.org/repos/asf/echarts.git commit bc065fd0cb9b4b2cf10e8f38e2df5d95329b731f Author: Ovilia AuthorDate: Tue Aug 27 18:26:06 2024 +0800 test(pictorial): add test case when value is 0 --- test/pictorial-zero-value.html | 54 ++ 1 file changed, 54 insertions(+) diff --git a/test/pictorial-zero-value.html b/test/pictorial-zero-value.html index 49935bb2b..7a7b92489 100644 --- a/test/pictorial-zero-value.html +++ b/test/pictorial-zero-value.html @@ -32,6 +32,7 @@ under the License. + var chart; @@ -167,5 +168,58 @@ under the License. option && myChart.setOption(option); }); + + + + +require(['echarts'], function (echarts) { +option = { +xAxis: { +type: 'value', +boundaryGap: [0, 0.01] +}, +yAxis: { +type: 'category', +data: ['Brazil', 'Indonesia'] +}, +series: [ +{ +name: '2011', +type: 'bar', +data: [0, 630230] +}, +{ +type: 'pictorialBar', +symbolPosition: 'end', +symbolSize: 40, +symbolOffset: [2, 0], +zlevel: 2, +data: [ +{ +value: 0, +symbol: + 'image://<a rel="nofollow" href="https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg">https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg</a>' +}, +{ +value: 630230, +symbol: + 'image://<a rel="nofollow" href="https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg">https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg</a>' +} +] +} +] +}; + + +var chart = testHelper.create(echarts, 'main3', { +title: [ +'Image should not be flipped when data is 0.', +], +option: option +}); + +}); + + - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix-pictorial-zero created (now fd51f71d8)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix-pictorial-zero in repository https://gitbox.apache.org/repos/asf/echarts.git at fd51f71d8 fix(pictorialBar): symbol should not flip with zero data #20260 This branch includes the following new commits: new bc065fd0c test(pictorial): add test case when value is 0 new fd51f71d8 fix(pictorialBar): symbol should not flip with zero data #20260 The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 02/02: fix(pictorialBar): symbol should not flip with zero data #20260
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch fix-pictorial-zero in repository https://gitbox.apache.org/repos/asf/echarts.git commit fd51f71d88344533934f2061167169f973231b4a Author: Ovilia AuthorDate: Wed Aug 28 14:41:09 2024 +0800 fix(pictorialBar): symbol should not flip with zero data #20260 --- src/chart/bar/PictorialBarView.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts index c9460daac..196ab078f 100644 --- a/src/chart/bar/PictorialBarView.ts +++ b/src/chart/bar/PictorialBarView.ts @@ -278,6 +278,7 @@ function getSymbolMeta( hoverScale: isAnimationEnabled && itemModel.get(['emphasis', 'scale']), z2: itemModel.getShallow('z', true) || 0 } as SymbolMeta; +console.log(symbolMeta) prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); @@ -341,7 +342,7 @@ function prepareBarLength( // if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero // and when borderWidth be settled, the actual linewidth will be NaN -outputSymbolMeta.pxSign = boundingLength > 0 ? 1 : -1; +outputSymbolMeta.pxSign = boundingLength >= 0 ? 1 : -1; } function convertToCoordOnAxis(axis: Axis2D, value: number) { - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge branch 'v6' into next-thumbnail
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit f6c28b73498bfde7c4382602ac187843db097643 Merge: a244af6f1 23d26a81a Author: Ovilia AuthorDate: Mon Aug 26 16:14:59 2024 +0800 Merge branch 'v6' into next-thumbnail .eslintrc-common.yaml | 2 +- .github/ISSUE_TEMPLATE/bug_report.yml | 6 +- .github/workflows/.scripts/update-notice-year.js |93 + .github/workflows/ci.yml |60 +- .github/workflows/nightly-next.yml |10 +- .github/workflows/nightly.yml | 9 +- .github/workflows/pr-preview.yml |78 + .github/workflows/source-release.yml |27 +- .github/workflows/stale.yml| 2 +- .github/workflows/teardown-pr-preview.yml |30 + .github/workflows/update-notice-year.yml |24 + .gitignore | 4 + .husky/pre-commit | 5 + .huskyrc | 5 - .npmignore | 8 +- .vscode/settings.json | 5 +- CONTRIBUTING.md|24 +- KEYS | 107 + NOTICE | 4 +- README.md | 9 +- build/build.js |43 +- build/config.js|25 +- build/package.json | 3 + build/pre-publish.js |53 +- .../template/ssr/client/index.d.ts |15 +- .../template/ssr/client/index.js |15 +- build/testDts.js |27 +- dist/echarts.common.js | 14536 dist/echarts.common.js.map | 2 +- dist/echarts.common.min.js | 4 +- dist/echarts.esm.js| 23198 ++ dist/echarts.esm.js.map| 2 +- dist/echarts.esm.min.js| 4 +- dist/echarts.esm.min.mjs |45 + dist/{echarts.esm.js => echarts.esm.mjs} | 23200 ++- dist/{echarts.js.map => echarts.esm.mjs.map} | 2 +- dist/echarts.js| 23198 ++ dist/echarts.js.map| 2 +- dist/echarts.min.js| 4 +- dist/echarts.simple.js | 9786 +++- dist/echarts.simple.js.map | 2 +- dist/echarts.simple.min.js | 4 +- dist/extension/bmap.js | 113 +- dist/extension/bmap.js.map | 2 +- dist/extension/dataTool.js |61 +- dist/extension/dataTool.js.map | 2 +- dist/package.json | 3 + i18n/langAR-obj.js | 178 + i18n/langAR.js | 174 + i18n/langCS-obj.js | 5 +- i18n/langCS.js | 5 +- i18n/langDE-obj.js | 7 +- i18n/langDE.js | 7 +- i18n/langEN-obj.js | 4 +- i18n/langEN.js | 4 +- i18n/langES-obj.js |60 + i18n/langES.js |60 + i18n/langFI-obj.js |60 + i18n/langFI.js |60 + i18n/langFR-obj.js | 4 +- i18n/langFR.js | 4 +- i18n/langHU-obj.js | 175 + i18n/langHU.js | 171 + i18n/langIT-obj.js | 4 +- i18n/langIT.js | 4 +- i18n/langJA-obj.js | 4 +- i18n/langJA.js | 4 +- i18n/langKO-obj.js | 4 +- i18n/langKO.js | 4 +- i18n/langNL-obj.js | 175 + i18n/langNL.js | 171 + i18n/langPL-obj.js | 4 +- i18n/langPL.js
(echarts) branch v6 updated (23d26a81a -> f6c28b734)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from 23d26a81a Merge branch 'next' into v6 add 214a37699 [feat]: add thumbnails components add 8f0bb6255 [feat]: add interface about ThumbanilOption add 0c4bef3a2 [feat]: add Thumbnail for tree,graph,map,sankey add 3ae14712a [feat]: add Thumbnail for tree,graph,map,sankey add 342c5e103 [feat]: add Thumbnail for tree,graph,map,sankey add 0948b0ae0 [feat]: add Thumbnail for tree,graph,map,sankey add 3df93f747 [fix]:fix the code format add 7fc143dbe [fix]:fix the code format add 3933e85ac [fix]:fix the code format add 3f9e49f2d [fix]:fix the code format add 2a897d6fb [fix]:fix the code format add 41c24254e [fix]:fix the code format add cffd1b60e [fix]:fix the code format add e83a6509b [fix]:fix the code format add b101a933f [fix]:fix the code format add ef44b3fa6 [fix]:fix the code format add 7eb89ceaa [feat]: add Thumbnail Component for graph add 9063d9475 [feat]: add Thumbnail Component for graph add 395308e6d [feat]: add Thumbnail Component for graph add b1b835029 [feat]: add Thumbnail Component for graph add e073e427d [feat]: add Thumbnail Component for graph add 6ffd037db [feat]: add Thumbnail Component for graph add 22f869d5b [feat]: add Thumbnail Component for graph add b4fff366d [fix]: fix the select overflow the thumbnail container add 0e31443a2 [fix]: use BoxLayoutOptionMixin in thumbnailSeries add 84940d6f3 [fix]: resolved conflicts add 255af4ce3 [fix]: resolved conflicts add 3fc74e8c4 [fix]: resolved conflicts add c2eb34af4 Merge pull request #17471 from Lruler/feat-11352 add f7e61f20c feat(thumbnail): upgrade thumbnail (1) Enable pan and zoom on thumbnail (2) Rename selectedAreaStyle to windowStyle (3) Clean up the code (4) Support border-radius and clip. add a244af6f1 Merge pull request #18039 from apache/graph-thumbnail-upgrade new f6c28b734 Merge branch 'v6' into next-thumbnail The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/graph/GraphSeries.ts | 8 +- src/chart/graph/GraphView.ts | 195 ++- src/chart/graph/Thumbnail.ts | 272 + src/chart/tree/TreeView.ts | 6 +- src/component/helper/RoamController.ts | 17 +-- src/component/helper/roamHelper.ts | 12 +- src/util/layout.ts | 37 - test/graph-thumbnail.html | 264 8 files changed, 748 insertions(+), 63 deletions(-) create mode 100644 src/chart/graph/Thumbnail.ts create mode 100644 test/graph-thumbnail.html - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (7955a468a -> 52e400635)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 7955a468a Merge pull request #20246 from apache/time-inverse add 88345fe6b fix(gauge): fix z2 is negative when maxVal is negative new 52e400635 Merge pull request #20276 from kingyue737/patch-1 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/gauge/GaugeView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20276 from kingyue737/patch-1
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 52e400635427e6cced851a1cdc70381cf8b13bb3 Merge: 7955a468a 88345fe6b Author: Wenli Zhang AuthorDate: Mon Aug 26 15:28:36 2024 +0800 Merge pull request #20276 from kingyue737/patch-1 fix(gauge): fix z2 is negative when maxVal is negative src/chart/gauge/GaugeView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat/dark-mode created (now b914c3ea0)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/dark-mode in repository https://gitbox.apache.org/repos/asf/echarts.git at b914c3ea0 feat(dark): support dark mode This branch includes the following new commits: new b914c3ea0 feat(dark): support dark mode The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: feat(dark): support dark mode
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat/dark-mode in repository https://gitbox.apache.org/repos/asf/echarts.git commit b914c3ea0e52547be87406fd07540de8aeb36fa9 Author: Ovilia AuthorDate: Wed Aug 21 16:05:09 2024 +0800 feat(dark): support dark mode --- src/core/echarts.ts| 8 +++- src/model/globalDefault.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 4ecb2c653..25dcabdd9 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -107,7 +107,8 @@ import { ScaleDataValue, ZRElementEventName, ECElementEvent, -AnimationOption +AnimationOption, +Dictionary } from '../util/types'; import Displayable from 'zrender/src/graphic/Displayable'; import { seriesSymbolTask, dataSymbolTask } from '../visual/symbol'; @@ -322,6 +323,8 @@ export type EChartsInitOpts = { locale?: string | LocaleOption, renderer?: RendererType, devicePixelRatio?: number, +darkMode?: 'auto' | 'light' | 'dark', +darkColorMap?: Dictionary, useDirtyRect?: boolean, useCoarsePointer?: boolean, pointerSize?: number, @@ -410,6 +413,7 @@ class ECharts extends Eventful { this._dom = dom; let defaultRenderer = 'canvas'; +let defaultDarkMode = 'auto' as const; let defaultCoarsePointer: 'auto' | boolean = 'auto'; let defaultUseDirtyRect = false; @@ -448,6 +452,8 @@ class ECharts extends Eventful { width: opts.width, height: opts.height, ssr: opts.ssr, +darkMode: opts.darkMode || defaultDarkMode, +darkColorMap: opts.darkColorMap, useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect), useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer), pointerSize: opts.pointerSize diff --git a/src/model/globalDefault.ts b/src/model/globalDefault.ts index 304a55012..ff65aad25 100644 --- a/src/model/globalDefault.ts +++ b/src/model/globalDefault.ts @@ -30,7 +30,7 @@ const decalColor = 'rgba(0, 0, 0, 0.2)'; export default { darkMode: 'auto', -// backgroundColor: 'rgba(0,0,0,0)', +backgroundColor: 'rgba(255,255,255,1)', colorBy: 'series', - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge branch 'next' into v6
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit 23d26a81a9a1e48838156a25e49c4f70aadae051 Merge: 9aee654b7 fdf2e4dcc Author: Ovilia AuthorDate: Wed Aug 14 14:36:14 2024 +0800 Merge branch 'next' into v6 - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (9aee654b7 -> 23d26a81a)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from 9aee654b7 Merge branch 'master' into v6 add fdf2e4dcc Merge pull request #20100 from apache/master new 23d26a81a Merge branch 'next' into v6 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom updated (dafe12963 -> 78c072cc3)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git from dafe12963 fix(custom): rename to itemPayload add 78c072cc3 fix(custom): import type No new revisions were added by this update. Summary of changes: src/chart/custom/customSeriesRegister.ts | 2 +- src/core/echarts.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom updated (a33c528dc -> dafe12963)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git from a33c528dc fix(custom): support renderItemArgs add dafe12963 fix(custom): rename to itemPayload No new revisions were added by this update. Summary of changes: src/chart/custom/CustomSeries.ts | 4 ++-- src/chart/custom/CustomView.ts | 2 +- test/custom-register.html| 12 +++- 3 files changed, 10 insertions(+), 8 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (31fc8ccfb -> 9aee654b7)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from 31fc8ccfb Merge pull request #19534 from robin-gerling/fix-9265 add 35fa0cb70 chore: enable prompt to use typescript from workspace add c3291928f Merge pull request #20123 from apache/workspace-ts-prompt add 33249dcdc chore(workflow): fix pr-preview workflow add 4d3cb2cc2 Merge pull request #20144 from apache/workflow/pr-preview add 1166f2d26 fix(legend): fix legend action is not isolated from other legend components (resolves #20128) add 7564282ba test(legend): add a test case for legend action add cc26ef378 fix(legend): fix legend item is selected but corresponding series may not show after dispatching `legendAllSelect` action. add c7f672f8e fix(legend): remove unused import add 6ce6ba312 fix(legend): remove duplicated type of legend select method name add 13fe1d903 fix(legend): return allSelectedMap rather than selectedMap add 89cfb3645 Merge pull request #20129 from apache/fix/legend-action-isolation add e6dab043c fix(candlestick): add back missing support for non-normal states since v5.0.0 add e4061f69e fix(candlestick): disable emphasis state by default for forward compatibility add 89a15af59 fix(candelstick): still enable emphasis state by default add c9ac64100 Merge pull request #20105 from apache/fix/k-states add 86db174f8 perf(line): prebind context of `_changePolyState` function to current instance rather than create an new function to reduce runtime memory cost (fix #20151) add 65f625543 Merge pull request #20161 from apache/perf/line-memory-cost add a4d803f6c feature(axis): add feature to remove SplitLine on specified tick add 8e968f4f6 Merge pull request #20114 from adaelixir/feature-#20110 add 769bfef71 fix(pie): Missing pie chart label display. close #20070 add 403dce221 fix(pie): fix some labels may not show #20074 add 7a0663751 Merge pull request #20074 from liuyunzidian/fix-20070 add 72e3f8016 chore(deps-dev): bump socket.io-parser in /test/runTest add 11c5a12fd Merge pull request #20187 from apache/dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4 add 5fb9e9d5e fix(axis): ticks overflowing grid area with dataZoom #20185 add eeaf52e8e Merge pull request #20194 from apache/fix/customValues add ce500cf22 feature(treemap): add custom cursor properties for treemap (#20113) add aeb078eb7 feat(aria): allows excluding data in aria-label add b1a237448 refactor(aria): rename property to exclude add 43797899e Merge pull request #20218 from semla/aria-exclude-columns add 7c7a3ed89 feat(i18n): add Swedish(SV) translation (#20227) add 3bd3c7cf0 fix(time): bar bandWidth with inversed time axis #20068 add 7955a468a Merge pull request #20246 from apache/time-inverse new 9aee654b7 Merge branch 'master' into v6 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/pr-preview.yml | 3 + .vscode/settings.json | 5 +- src/chart/candlestick/CandlestickSeries.ts| 1 - src/chart/candlestick/CandlestickView.ts | 23 ++- src/chart/candlestick/candlestickVisual.ts| 31 ++-- src/chart/line/LineView.ts| 6 +- src/chart/pie/labelLayout.ts | 2 +- src/chart/treemap/TreemapSeries.ts| 4 +- src/chart/treemap/TreemapView.ts | 3 + src/component/axis/CartesianAxisView.ts | 11 +- src/component/legend/LegendView.ts| 3 +- src/component/legend/legendAction.ts | 96 ++- src/coord/Axis.ts | 4 +- src/coord/axisCommonTypes.ts | 6 +- src/coord/axisDefault.ts | 2 + src/coord/axisHelper.ts | 2 +- src/coord/axisTickLabelBuilder.ts | 9 +- src/i18n/langSV.ts| 144 + src/util/types.ts | 3 +- src/visual/aria.ts| 5 +- test/axis-customTicks.html| 186 ++ test/{clip-line-cap.html => axis-splitLine.html} | 86 +- test/candlestick-case.html| 51 +- test/legend-action.html | 136 test/runTest/actions/__meta__.json| 3 +- test/runTest/actions/candlestick-case.json| 2 +- test/runTest/actions/legend-action.json
(echarts) 01/01: Merge branch 'master' into v6
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit 9aee654b726960d5c5c37bc87ad17be7b6ec9059 Merge: 31fc8ccfb 7955a468a Author: Ovilia AuthorDate: Tue Aug 13 14:47:52 2024 +0800 Merge branch 'master' into v6 .github/workflows/pr-preview.yml | 3 + .vscode/settings.json| 5 +- src/chart/candlestick/CandlestickSeries.ts | 1 - src/chart/candlestick/CandlestickView.ts | 23 ++- src/chart/candlestick/candlestickVisual.ts | 31 ++-- src/chart/line/LineView.ts | 6 +- src/chart/pie/labelLayout.ts | 2 +- src/chart/treemap/TreemapSeries.ts | 4 +- src/chart/treemap/TreemapView.ts | 3 + src/component/axis/CartesianAxisView.ts | 11 +- src/component/legend/LegendView.ts | 3 +- src/component/legend/legendAction.ts | 96 ++- src/coord/Axis.ts| 4 +- src/coord/axisCommonTypes.ts | 6 +- src/coord/axisDefault.ts | 2 + src/coord/axisHelper.ts | 2 +- src/coord/axisTickLabelBuilder.ts| 9 +- src/i18n/langSV.ts | 144 + src/util/types.ts| 3 +- src/visual/aria.ts | 5 +- test/axis-customTicks.html | 186 ++ test/axis-splitLine.html | 83 ++ test/candlestick-case.html | 51 +- test/legend-action.html | 136 test/runTest/actions/__meta__.json | 3 +- test/runTest/actions/candlestick-case.json | 2 +- test/runTest/actions/legend-action.json | 1 + test/runTest/package-lock.json | 12 +- test/treemap-cursor.html | 193 +++ test/ut/spec/series/aria-columns-exclude.test.ts | 97 30 files changed, 1040 insertions(+), 87 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat/break-axis updated (e53f6cad3 -> 44135d3de)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/break-axis in repository https://gitbox.apache.org/repos/asf/echarts.git from e53f6cad3 fix: disable category axes add aaa2a48b9 feat: barSeries.startValue added add 7eae8148b extra testcases added add 323eca770 feat: rewrite changes to make dataZoom work add f74ede1e6 fix: fix the build bug caused by changes add 0d3a28962 fix: fix the build bug caused by changes add 0e862ce71 Merge branch 'issue#17077' of https://github.com/jiawulin001/echarts into issue#17077 add a4db0d4f7 Merge pull request #17078 from jiawulin001/issue#17077 add 71541f85a fix: In users' .d.ts `import('echarts/types/dist/shared')` can not visit `'echarts/types/dist/shared.d.ts'` since v5.5.0. Fix it. Fix #19663. add 57b8c9752 feat(treemap): add scaleLimit to limit the zooming. close #14599 add 8921fec4b feat(treemap): add scaleLimit to limit the zooming. close #14599 add 9f1d4fb14 fix: prototype _onZoom not effect add 0c5d5e791 feat(treemap):remove coordinateSystem add 4f0bb6527 feat(treemap): add scaleLimit with controllerHost add b0f77e880 feat(treemap): onZoom without controllerHost add 4dbfcfaa5 fix: custom onZoom add 91680313c feat(treemap): reset zoom when chart restore add 4b2d52fd0 Merge pull request #18304 from liuyizhou/fix-14599 add a20948618 Merge branch 'master' into fix/ts-type-visibility add b61f6c028 Merge pull request #20030 from apache/fix/ts-type-visibility add 7faa2e176 test(treemap): update test case for #18304 add 0ee94981f test(treemap): record test visual action for #18304 add 0ab5f7264 Merge pull request #20020 from apache/feat-treemap-test add 0c013fe71 feat(axis): custom axis tick/label positions. close #13627 add 952fa4523 chore: merge add 0c908241d fix: fix failed test cases and improve code add a2824713a Merge pull request #19919 from apache/dvdkon-fix-13627 add 562889eed chore(workflow): use forked workflow deps for timely update & fix typo add 40c2870d3 Merge pull request #20051 from apache/wokflow-deps add d3d974f7c feat: add role region to div tag when aria: true add b15b918b1 fix: change ARIA role from region to img for accessibility add 64539fed9 refactor: move dom.setAttribute('role', 'img') to reduce duplication add 32eeb07c7 Merge pull request #20050 from ViniciusCestarii/aria-role add 955762035 Merge pull request #20037 from apache/master add ca9ed741e chore: release 5.6.0 add 486f24f6d change version from 5.6.0 to 5.5.1 add 4c015dd9f chore(deps-dev): bump ws from 7.5.7 to 7.5.10 add 9d2bab0ea Merge pull request #20044 from apache/dependabot/npm_and_yarn/ws-7.5.10 add ad947d661 fix(tooltip): fix tooltip XSS issue when legend name is HTML string add c1727a65f refactor(tooltip): add `encodeHTMLContent` option to specify whether the content should be encoded by default add 62210761d test(tooltip): update test case for tooltip xss add efa3e5a8e Merge pull request #20045 from apache/fix/tooltip-xss add 34889d934 build release add 2caf68489 Merge pull request #20039 from apache/release-dev add a6d046302 Merge pull request #20084 from apache/release add 369cb0350 fix(custom): grid area clipping in custom series #19993 (#20043) add 35fa0cb70 chore: enable prompt to use typescript from workspace add c3291928f Merge pull request #20123 from apache/workspace-ts-prompt add 33249dcdc chore(workflow): fix pr-preview workflow add 4d3cb2cc2 Merge pull request #20144 from apache/workflow/pr-preview add 1166f2d26 fix(legend): fix legend action is not isolated from other legend components (resolves #20128) add 7564282ba test(legend): add a test case for legend action add cc26ef378 fix(legend): fix legend item is selected but corresponding series may not show after dispatching `legendAllSelect` action. add c7f672f8e fix(legend): remove unused import add 6ce6ba312 fix(legend): remove duplicated type of legend select method name add 13fe1d903 fix(legend): return allSelectedMap rather than selectedMap add 89cfb3645 Merge pull request #20129 from apache/fix/legend-action-isolation add e6dab043c fix(candlestick): add back missing support for non-normal states since v5.0.0 add e4061f69e fix(candlestick): disable emphasis state by default for forward compatibility add 89a15af59 fix(candelstick): still enable emphasis state by default add c9ac64100 Merge pull request #20105 from apache/fix/k-states add 86db174f8 perf(line): prebind context of `_changePolyState` function to current instance rather than create an new function to reduce runtime memory cost (fix #20151) add 65f625543 Merge pull request #20161 from apache/p
(echarts) branch feat-custom updated (a9f881ceb -> a33c528dc)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git from a9f881ceb fix(custom): use function instead of class add a33c528dc fix(custom): support renderItemArgs No new revisions were added by this update. Summary of changes: src/chart/custom/CustomSeries.ts | 2 ++ src/chart/custom/CustomView.ts | 6 -- src/model/Global.ts | 5 - test/custom-register.html| 5 - 4 files changed, 10 insertions(+), 8 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch time-inverse created (now 3bd3c7cf0)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch time-inverse in repository https://gitbox.apache.org/repos/asf/echarts.git at 3bd3c7cf0 fix(time): bar bandWidth with inversed time axis #20068 This branch includes the following new commits: new 3bd3c7cf0 fix(time): bar bandWidth with inversed time axis #20068 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: fix(time): bar bandWidth with inversed time axis #20068
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch time-inverse in repository https://gitbox.apache.org/repos/asf/echarts.git commit 3bd3c7cf00a6caa8975aa48db87473c2e2949a09 Author: Ovilia AuthorDate: Mon Aug 12 15:12:08 2024 +0800 fix(time): bar bandWidth with inversed time axis #20068 --- src/coord/axisHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coord/axisHelper.ts b/src/coord/axisHelper.ts index 53485fb31..76d42a8d1 100644 --- a/src/coord/axisHelper.ts +++ b/src/coord/axisHelper.ts @@ -115,7 +115,7 @@ function adjustScaleForOverflow( // Get Axis Length const axisExtent = model.axis.getExtent(); -const axisLength = axisExtent[1] - axisExtent[0]; +const axisLength = Math.abs(axisExtent[1] - axisExtent[0]); // Get bars on current base axis and calculate min and max overflow const barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #19534 from robin-gerling/fix-9265
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git commit 31fc8ccfb494bf67b0f555ebc2a55ddc324c86cc Merge: 114df2836 ad4d68a68 Author: Wenli Zhang AuthorDate: Fri Aug 9 10:30:09 2024 +0800 Merge pull request #19534 from robin-gerling/fix-9265 Fix 9265: Axis names overlap with labels src/component/axis/AxisBuilder.ts | 10 +-- src/coord/axisHelper.ts| 151 ++- src/coord/cartesian/AxisModel.ts | 15 +++- src/coord/cartesian/Grid.ts| 55 + test/axis-containLabelAndName.html | 158 + 5 files changed, 365 insertions(+), 24 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch v6 updated (114df2836 -> 31fc8ccfb)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch v6 in repository https://gitbox.apache.org/repos/asf/echarts.git from 114df2836 Merge pull request #20101 from apache/master add 945abd857 fix(grid): Initial version to resize grid by axis name size. close #9265 add a50b1c1c8 fix(grid): Deduplicate conditions to resize grid by axis name size. close #9265 add e90526c6e Merge branch 'apache:master' into fix-9265 add 1422365e1 fix(grid) Simplify default rotation computation of y-axis. close #9265 add ad4d68a68 fix(grid) Remove .option access and an unused import. close #9265 new 31fc8ccfb Merge pull request #19534 from robin-gerling/fix-9265 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/component/axis/AxisBuilder.ts | 10 +-- src/coord/axisHelper.ts| 151 ++- src/coord/cartesian/AxisModel.ts | 15 +++- src/coord/cartesian/Grid.ts| 55 + test/axis-containLabelAndName.html | 158 + 5 files changed, 365 insertions(+), 24 deletions(-) create mode 100755 test/axis-containLabelAndName.html - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom updated (25132fdb5 -> a9f881ceb)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git from 25132fdb5 fix(custom): use renderItem as registered custom name add a9f881ceb fix(custom): use function instead of class No new revisions were added by this update. Summary of changes: src/chart/custom/customSeriesRegister.ts | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 src/chart/custom/customSeriesRegister.ts - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom updated (197bacd2d -> 25132fdb5)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git from 197bacd2d feat(custom): custom series can be registered add 25132fdb5 fix(custom): use renderItem as registered custom name No new revisions were added by this update. Summary of changes: src/chart/custom/CustomSeriesManager.ts | 17 - src/chart/custom/CustomView.ts | 17 - src/core/echarts.ts | 4 ++-- src/model/Global.ts | 15 --- test/custom-register.html | 3 ++- 5 files changed, 20 insertions(+), 36 deletions(-) delete mode 100644 src/chart/custom/CustomSeriesManager.ts - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-custom created (now 197bacd2d)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git at 197bacd2d feat(custom): custom series can be registered This branch includes the following new commits: new 197bacd2d feat(custom): custom series can be registered The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: feat(custom): custom series can be registered
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat-custom in repository https://gitbox.apache.org/repos/asf/echarts.git commit 197bacd2d84a94e03dbfd27e6c620da0dc8247af Author: Ovilia AuthorDate: Mon Aug 5 17:33:09 2024 +0800 feat(custom): custom series can be registered --- src/chart/custom/CustomSeriesManager.ts | 17 ++ src/chart/custom/CustomView.ts | 6 ++- src/core/echarts.ts | 6 +++ src/model/Global.ts | 17 +- test/custom-register.html | 92 + 5 files changed, 135 insertions(+), 3 deletions(-) diff --git a/src/chart/custom/CustomSeriesManager.ts b/src/chart/custom/CustomSeriesManager.ts new file mode 100644 index 0..e4b1d6085 --- /dev/null +++ b/src/chart/custom/CustomSeriesManager.ts @@ -0,0 +1,17 @@ +import { CustomSeriesRenderItem } from './CustomSeries'; + +const customRenderers: {[type: string]: CustomSeriesRenderItem} = {}; + +class CustomSeriesManager { + +static register = function (type: string, creator: CustomSeriesRenderItem): void { +customRenderers[type] = creator; +}; + +static get = function (type: string): CustomSeriesRenderItem { +return customRenderers[type]; +} + +} + +export default CustomSeriesManager; diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts index ee4e244cf..0122deef7 100644 --- a/src/chart/custom/CustomView.ts +++ b/src/chart/custom/CustomView.ts @@ -591,7 +591,11 @@ function makeRenderItem( ecModel: GlobalModel, api: ExtensionAPI ) { -const renderItem = customSeries.get('renderItem'); +const type = customSeries.get('type').split('.'); +const customRenderer = type.length > 1 +? ecModel.getCustomRenderer(type[1]) +: null; +const renderItem = customRenderer || customSeries.get('renderItem'); const coordSys = customSeries.coordinateSystem; let prepareResult = {} as ReturnType; diff --git a/src/core/echarts.ts b/src/core/echarts.ts index 4ecb2c653..5b742da0e 100644 --- a/src/core/echarts.ts +++ b/src/core/echarts.ts @@ -51,6 +51,7 @@ import ComponentModel from '../model/Component'; import SeriesModel from '../model/Series'; import ComponentView, {ComponentViewConstructor} from '../view/Component'; import ChartView, {ChartViewConstructor} from '../view/Chart'; +import {CustomSeriesRenderItem} from '../chart/custom/CustomSeries'; import * as graphic from '../util/graphic'; import {getECData} from '../util/innerStore'; import { @@ -132,6 +133,7 @@ import lifecycle, { import { platformApi, setPlatformAPI } from 'zrender/src/core/platform'; import { getImpl } from './impl'; import type geoSourceManager from '../coord/geo/geoSourceManager'; +import CustomSeriesManager from '../chart/custom/CustomSeriesManager'; declare let global: any; @@ -2893,6 +2895,10 @@ export function getCoordinateSystemDimensions(type: string): DimensionDefinition } } +export function registerCustomSeries(seriesType: string, renderItem: CustomSeriesRenderItem) { +CustomSeriesManager.register(seriesType, renderItem); +} + export {registerLocale} from './locale'; /** diff --git a/src/model/Global.ts b/src/model/Global.ts index b845d7263..e59b8bc6f 100644 --- a/src/model/Global.ts +++ b/src/model/Global.ts @@ -62,6 +62,7 @@ import { concatInternalOptions } from './internalComponentCreator'; import { LocaleOption } from '../core/locale'; import {PaletteMixin} from './mixin/palette'; import { error, warn } from '../util/log'; +import CustomSeriesManager from '../chart/custom/CustomSeriesManager'; export interface GlobalModelSetOptionOpts { replaceMerge: ComponentMainType | ComponentMainType[]; @@ -161,6 +162,8 @@ class GlobalModel extends Model { private _optionManager: OptionManager; +private _customSeriesManager: CustomSeriesManager; + private _componentsMap: HashMap; /** @@ -410,14 +413,20 @@ class GlobalModel extends Model { } else { const isSeriesType = mainType === 'series'; + +let subType = resultItem.keyInfo.subType; +if (subType && subType.startsWith('custom.')) { +subType = 'custom'; +} + const ComponentModelClass = (ComponentModel as ComponentModelConstructor).getClass( -mainType, resultItem.keyInfo.subType, +mainType, +subType, !isSeriesType // Give a more detailed warn later if series don't exists
(echarts) 01/01: Merge pull request #20218 from semla/aria-exclude-columns
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 43797899e60a43efa2c0a8b17cab98271e23e9fc Merge: ce500cf22 b1a237448 Author: Wenli Zhang AuthorDate: Mon Aug 5 14:23:49 2024 +0800 Merge pull request #20218 from semla/aria-exclude-columns feat(aria): allows excluding data in aria-label src/util/types.ts| 3 +- src/visual/aria.ts | 5 +- test/ut/spec/series/aria-columns-exclude.test.ts | 97 3 files changed, 103 insertions(+), 2 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (ce500cf22 -> 43797899e)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from ce500cf22 feature(treemap): add custom cursor properties for treemap (#20113) add aeb078eb7 feat(aria): allows excluding data in aria-label add b1a237448 refactor(aria): rename property to exclude new 43797899e Merge pull request #20218 from semla/aria-exclude-columns The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/util/types.ts| 3 +- src/visual/aria.ts | 5 +- test/ut/spec/series/aria-columns-exclude.test.ts | 97 3 files changed, 103 insertions(+), 2 deletions(-) create mode 100644 test/ut/spec/series/aria-columns-exclude.test.ts - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat-scatter updated (b95d3791b -> e9fdf5fe0)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat-scatter in repository https://gitbox.apache.org/repos/asf/echarts.git from b95d3791b refactor(jitter): fix import type add e9fdf5fe0 test: add violin demo No new revisions were added by this update. Summary of changes: test/violin.html | 208 +++ 1 file changed, 208 insertions(+) create mode 100644 test/violin.html - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated: feature(treemap): add custom cursor properties for treemap (#20113)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git The following commit(s) were added to refs/heads/master by this push: new ce500cf22 feature(treemap): add custom cursor properties for treemap (#20113) ce500cf22 is described below commit ce500cf22a8413452e3d9da1dbe4df499bbf5dc2 Author: huanxi AuthorDate: Mon Jul 29 12:39:41 2024 +0800 feature(treemap): add custom cursor properties for treemap (#20113) --- src/chart/treemap/TreemapSeries.ts | 4 +- src/chart/treemap/TreemapView.ts | 3 + test/treemap-cursor.html | 193 + 3 files changed, 199 insertions(+), 1 deletion(-) diff --git a/src/chart/treemap/TreemapSeries.ts b/src/chart/treemap/TreemapSeries.ts index 571475e71..a38446ed8 100644 --- a/src/chart/treemap/TreemapSeries.ts +++ b/src/chart/treemap/TreemapSeries.ts @@ -144,7 +144,9 @@ export interface TreemapSeriesNodeItemOption extends TreemapSeriesVisualOption, color?: ColorString[] | 'none' -decal?: DecalObject[] | 'none' +decal?: DecalObject[] | 'none', + +cursor?: string } export interface TreemapSeriesOption diff --git a/src/chart/treemap/TreemapView.ts b/src/chart/treemap/TreemapView.ts index bc59c2854..a0b892e1e 100644 --- a/src/chart/treemap/TreemapView.ts +++ b/src/chart/treemap/TreemapView.ts @@ -877,6 +877,9 @@ function renderNode( // Only for enabling highlight/downplay. data.setItemGraphicEl(thisNode.dataIndex, group); +const cursorStyle = nodeModel.getShallow('cursor'); +cursorStyle && content.attr('cursor', cursorStyle); + enableHoverFocus(group, focusOrIndices, blurScope); } diff --git a/test/treemap-cursor.html b/test/treemap-cursor.html new file mode 100644 index 0..2a415d4cc --- /dev/null +++ b/test/treemap-cursor.html @@ -0,0 +1,193 @@ + + + + + + + + + + + + +.chart { +width: 100%; +height: 50%; +} + + + + + + + +require([ +'echarts' +], function (echarts) { + +var chart = echarts.init(document.getElementById('main1'), null, { + +}); + +chart.setOption({ +series: [ +{ +name: '矩形树图', +type: 'treemap', +label: { +normal: { +// show: false, +position: 'insideRight' +// position: ['100%', 10], +// textStyle: { +// align: 'right' +// } +}, +emphasis: { +show: true +} +}, +breadcrumb: { +emphasis: { +itemStyle: { +color: 'blue', +opacity: 0.6, +textStyle: { +color: 'green' +} +}, +} +}, +levels: [ +{ +itemStyle: { +normal: { +borderWidth: 15, +gapWidth: 30, +borderColor: '#999' +} +} +}, +{ +itemStyle: { +normal: { +borderWidth: 15, +gapWidth: 40, +borderColor: '#333' +} +} +}, +{ +itemStyle: { +normal: { +borderWidth: 10, +borderColor: '#70' +} +} +} +], +cursor:'crosshair', /* it should be
(echarts) branch feat/k deleted (was 0ac383d51)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/k in repository https://gitbox.apache.org/repos/asf/echarts.git was 0ac383d51 test(marker): update test case The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat/stock-marker updated (8c4a2d83b -> 0ac383d51)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/stock-marker in repository https://gitbox.apache.org/repos/asf/echarts.git from 8c4a2d83b test(marker): add test case for markline add 9766e2f4c test(marker): relative to coordinate add 0ac383d51 test(marker): update test case No new revisions were added by this update. Summary of changes: src/component/marker/MarkPointView.ts | 1 - src/component/marker/markerHelper.ts | 3 +- src/coord/polar/Polar.ts | 1 - test/markPoint-stock.html | 98 --- 4 files changed, 93 insertions(+), 10 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/02: test(marker): relative to coordinate
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat/k in repository https://gitbox.apache.org/repos/asf/echarts.git commit 9766e2f4c1e964fbc108b0f1370c4e6f547d89f1 Author: Ovilia AuthorDate: Tue Jul 16 19:07:37 2024 +0800 test(marker): relative to coordinate --- src/component/marker/MarkPointView.ts | 1 - src/component/marker/markerHelper.ts | 3 ++- src/coord/polar/Polar.ts | 1 - test/markPoint-stock.html | 25 - 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/component/marker/MarkPointView.ts b/src/component/marker/MarkPointView.ts index 054c0a5d9..0f8de138b 100644 --- a/src/component/marker/MarkPointView.ts +++ b/src/component/marker/MarkPointView.ts @@ -44,7 +44,6 @@ function updateMarkerLayout( const apiWidth = api.getWidth(); const apiHeight = api.getHeight(); const coordRect = coordSys.getArea && coordSys.getArea(); -console.log(coordSys) mpData.each(function (idx: number) { const itemModel = mpData.getItemModel(idx); const relativeTo = itemModel.get('relativeTo'); diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index 61acfd4d6..fdc6aedf0 100644 --- a/src/component/marker/markerHelper.ts +++ b/src/component/marker/markerHelper.ts @@ -144,8 +144,9 @@ export function dataTransform( } } // x y is provided -if ((item.coord == null || !isArray(dims)) && item.relativeTo === 'screen') { +if (item.coord == null || !isArray(dims)) { item.coord = []; +item.value = numCalculate(data, data.mapDimension(dims[1]), item.type); } else { // Each coord support max, min, average diff --git a/src/coord/polar/Polar.ts b/src/coord/polar/Polar.ts index 9ff3fb0e4..c70e1e81c 100644 --- a/src/coord/polar/Polar.ts +++ b/src/coord/polar/Polar.ts @@ -25,7 +25,6 @@ import GlobalModel from '../../model/Global'; import { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model'; import { ScaleDataValue } from '../../util/types'; import ExtensionAPI from '../../core/ExtensionAPI'; -import { BoundingRect } from 'zrender'; export const polarDimensions = ['radius', 'angle']; diff --git a/test/markPoint-stock.html b/test/markPoint-stock.html index e91d9344f..e831e3f6a 100644 --- a/test/markPoint-stock.html +++ b/test/markPoint-stock.html @@ -79,7 +79,7 @@ under the License. }, yAxis: { axisLabel: { -show: false, +// show: false, }, min: 'dataMin', max: 'dataMax' @@ -91,15 +91,30 @@ under the License. markPoint: { data: [{ type: 'min', -// x: 0, -// y: 0, -// relativeTo: 'coordinate' +x: 0, +y: 0, +relativeTo: 'coordinate' }, { type: 'max', x: 0, y: '100%', +relativeTo: 'coordinate' +}, { +type: 'min', +x: '100%', +y: 0, +name: 'abcd', +relativeTo: 'coordinate' +}, { +type: 'max', +// x: '100%', +// y: '100%', // relativeTo: 'coordinate' -}] +}], +// label: { +// show: true, +// formatter: 'x: {c}' +// } } } }; - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat/k created (now 0ac383d51)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/k in repository https://gitbox.apache.org/repos/asf/echarts.git at 0ac383d51 test(marker): update test case This branch includes the following new commits: new 9766e2f4c test(marker): relative to coordinate new 0ac383d51 test(marker): update test case The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 02/02: test(marker): update test case
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat/k in repository https://gitbox.apache.org/repos/asf/echarts.git commit 0ac383d51021c7be549a5a3e0b18bb13f74c4ec0 Author: Ovilia AuthorDate: Thu Jul 25 19:30:49 2024 +0800 test(marker): update test case --- test/markPoint-stock.html | 95 --- 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/test/markPoint-stock.html b/test/markPoint-stock.html index e831e3f6a..c21cc59f8 100644 --- a/test/markPoint-stock.html +++ b/test/markPoint-stock.html @@ -52,15 +52,25 @@ under the License. ], function (echarts) { var option; +const lastClose = 100; const data = []; let date = new Date('2024-07-11 9:30:00'); const endDate = new Date('2024-07-11 15:00:00'); -let value = 120; +let value = lastClose; +let max = -Number.MAX_VALUE; +let min = Number.MAX_VALUE; for (; date <= endDate;) { if (date < new Date('2024-07-11 11:30:00').getTime() || date > new Date('2024-07-11 13:00:00').getTime() ) { -value = value + Math.round((Math.random() - 0.5) * 20); +value = Math.max(0, value + Math.round((Math.random() - 0.5) * 20)); +} + +if (value > max) { +max = value; +} +if (value < min) { +min = value; } data.push([ date, @@ -79,7 +89,7 @@ under the License. }, yAxis: { axisLabel: { -// show: false, +show: false, }, min: 'dataMin', max: 'dataMax' @@ -89,32 +99,91 @@ under the License. data, showSymbol: false, markPoint: { +symbol: 'circle', +symbolSize: 0, +label: { +position: 'top', +distance: 0, +padding: 5, +textBorderColor: '#fff', +textBorderWidth: 2 +}, data: [{ type: 'min', x: 0, y: 0, -relativeTo: 'coordinate' +relativeTo: 'coordinate', +label: { +align: 'left', +verticalAlign: 'top', +color: min > lastClose ? 'red' : 'green', +} }, { type: 'max', x: 0, y: '100%', -relativeTo: 'coordinate' +relativeTo: 'coordinate', +label: { +align: 'left', +verticalAlign: 'bottom', +color: max > lastClose ? 'red' : 'green', +} +}, { +type: 'middle', +x: 0, +y: '50%', +relativeTo: 'coordinate', +label: { +align: 'left', +verticalAlign: 'middle', +formatter: () => { +return (max + min) / 2; +}, +color: (max + min) / 2 > lastClose ? 'red' : 'green', +} }, { type: 'min', x: '100%', y: 0, name: 'abcd', -relativeTo: 'coordinate' +relativeTo: 'coordinate', +label: { +align: 'right', +verticalAlign: 'top', +
(echarts) 01/01: fix(axis): ticks overflowing grid area with dataZoom #20185
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch fix/customValues in repository https://gitbox.apache.org/repos/asf/echarts.git commit 5fb9e9d5ec4785a8da196b4e5208a7161251aa17 Author: Ovilia AuthorDate: Wed Jul 24 14:50:46 2024 +0800 fix(axis): ticks overflowing grid area with dataZoom #20185 --- src/coord/axisTickLabelBuilder.ts | 9 +- test/axis-customTicks.html| 186 ++ 2 files changed, 193 insertions(+), 2 deletions(-) diff --git a/src/coord/axisTickLabelBuilder.ts b/src/coord/axisTickLabelBuilder.ts index e7f7bbb08..329ad6447 100644 --- a/src/coord/axisTickLabelBuilder.ts +++ b/src/coord/axisTickLabelBuilder.ts @@ -84,8 +84,11 @@ export function createAxisLabels(axis: Axis): { const custom = axis.getLabelModel().get('customValues'); if (custom) { const labelFormatter = makeLabelFormatter(axis); +const extent = axis.scale.getExtent(); +const tickNumbers = tickValuesToNumbers(axis, custom); +const ticks = zrUtil.filter(tickNumbers, val => val >= extent[0] && val <= extent[1]); return { -labels: tickValuesToNumbers(axis, custom).map(numval => { +labels: zrUtil.map(ticks, numval => { const tick = {value: numval}; return { formattedLabel: labelFormatter(tick), @@ -115,8 +118,10 @@ export function createAxisTicks(axis: Axis, tickModel: AxisBaseModel): { } { const custom = axis.getTickModel().get('customValues'); if (custom) { +const extent = axis.scale.getExtent(); +const tickNumbers = tickValuesToNumbers(axis, custom); return { -ticks: tickValuesToNumbers(axis, custom) +ticks: zrUtil.filter(tickNumbers, val => val >= extent[0] && val <= extent[1]) }; } // Only ordinal scale support tick interval diff --git a/test/axis-customTicks.html b/test/axis-customTicks.html index 24f9c7dc9..7f79f099d 100644 --- a/test/axis-customTicks.html +++ b/test/axis-customTicks.html @@ -38,6 +38,8 @@ under the License. + + require(['echarts'], function (echarts) { @@ -198,5 +200,189 @@ under the License. + +require(['echarts'], function (echarts) { +var option = { +grid: { +left: 300 +}, +dataZoom: [ +{ +show: true, +realtime: true, +start: 20, +end: 100 +}, +{ +type: 'inside', +realtime: true, +start: 20, +end: 100 +} +], +xAxis: { +axisTick: { +alignWithLabel: false, +customValues: ['a', 'c', 'd'] +}, +axisLabel: { +customValues: ['a', 'c', 'd'] +}, +type: 'category', +data: ['a', 'b', 'c', 'd'] +}, +yAxis: {}, +series: [ +{ +symbolSize: 8, +data: [ +['a', 34], +['b', 20], +['c', 23] +], +type: 'scatter' +} +] +}; + + +var chart = testHelper.create(echarts, 'main4', { +title: [ +'customValues should not overflow the grid (category axis)', +'`a` in the axis label should not be displayed' +], +option: option +}); +}); + + + +require(['echarts'], function (echarts) { +var laData = [[1, 3.47], [2, 7.84], [3, 2.01], [4, 4.20], [5, 3.87], [6, 1.50], [7, 2.56], [8, 6.40], [9, 1.74], [10, 2.96]]; + +var option = { +grid: {}, +dataZoom: [ +{ +show: true, +realtime: true, +start: 10, +end: 100 +}, +{ +
(echarts) branch fix/customValues created (now 5fb9e9d5e)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix/customValues in repository https://gitbox.apache.org/repos/asf/echarts.git at 5fb9e9d5e fix(axis): ticks overflowing grid area with dataZoom #20185 This branch includes the following new commits: new 5fb9e9d5e fix(axis): ticks overflowing grid area with dataZoom #20185 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20187 from apache/dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 11c5a12fd738c9a468467f26b904073f1f6290e2 Merge: 7a0663751 72e3f8016 Author: Wenli Zhang AuthorDate: Tue Jul 23 10:45:18 2024 +0800 Merge pull request #20187 from apache/dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4 chore(deps-dev): bump socket.io-parser from 3.3.3 to 3.3.4 in /test/runTest test/runTest/package-lock.json | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (7a0663751 -> 11c5a12fd)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 7a0663751 Merge pull request #20074 from liuyunzidian/fix-20070 add 72e3f8016 chore(deps-dev): bump socket.io-parser in /test/runTest new 11c5a12fd Merge pull request #20187 from apache/dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: test/runTest/package-lock.json | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4 deleted (was 72e3f8016)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch dependabot/npm_and_yarn/test/runTest/socket.io-parser-3.3.4 in repository https://gitbox.apache.org/repos/asf/echarts.git was 72e3f8016 chore(deps-dev): bump socket.io-parser in /test/runTest The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix/polar updated (645bd056d -> c36098a87)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix/polar in repository https://gitbox.apache.org/repos/asf/echarts.git from 645bd056d test(polar): add test case for polar bars with boundaryGap false add c36098a87 style(polar): fix lint No new revisions were added by this update. Summary of changes: src/coord/polar/polarCreator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch fix/polar created (now 645bd056d)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch fix/polar in repository https://gitbox.apache.org/repos/asf/echarts.git at 645bd056d test(polar): add test case for polar bars with boundaryGap false No new revisions were added by this update. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20074 from liuyunzidian/fix-20070
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 7a0663751b3a21aa2e27e3c5db7537776f46d914 Merge: 8e968f4f6 403dce221 Author: Wenli Zhang AuthorDate: Thu Jul 18 12:29:43 2024 +0800 Merge pull request #20074 from liuyunzidian/fix-20070 fix(pie): fix some labels may not show src/chart/pie/labelLayout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (8e968f4f6 -> 7a0663751)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 8e968f4f6 Merge pull request #20114 from adaelixir/feature-#20110 add 769bfef71 fix(pie): Missing pie chart label display. close #20070 add 403dce221 fix(pie): fix some labels may not show #20074 new 7a0663751 Merge pull request #20074 from liuyunzidian/fix-20070 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/chart/pie/labelLayout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (65f625543 -> 8e968f4f6)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 65f625543 Merge pull request #20161 from apache/perf/line-memory-cost add a4d803f6c feature(axis): add feature to remove SplitLine on specified tick new 8e968f4f6 Merge pull request #20114 from adaelixir/feature-#20110 The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: src/component/axis/CartesianAxisView.ts | 11 ++- src/coord/Axis.ts| 4 +- src/coord/axisCommonTypes.ts | 6 +- src/coord/axisDefault.ts | 2 + test/{clip-line-cap.html => axis-splitLine.html} | 86 +++- 5 files changed, 56 insertions(+), 53 deletions(-) copy test/{clip-line-cap.html => axis-splitLine.html} (56%) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20114 from adaelixir/feature-#20110
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 8e968f4f6dc9d42e27d0f2a2f58748467b766e67 Merge: 65f625543 a4d803f6c Author: Wenli Zhang AuthorDate: Thu Jul 18 12:26:31 2024 +0800 Merge pull request #20114 from adaelixir/feature-#20110 feature(axis): add showMin/MaxLine to splitline in coordinate axis src/component/axis/CartesianAxisView.ts | 11 - src/coord/Axis.ts | 4 +- src/coord/axisCommonTypes.ts| 6 ++- src/coord/axisDefault.ts| 2 + test/axis-splitLine.html| 83 + 5 files changed, 101 insertions(+), 5 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 02/02: test(marker): add test case for markline
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat/stock-marker in repository https://gitbox.apache.org/repos/asf/echarts.git commit 8c4a2d83b07143696dd8f9c4fdbbdc1d283503fb Author: Ovilia AuthorDate: Fri Jul 12 12:01:56 2024 +0800 test(marker): add test case for markline --- test/markPoint-stock.html | 123 ++ 1 file changed, 123 insertions(+) diff --git a/test/markPoint-stock.html b/test/markPoint-stock.html new file mode 100644 index 0..e91d9344f --- /dev/null +++ b/test/markPoint-stock.html @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +require([ +'echarts', +// 'map/js/china', +// './data/nutrients.json' +], function (echarts) { +var option; + +const data = []; +let date = new Date('2024-07-11 9:30:00'); +const endDate = new Date('2024-07-11 15:00:00'); +let value = 120; +for (; date <= endDate;) { +if (date < new Date('2024-07-11 11:30:00').getTime() +|| date > new Date('2024-07-11 13:00:00').getTime() +) { +value = value + Math.round((Math.random() - 0.5) * 20); +} +data.push([ +date, +value +]); +date = new Date(date.getTime() + 1000 * 60); +} + +option = { +xAxis: { +type: 'time', +axisLabel: { +showMinLabel: true, +showMaxLabel: true, +} +}, +yAxis: { +axisLabel: { +show: false, +}, +min: 'dataMin', +max: 'dataMax' +}, +series: { +type: 'line', +data, +showSymbol: false, +markPoint: { +data: [{ +type: 'min', +// x: 0, +// y: 0, +// relativeTo: 'coordinate' +}, { +type: 'max', +x: 0, +y: '100%', +// relativeTo: 'coordinate' +}] +} +} +}; + +var chart = testHelper.create(echarts, 'main0', { +title: [ +'Test Case Description of main0', +'(Muliple lines and **emphasis** are supported in description)' +], +option: option +// height: 300, +// buttons: [{text: 'btn-txt', onclick: function () {}}], +// recordCanvas: true, +}); +}); + + + + + + - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/02: feat(marker): relativeTo
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch feat/stock-marker in repository https://gitbox.apache.org/repos/asf/echarts.git commit ec7d082293f7979b0c137a4fbcadf449c2e4999f Author: Ovilia AuthorDate: Thu Jul 11 18:28:19 2024 +0800 feat(marker): relativeTo --- src/component/marker/MarkPointModel.ts | 1 + src/component/marker/MarkPointView.ts | 22 -- src/component/marker/MarkerModel.ts| 1 + src/component/marker/markerHelper.ts | 2 +- src/coord/CoordinateSystem.ts | 6 +- src/coord/polar/Polar.ts | 9 - 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/component/marker/MarkPointModel.ts b/src/component/marker/MarkPointModel.ts index 1b672317c..5fc5c59f4 100644 --- a/src/component/marker/MarkPointModel.ts +++ b/src/component/marker/MarkPointModel.ts @@ -43,6 +43,7 @@ export interface MarkPointDataItemOption extends SymbolOptionMixin, MarkerPositionOption { name: string +relativeTo: 'screen' | 'coordinate' } export interface MarkPointOption extends MarkerOption, diff --git a/src/component/marker/MarkPointView.ts b/src/component/marker/MarkPointView.ts index 3e4499c0d..054c0a5d9 100644 --- a/src/component/marker/MarkPointView.ts +++ b/src/component/marker/MarkPointView.ts @@ -41,11 +41,29 @@ function updateMarkerLayout( api: ExtensionAPI ) { const coordSys = seriesModel.coordinateSystem; +const apiWidth = api.getWidth(); +const apiHeight = api.getHeight(); +const coordRect = coordSys.getArea && coordSys.getArea(); +console.log(coordSys) mpData.each(function (idx: number) { const itemModel = mpData.getItemModel(idx); +const relativeTo = itemModel.get('relativeTo'); +const width = relativeTo === 'coordinate' +? coordRect ? coordRect.width : 0 +: apiWidth; +const height = relativeTo === 'coordinate' +? coordRect ? coordRect.height : 0 +: apiHeight; +const left = relativeTo === 'coordinate' +? coordRect ? coordRect.x : 0 +: 0; +const top = relativeTo === 'coordinate' +? coordRect ? coordRect.y : 0 +: 0; + let point; -const xPx = numberUtil.parsePercent(itemModel.get('x'), api.getWidth()); -const yPx = numberUtil.parsePercent(itemModel.get('y'), api.getHeight()); +const xPx = numberUtil.parsePercent(itemModel.get('x'), width) + left; +const yPx = numberUtil.parsePercent(itemModel.get('y'), height) + top; if (!isNaN(xPx) && !isNaN(yPx)) { point = [xPx, yPx]; } diff --git a/src/component/marker/MarkerModel.ts b/src/component/marker/MarkerModel.ts index 28d29a576..9699278c3 100644 --- a/src/component/marker/MarkerModel.ts +++ b/src/component/marker/MarkerModel.ts @@ -53,6 +53,7 @@ export interface MarkerPositionOption { // Absolute position, px or percent string x?: number | string y?: number | string +relativeTo?: 'screen' | 'coordinate' /** * Coord on any coordinate system diff --git a/src/component/marker/markerHelper.ts b/src/component/marker/markerHelper.ts index f5e5b7ddf..61acfd4d6 100644 --- a/src/component/marker/markerHelper.ts +++ b/src/component/marker/markerHelper.ts @@ -144,7 +144,7 @@ export function dataTransform( } } // x y is provided -if (item.coord == null || !isArray(dims)) { +if ((item.coord == null || !isArray(dims)) && item.relativeTo === 'screen') { item.coord = []; } else { diff --git a/src/coord/CoordinateSystem.ts b/src/coord/CoordinateSystem.ts index 8c778ab83..ea17e8a9a 100644 --- a/src/coord/CoordinateSystem.ts +++ b/src/coord/CoordinateSystem.ts @@ -174,7 +174,11 @@ export interface CoordinateSystemHostModel extends ComponentModel { * It is used to clip the graphic elements with the contain methods. */ export interface CoordinateSystemClipArea { -contain(x: number, y: number): boolean +x: number; +y: number; +width: number; +height: number; +contain(x: number, y: number): boolean; } export function isCoordinateSystemType( diff --git a/src/coord/polar/Polar.ts b/src/coord/polar/Polar.ts index e7b9db6cc..9ff3fb0e4 100644 --- a/src/coord/polar/Polar.ts +++ b/src/coord/polar/Polar.ts @@ -25,6 +25,7 @@ import GlobalModel from '../../model/Global'; import { ParsedModelFinder, ParsedModelFinderKnown } from '../../util/model'; import { ScaleDataValue } from '../../util/types'; import ExtensionAPI from '../../core/ExtensionAPI'; +import { BoundingRect } from 'zrender'; export const polarDimensions = ['radius', 'angle']; @@
(echarts) branch feat/stock-marker created (now 8c4a2d83b)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/stock-marker in repository https://gitbox.apache.org/repos/asf/echarts.git at 8c4a2d83b test(marker): add test case for markline This branch includes the following new commits: new ec7d08229 feat(marker): relativeTo new 8c4a2d83b test(marker): add test case for markline The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch workflow/pr-preview deleted (was 33249dcdc)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch workflow/pr-preview in repository https://gitbox.apache.org/repos/asf/echarts.git was 33249dcdc chore(workflow): fix pr-preview workflow The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20144 from apache/workflow/pr-preview
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit 4d3cb2cc2d25cd89f5cb3e5c6e14f19ce7c81246 Merge: c3291928f 33249dcdc Author: Wenli Zhang AuthorDate: Mon Jul 15 15:49:40 2024 +0800 Merge pull request #20144 from apache/workflow/pr-preview chore(workflow): fix pr-preview workflow .github/workflows/pr-preview.yml | 3 +++ 1 file changed, 3 insertions(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (c3291928f -> 4d3cb2cc2)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from c3291928f Merge pull request #20123 from apache/workspace-ts-prompt add 33249dcdc chore(workflow): fix pr-preview workflow new 4d3cb2cc2 Merge pull request #20144 from apache/workflow/pr-preview The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .github/workflows/pr-preview.yml | 3 +++ 1 file changed, 3 insertions(+) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch workspace-ts-prompt deleted (was 35fa0cb70)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch workspace-ts-prompt in repository https://gitbox.apache.org/repos/asf/echarts.git was 35fa0cb70 chore: enable prompt to use typescript from workspace The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository. - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) 01/01: Merge pull request #20123 from apache/workspace-ts-prompt
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git commit c3291928f9a3a8ad59b88db390f14c7d344f2f17 Merge: 369cb0350 35fa0cb70 Author: Wenli Zhang AuthorDate: Thu Jul 11 14:58:55 2024 +0800 Merge pull request #20123 from apache/workspace-ts-prompt chore: enable prompt to use typescript from workspace .vscode/settings.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch master updated (369cb0350 -> c3291928f)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/echarts.git from 369cb0350 fix(custom): grid area clipping in custom series #19993 (#20043) add 35fa0cb70 chore: enable prompt to use typescript from workspace new c3291928f Merge pull request #20123 from apache/workspace-ts-prompt The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .vscode/settings.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org
(echarts) branch feat/break-axis updated (567331115 -> e53f6cad3)
This is an automated email from the ASF dual-hosted git repository. ovilia pushed a change to branch feat/break-axis in repository https://gitbox.apache.org/repos/asf/echarts.git from 567331115 fix(break): fix category add 75e22aec1 feat(break-axis): fix margin cases add e53f6cad3 fix: disable category axes No new revisions were added by this update. Summary of changes: src/component/axis/CartesianAxisView.ts | 6 +++- src/component/axis/axisBreakHelper.ts | 6 ++-- src/coord/Axis.ts | 29 +-- src/coord/axisHelper.ts | 3 +- src/coord/axisTickLabelBuilder.ts | 4 +-- src/coord/cartesian/Cartesian2D.ts | 2 -- src/label/labelLayoutHelper.ts | 6 src/layout/barGrid.ts | 2 +- src/scale/Interval.ts | 2 +- src/scale/Ordinal.ts| 9 ++--- src/scale/Scale.ts | 4 ++- src/scale/helper.ts | 17 + test/axis-break.html| 63 +++-- 13 files changed, 105 insertions(+), 48 deletions(-) - To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org