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 <[email protected]>
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/<series-name>
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: [email protected]
For additional commands, e-mail: [email protected]