react-minimal-pie-chart 9.1.1 β 9.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -28
- package/dist/Label.d.ts +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +2 -2
- package/package.json +13 -11
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ type LabelRenderProps = {
|
|
|
147
147
|
y: number;
|
|
148
148
|
dx: number;
|
|
149
149
|
dy: number;
|
|
150
|
-
textAnchor:
|
|
150
|
+
textAnchor: 'start' | 'middle' | 'end' | 'inherit' | undefined;
|
|
151
151
|
dataEntry: {
|
|
152
152
|
...props.data[dataIndex]
|
|
153
153
|
// props.data entry relative to the label extended with:
|
|
@@ -196,6 +196,14 @@ Please consider that [`Math.sign`](https://developer.mozilla.org/en-US/docs/Web/
|
|
|
196
196
|
|
|
197
197
|
## Misc
|
|
198
198
|
|
|
199
|
+
### Dry-run the release
|
|
200
|
+
|
|
201
|
+
Validate that a release would succeed without publishing anything to npm:
|
|
202
|
+
|
|
203
|
+
- Open [`Actions > Release (dry run)`](https://github.com/toomuchdesign/react-minimal-pie-chart/actions/workflows/release-dry-run.yml) and click `Run workflow`
|
|
204
|
+
|
|
205
|
+
It runs `changeset publish-plan` (which packages/versions would be published) and `npm publish --dry-run` (builds and inspects the tarball contents). Neither command authenticates or uploads to npm.
|
|
206
|
+
|
|
199
207
|
### How svg arc paths work?
|
|
200
208
|
|
|
201
209
|
- http://xahlee.info/js/svg_circle_arc.html
|
|
@@ -223,33 +231,38 @@ Thanks to you all ([emoji key](https://github.com/kentcdodds/all-contributors#em
|
|
|
223
231
|
<!-- prettier-ignore-start -->
|
|
224
232
|
<!-- markdownlint-disable -->
|
|
225
233
|
<table>
|
|
226
|
-
<
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
234
|
+
<tbody>
|
|
235
|
+
<tr>
|
|
236
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.andreacarraro.it"><img src="https://avatars3.githubusercontent.com/u/4573549?v=4?s=100" width="100px;" alt="Andrea Carraro"/><br /><sub><b>Andrea Carraro</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=toomuchdesign" title="Code">π»</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=toomuchdesign" title="Documentation">π</a> <a href="#infra-toomuchdesign" title="Infrastructure (Hosting, Build-Tools, etc)">π</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=toomuchdesign" title="Tests">β οΈ</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/pulls?q=is%3Apr+reviewed-by%3Atoomuchdesign" title="Reviewed Pull Requests">π</a></td>
|
|
237
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rufman"><img src="https://avatars3.githubusercontent.com/u/1128559?v=4?s=100" width="100px;" alt="Stephane Rufer"/><br /><sub><b>Stephane Rufer</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Arufman" title="Bug reports">π</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=rufman" title="Code">π»</a></td>
|
|
238
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jaaberg"><img src="https://avatars3.githubusercontent.com/u/1413255?v=4?s=100" width="100px;" alt="JΓΈrgen Aaberg"/><br /><sub><b>JΓΈrgen Aaberg</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=jaaberg" title="Code">π»</a></td>
|
|
239
|
+
<td align="center" valign="top" width="14.28%"><a href="http://www.tobiahrex.com"><img src="https://avatars3.githubusercontent.com/u/16377119?v=4?s=100" width="100px;" alt="Tobiah Rex"/><br /><sub><b>Tobiah Rex</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3ATobiahRex" title="Bug reports">π</a></td>
|
|
240
|
+
<td align="center" valign="top" width="14.28%"><a href="https://edwardxiao.com"><img src="https://avatars2.githubusercontent.com/u/11728228?v=4?s=100" width="100px;" alt="Edward Xiao"/><br /><sub><b>Edward Xiao</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Aedwardfhsiao" title="Bug reports">π</a></td>
|
|
241
|
+
<td align="center" valign="top" width="14.28%"><a href="https://keybase.io/konsumer"><img src="https://avatars1.githubusercontent.com/u/83857?v=4?s=100" width="100px;" alt="David Konsumer"/><br /><sub><b>David Konsumer</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=konsumer" title="Code">π»</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=konsumer" title="Documentation">π</a> <a href="#example-konsumer" title="Examples">π‘</a> <a href="#ideas-konsumer" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
242
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nehoraigold"><img src="https://avatars2.githubusercontent.com/u/44398222?v=4?s=100" width="100px;" alt="Ori"/><br /><sub><b>Ori</b></sub></a><br /><a href="#ideas-nehoraigold" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
243
|
+
</tr>
|
|
244
|
+
<tr>
|
|
245
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.manos.im/"><img src="https://avatars3.githubusercontent.com/u/6333409?v=4?s=100" width="100px;" alt="Emmanouil Konstantinidis"/><br /><sub><b>Emmanouil Konstantinidis</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Amanosim" title="Bug reports">π</a></td>
|
|
246
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuruc"><img src="https://avatars0.githubusercontent.com/u/5884342?v=4?s=100" width="100px;" alt="yuruc"/><br /><sub><b>yuruc</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=yuruc" title="Code">π»</a></td>
|
|
247
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/luca-schiavone-7270a8138/"><img src="https://avatars1.githubusercontent.com/u/16616566?v=4?s=100" width="100px;" alt="luca-esse "/><br /><sub><b>luca-esse </b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Aluca-esse" title="Bug reports">π</a></td>
|
|
248
|
+
<td align="center" valign="top" width="14.28%"><a href="http://twitter.com/Osuka42"><img src="https://avatars1.githubusercontent.com/u/5117006?v=4?s=100" width="100px;" alt="Oscar Mendoza"/><br /><sub><b>Oscar Mendoza</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3AOsuka42g" title="Bug reports">π</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=Osuka42g" title="Code">π»</a></td>
|
|
249
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/damien-git"><img src="https://avatars0.githubusercontent.com/u/7503971?v=4?s=100" width="100px;" alt="damien-git"/><br /><sub><b>damien-git</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Adamien-git" title="Bug reports">π</a> <a href="#ideas-damien-git" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
250
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/vianneystroebel/"><img src="https://avatars0.githubusercontent.com/u/628818?v=4?s=100" width="100px;" alt="Vianney Stroebel"/><br /><sub><b>Vianney Stroebel</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Avibl" title="Bug reports">π</a> <a href="#ideas-vibl" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
251
|
+
<td align="center" valign="top" width="14.28%"><a href="http://xumi.fr"><img src="https://avatars0.githubusercontent.com/u/204001?v=4?s=100" width="100px;" alt="Maxime Zielony"/><br /><sub><b>Maxime Zielony</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Axumi" title="Bug reports">π</a> <a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=xumi" title="Code">π»</a></td>
|
|
252
|
+
</tr>
|
|
253
|
+
<tr>
|
|
254
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/razked"><img src="https://avatars0.githubusercontent.com/u/39411034?v=4?s=100" width="100px;" alt="Raz Kedem"/><br /><sub><b>Raz Kedem</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Arazked" title="Bug reports">π</a></td>
|
|
255
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/slumbering"><img src="https://avatars2.githubusercontent.com/u/1186424?v=4?s=100" width="100px;" alt="Blocksmith"/><br /><sub><b>Blocksmith</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Aslumbering" title="Bug reports">π</a></td>
|
|
256
|
+
<td align="center" valign="top" width="14.28%"><a href="http://jamietalbot.com"><img src="https://avatars0.githubusercontent.com/u/425787?v=4?s=100" width="100px;" alt="Jamie Talbot"/><br /><sub><b>Jamie Talbot</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Amajelbstoat" title="Bug reports">π</a></td>
|
|
257
|
+
<td align="center" valign="top" width="14.28%"><a href="http://timeslikethese.ca"><img src="https://avatars1.githubusercontent.com/u/22269057?v=4?s=100" width="100px;" alt="Oscar Yixuan Chen"/><br /><sub><b>Oscar Yixuan Chen</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3Aairoscar" title="Bug reports">π</a></td>
|
|
258
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RuiRocha1991"><img src="https://avatars2.githubusercontent.com/u/29250466?v=4?s=100" width="100px;" alt="RuiRocha1991"/><br /><sub><b>RuiRocha1991</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3ARuiRocha1991" title="Bug reports">π</a></td>
|
|
259
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Romaboy"><img src="https://avatars0.githubusercontent.com/u/42248135?v=4?s=100" width="100px;" alt="Roman Kushyn"/><br /><sub><b>Roman Kushyn</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/issues?q=author%3ARomaboy" title="Bug reports">π</a></td>
|
|
260
|
+
<td align="center" valign="top" width="14.28%"><a href="https://bogas04.github.io/"><img src="https://avatars.githubusercontent.com/u/6177621?v=4?s=100" width="100px;" alt="Divjot Singh"/><br /><sub><b>Divjot Singh</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=bogas04" title="Code">π»</a></td>
|
|
261
|
+
</tr>
|
|
262
|
+
<tr>
|
|
263
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/haagvivi"><img src="https://avatars.githubusercontent.com/u/5496792?v=4?s=100" width="100px;" alt="Vivien HAAG"/><br /><sub><b>Vivien HAAG</b></sub></a><br /><a href="https://github.com/toomuchdesign/react-minimal-pie-chart/commits?author=haagvivi" title="Code">π»</a></td>
|
|
264
|
+
</tr>
|
|
265
|
+
</tbody>
|
|
253
266
|
</table>
|
|
254
267
|
|
|
255
268
|
<!-- markdownlint-restore -->
|
package/dist/Label.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type LabelRenderProps<DataEntry extends BaseDataEntry> = {
|
|
|
6
6
|
y: number;
|
|
7
7
|
dx: number;
|
|
8
8
|
dy: number;
|
|
9
|
-
textAnchor:
|
|
9
|
+
textAnchor: 'start' | 'middle' | 'end' | 'inherit' | undefined;
|
|
10
10
|
dataEntry: ExtendedData<DataEntry>[number];
|
|
11
11
|
dataIndex: number;
|
|
12
12
|
style?: CSSProperties;
|
package/dist/index.cjs.js
CHANGED
|
@@ -154,12 +154,12 @@ function ReactMinimalPieChartPath({ cx, cy, lengthAngle, lineWidth, radius, shif
|
|
|
154
154
|
// Animate/hide paths with "stroke-dasharray" + "stroke-dashoffset"
|
|
155
155
|
// https://css-tricks.com/svg-line-animation-works/
|
|
156
156
|
if (isNumber(reveal)) {
|
|
157
|
-
const pathLength =
|
|
157
|
+
const pathLength = pathRadius * degreesToRadians(lengthAngle);
|
|
158
158
|
strokeDasharray = Math.abs(pathLength);
|
|
159
159
|
strokeDashoffset =
|
|
160
160
|
strokeDasharray - extractPercentage(strokeDasharray, reveal);
|
|
161
161
|
}
|
|
162
|
-
return (React.createElement("path", { d: pathCommands, fill: "none", strokeWidth: lineWidth, strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset, strokeLinecap: rounded ? 'round' : undefined, ...props }, title && React.createElement("title", null, title)));
|
|
162
|
+
return (React.createElement("path", { d: pathCommands, fill: "none", strokeWidth: lineWidth, strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset, strokeLinecap: rounded ? 'round' : undefined, ...props }, title != null && React.createElement("title", null, title)));
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
function combineSegmentTransitionsStyle(duration, easing, customStyle) {
|
package/dist/index.esm.js
CHANGED
|
@@ -152,12 +152,12 @@ function ReactMinimalPieChartPath({ cx, cy, lengthAngle, lineWidth, radius, shif
|
|
|
152
152
|
// Animate/hide paths with "stroke-dasharray" + "stroke-dashoffset"
|
|
153
153
|
// https://css-tricks.com/svg-line-animation-works/
|
|
154
154
|
if (isNumber(reveal)) {
|
|
155
|
-
const pathLength =
|
|
155
|
+
const pathLength = pathRadius * degreesToRadians(lengthAngle);
|
|
156
156
|
strokeDasharray = Math.abs(pathLength);
|
|
157
157
|
strokeDashoffset =
|
|
158
158
|
strokeDasharray - extractPercentage(strokeDasharray, reveal);
|
|
159
159
|
}
|
|
160
|
-
return (React.createElement("path", { d: pathCommands, fill: "none", strokeWidth: lineWidth, strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset, strokeLinecap: rounded ? 'round' : undefined, ...props }, title && React.createElement("title", null, title)));
|
|
160
|
+
return (React.createElement("path", { d: pathCommands, fill: "none", strokeWidth: lineWidth, strokeDasharray: strokeDasharray, strokeDashoffset: strokeDashoffset, strokeLinecap: rounded ? 'round' : undefined, ...props }, title != null && React.createElement("title", null, title)));
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
function combineSegmentTransitionsStyle(duration, easing, customStyle) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-minimal-pie-chart",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.3",
|
|
4
4
|
"description": "Lightweight but versatile SVG pie/donut charts for React",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -24,10 +24,8 @@
|
|
|
24
24
|
"build:types": "tsc -p tsconfig.build.json",
|
|
25
25
|
"format:check": "prettier . --check",
|
|
26
26
|
"format:fix": "npm run format:check -- --write",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"postversion": "git push && git push --tags",
|
|
30
|
-
"prepare": "npx simple-git-hooks && npm run test -- --run && npm run test:source && npm run build && npm run test:bundles",
|
|
27
|
+
"prepare": "npx simple-git-hooks && npm run test:source && npm run test -- --run && npm run build && npm run test:bundles",
|
|
28
|
+
"release": "npm run prepare && npx changeset publish",
|
|
31
29
|
"start": "storybook dev",
|
|
32
30
|
"storybook:build": "storybook build"
|
|
33
31
|
},
|
|
@@ -39,6 +37,9 @@
|
|
|
39
37
|
"chart",
|
|
40
38
|
"typescript"
|
|
41
39
|
],
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
42
43
|
"repository": {
|
|
43
44
|
"type": "git",
|
|
44
45
|
"url": "git+https://github.com/toomuchdesign/react-minimal-pie-chart.git"
|
|
@@ -50,10 +51,11 @@
|
|
|
50
51
|
"react-dom": "^16.8.0 || ^17 || ^18 || ^19"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"@changesets/
|
|
54
|
+
"@changesets/changelog-github": "^1.0.1",
|
|
55
|
+
"@changesets/cli": "^3.0.3",
|
|
54
56
|
"@rollup/plugin-typescript": "^12.1.1",
|
|
55
57
|
"@schwingbat/relative-angle": "^1.0.0",
|
|
56
|
-
"@size-limit/preset-small-lib": "^
|
|
58
|
+
"@size-limit/preset-small-lib": "^12.0.0",
|
|
57
59
|
"@storybook/addon-essentials": "^8.1.6",
|
|
58
60
|
"@storybook/react": "^8.1.6",
|
|
59
61
|
"@storybook/react-vite": "^8.1.6",
|
|
@@ -65,19 +67,19 @@
|
|
|
65
67
|
"@types/react": "^19.0.0",
|
|
66
68
|
"@types/react-dom": "^19.0.0",
|
|
67
69
|
"@types/svg-path-parser": "^1.1.6",
|
|
68
|
-
"@vitest/coverage-v8": "^
|
|
69
|
-
"jsdom": "^
|
|
70
|
+
"@vitest/coverage-v8": "^4.0.1",
|
|
71
|
+
"jsdom": "^29.0.1",
|
|
70
72
|
"prettier": "^3.2.5",
|
|
71
73
|
"react": "^19.0.0",
|
|
72
74
|
"react-dom": "^19.0.0",
|
|
73
75
|
"react-tooltip": "^4.5.1",
|
|
74
76
|
"rollup": "^4.18.0",
|
|
75
77
|
"simple-git-hooks": "^2.11.1",
|
|
76
|
-
"size-limit": "^
|
|
78
|
+
"size-limit": "^12.0.0",
|
|
77
79
|
"storybook": "^8.1.6",
|
|
78
80
|
"svg-path-parser": "^1.1.0",
|
|
79
81
|
"typescript": "^5.4.5",
|
|
80
|
-
"vitest": "^
|
|
82
|
+
"vitest": "^4.0.1"
|
|
81
83
|
},
|
|
82
84
|
"size-limit": [
|
|
83
85
|
{
|