react-minimal-pie-chart 8.0.1 β 8.3.0
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 +29 -22
- package/dist/index.js +20 -21
- package/dist/index.js.map +1 -1
- package/es/index.js +11 -14
- package/es/index.js.map +1 -1
- package/lib/index.js +20 -22
- package/lib/index.js.map +1 -1
- package/package.json +35 -36
- package/types/Chart/Chart.d.ts +2 -3
- package/types/Chart/index.d.ts +1 -1
- package/types/Label.d.ts +2 -5
- package/types/Path.d.ts +2 -5
- package/CHANGELOG.md +0 -244
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Because [Recharts][recharts-github] is awesome, but when you just need a simple
|
|
|
21
21
|
|
|
22
22
|
| | Size<br>by Bundlefobia | Benchmark Size \* | Loading time<br>on a slow 3g \* |
|
|
23
23
|
| :----------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :---------------: | :-----------------------------: |
|
|
24
|
-
| react-minimal-pie-chart (_v8.
|
|
24
|
+
| react-minimal-pie-chart (_v8.2.0_) | [![Bundle size: React minimal pie chart][bundlephobia-badge]][bundlephobia] | 1.83 KB | ~38 ms |
|
|
25
25
|
| [rechart][recharts-github] (_v1.8.5_) | [![Bundle size: Recharts][recharts-bundlephobia-badge]][recharts-bundlephobia] | 96.9 KB | ~1900 ms |
|
|
26
26
|
| [victory-pie][victory-pie-github] (_v34.1.3_) | [![Bundle size: Victory pie][victory-pie-bundlephobia-badge]][victory-pie-bundlephobia] | 50.5 KB | ~1100 ms |
|
|
27
27
|
| [react-apexcharts][react-apexcharts-github] (_v1.3.7_) | [![Bundle size: React apec charts][react-apexcharts-bundlephobia-badge]][react-apexcharts-bundlephobia] | 114.6 KB | ~2300 ms |
|
|
@@ -49,6 +49,8 @@ If you don't use a package manager, `react-minimal-pie-chart` exposes also an `U
|
|
|
49
49
|
https://unpkg.com/react-minimal-pie-chart/dist/index.js
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
+
Minimum supported **Typescript** version: >= `3.8`
|
|
53
|
+
|
|
52
54
|
## Usage
|
|
53
55
|
|
|
54
56
|
```js
|
|
@@ -207,6 +209,7 @@ This library uses the `stroke-dasharray` + `stroke-dashoffset` animation strateg
|
|
|
207
209
|
- Consider abstracting React bindings to re-use business logic with other frameworks
|
|
208
210
|
- Remove `defaultProps` in favour of JS default arguments
|
|
209
211
|
- Provide a way to supply `svg` element with any extra prop
|
|
212
|
+
- Consider removing `import type` declaration from generated type definition files (if possible) to ensure Typescript 3.0+ backward compatibility
|
|
210
213
|
|
|
211
214
|
## Contributors
|
|
212
215
|
|
|
@@ -217,37 +220,41 @@ Thanks to you all ([emoji key](https://github.com/kentcdodds/all-contributors#em
|
|
|
217
220
|
<!-- markdownlint-disable -->
|
|
218
221
|
<table>
|
|
219
222
|
<tr>
|
|
220
|
-
<td align="center"><a href="http://www.andreacarraro.it"><img src="https://avatars3.githubusercontent.com/u/4573549?v=4" width="100px;" alt=""/><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>
|
|
221
|
-
<td align="center"><a href="https://github.com/rufman"><img src="https://avatars3.githubusercontent.com/u/1128559?v=4" width="100px;" alt=""/><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>
|
|
222
|
-
<td align="center"><a href="https://github.com/jaaberg"><img src="https://avatars3.githubusercontent.com/u/1413255?v=4" width="100px;" alt=""/><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>
|
|
223
|
-
<td align="center"><a href="http://www.tobiahrex.com"><img src="https://avatars3.githubusercontent.com/u/16377119?v=4" width="100px;" alt=""/><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>
|
|
224
|
-
<td align="center"><a href="https://edwardxiao.com"><img src="https://avatars2.githubusercontent.com/u/11728228?v=4" width="100px;" alt=""/><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>
|
|
225
|
-
<td align="center"><a href="https://keybase.io/konsumer"><img src="https://avatars1.githubusercontent.com/u/83857?v=4" width="100px;" alt=""/><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>
|
|
226
|
-
<td align="center"><a href="https://github.com/nehoraigold"><img src="https://avatars2.githubusercontent.com/u/44398222?v=4" width="100px;" alt=""/><br /><sub><b>Ori</b></sub></a><br /><a href="#ideas-nehoraigold" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
223
|
+
<td align="center"><a href="http://www.andreacarraro.it"><img src="https://avatars3.githubusercontent.com/u/4573549?v=4?s=100" width="100px;" alt=""/><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>
|
|
224
|
+
<td align="center"><a href="https://github.com/rufman"><img src="https://avatars3.githubusercontent.com/u/1128559?v=4?s=100" width="100px;" alt=""/><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>
|
|
225
|
+
<td align="center"><a href="https://github.com/jaaberg"><img src="https://avatars3.githubusercontent.com/u/1413255?v=4?s=100" width="100px;" alt=""/><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>
|
|
226
|
+
<td align="center"><a href="http://www.tobiahrex.com"><img src="https://avatars3.githubusercontent.com/u/16377119?v=4?s=100" width="100px;" alt=""/><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>
|
|
227
|
+
<td align="center"><a href="https://edwardxiao.com"><img src="https://avatars2.githubusercontent.com/u/11728228?v=4?s=100" width="100px;" alt=""/><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>
|
|
228
|
+
<td align="center"><a href="https://keybase.io/konsumer"><img src="https://avatars1.githubusercontent.com/u/83857?v=4?s=100" width="100px;" alt=""/><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>
|
|
229
|
+
<td align="center"><a href="https://github.com/nehoraigold"><img src="https://avatars2.githubusercontent.com/u/44398222?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ori</b></sub></a><br /><a href="#ideas-nehoraigold" title="Ideas, Planning, & Feedback">π€</a></td>
|
|
227
230
|
</tr>
|
|
228
231
|
<tr>
|
|
229
|
-
<td align="center"><a href="https://www.manos.im/"><img src="https://avatars3.githubusercontent.com/u/6333409?v=4" width="100px;" alt=""/><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>
|
|
230
|
-
<td align="center"><a href="https://github.com/yuruc"><img src="https://avatars0.githubusercontent.com/u/5884342?v=4" width="100px;" alt=""/><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>
|
|
231
|
-
<td align="center"><a href="https://www.linkedin.com/in/luca-schiavone-7270a8138/"><img src="https://avatars1.githubusercontent.com/u/16616566?v=4" width="100px;" alt=""/><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>
|
|
232
|
-
<td align="center"><a href="http://twitter.com/Osuka42"><img src="https://avatars1.githubusercontent.com/u/5117006?v=4" width="100px;" alt=""/><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>
|
|
233
|
-
<td align="center"><a href="https://github.com/damien-git"><img src="https://avatars0.githubusercontent.com/u/7503971?v=4" width="100px;" alt=""/><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>
|
|
234
|
-
<td align="center"><a href="https://www.linkedin.com/in/vianneystroebel/"><img src="https://avatars0.githubusercontent.com/u/628818?v=4" width="100px;" alt=""/><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>
|
|
235
|
-
<td align="center"><a href="http://xumi.fr"><img src="https://avatars0.githubusercontent.com/u/204001?v=4" width="100px;" alt=""/><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>
|
|
232
|
+
<td align="center"><a href="https://www.manos.im/"><img src="https://avatars3.githubusercontent.com/u/6333409?v=4?s=100" width="100px;" alt=""/><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>
|
|
233
|
+
<td align="center"><a href="https://github.com/yuruc"><img src="https://avatars0.githubusercontent.com/u/5884342?v=4?s=100" width="100px;" alt=""/><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>
|
|
234
|
+
<td align="center"><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=""/><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>
|
|
235
|
+
<td align="center"><a href="http://twitter.com/Osuka42"><img src="https://avatars1.githubusercontent.com/u/5117006?v=4?s=100" width="100px;" alt=""/><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>
|
|
236
|
+
<td align="center"><a href="https://github.com/damien-git"><img src="https://avatars0.githubusercontent.com/u/7503971?v=4?s=100" width="100px;" alt=""/><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>
|
|
237
|
+
<td align="center"><a href="https://www.linkedin.com/in/vianneystroebel/"><img src="https://avatars0.githubusercontent.com/u/628818?v=4?s=100" width="100px;" alt=""/><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>
|
|
238
|
+
<td align="center"><a href="http://xumi.fr"><img src="https://avatars0.githubusercontent.com/u/204001?v=4?s=100" width="100px;" alt=""/><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>
|
|
236
239
|
</tr>
|
|
237
240
|
<tr>
|
|
238
|
-
<td align="center"><a href="https://github.com/razked"><img src="https://avatars0.githubusercontent.com/u/39411034?v=4" width="100px;" alt=""/><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>
|
|
239
|
-
<td align="center"><a href="https://github.com/slumbering"><img src="https://avatars2.githubusercontent.com/u/1186424?v=4" width="100px;" alt=""/><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>
|
|
240
|
-
<td align="center"><a href="http://jamietalbot.com"><img src="https://avatars0.githubusercontent.com/u/425787?v=4" width="100px;" alt=""/><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>
|
|
241
|
+
<td align="center"><a href="https://github.com/razked"><img src="https://avatars0.githubusercontent.com/u/39411034?v=4?s=100" width="100px;" alt=""/><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>
|
|
242
|
+
<td align="center"><a href="https://github.com/slumbering"><img src="https://avatars2.githubusercontent.com/u/1186424?v=4?s=100" width="100px;" alt=""/><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>
|
|
243
|
+
<td align="center"><a href="http://jamietalbot.com"><img src="https://avatars0.githubusercontent.com/u/425787?v=4?s=100" width="100px;" alt=""/><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>
|
|
244
|
+
<td align="center"><a href="http://timeslikethese.ca"><img src="https://avatars1.githubusercontent.com/u/22269057?v=4?s=100" width="100px;" alt=""/><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>
|
|
245
|
+
<td align="center"><a href="https://github.com/RuiRocha1991"><img src="https://avatars2.githubusercontent.com/u/29250466?v=4?s=100" width="100px;" alt=""/><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>
|
|
246
|
+
<td align="center"><a href="https://github.com/Romaboy"><img src="https://avatars0.githubusercontent.com/u/42248135?v=4?s=100" width="100px;" alt=""/><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>
|
|
247
|
+
<td align="center"><a href="https://bogas04.github.io/"><img src="https://avatars.githubusercontent.com/u/6177621?v=4?s=100" width="100px;" alt=""/><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>
|
|
241
248
|
</tr>
|
|
242
249
|
</table>
|
|
243
250
|
|
|
244
|
-
<!-- markdownlint-
|
|
251
|
+
<!-- markdownlint-restore -->
|
|
245
252
|
<!-- prettier-ignore-end -->
|
|
246
253
|
|
|
247
254
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
248
255
|
|
|
249
|
-
[ci-badge]: https://
|
|
250
|
-
[ci]: https://
|
|
256
|
+
[ci-badge]: https://github.com/toomuchdesign/react-minimal-pie-chart/actions/workflows/ci.yml/badge.svg
|
|
257
|
+
[ci]: https://github.com/toomuchdesign/react-minimal-pie-chart/actions/workflows/ci.yml
|
|
251
258
|
[coveralls-badge]: https://coveralls.io/repos/github/toomuchdesign/react-minimal-pie-chart/badge.svg?branch=master
|
|
252
259
|
[coveralls]: https://coveralls.io/github/toomuchdesign/react-minimal-pie-chart?branch=master
|
|
253
260
|
[npm]: https://www.npmjs.com/package/react-minimal-pie-chart
|
|
@@ -272,6 +279,6 @@ Thanks to you all ([emoji key](https://github.com/kentcdodds/all-contributors#em
|
|
|
272
279
|
[demo-interaction-2-source]: https://github.com/toomuchdesign/react-minimal-pie-chart/blob/v8.0.0/stories/InteractionTabStory.tsx
|
|
273
280
|
[demo-tooltip]: https://toomuchdesign.github.io/react-minimal-pie-chart/index.html?path=/story/misc--tooltip-integration
|
|
274
281
|
[demo-tooltip-source]: https://github.com/toomuchdesign/react-minimal-pie-chart/blob/master/stories/Tooltip.tsx
|
|
275
|
-
[demo-label-source]: https://github.com/toomuchdesign/react-minimal-pie-chart/blob/v8.
|
|
282
|
+
[demo-label-source]: https://github.com/toomuchdesign/react-minimal-pie-chart/blob/v8.2.0/stories/index.tsx#L81
|
|
276
283
|
[data-props-docs]: #about-data-prop
|
|
277
284
|
[label-props-docs]: #custom-labels-with-label-render-prop
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
4
|
-
(global = global || self, factory(global.ReactMinimalPieChart = {}, global.React));
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactMinimalPieChart = {}, global.React));
|
|
5
5
|
}(this, (function (exports, React) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
10
|
|
|
9
11
|
function degreesToRadians(degrees) {
|
|
10
12
|
return degrees * Math.PI / 180;
|
|
@@ -91,16 +93,15 @@
|
|
|
91
93
|
return target;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
props = _objectWithoutPropertiesLoose(_ref, ["dataEntry", "dataIndex"]);
|
|
96
|
+
function ReactMinimalPieChartLabel(_ref) {
|
|
97
|
+
_ref.dataEntry;
|
|
98
|
+
_ref.dataIndex;
|
|
99
|
+
var props = _objectWithoutPropertiesLoose(_ref, ["dataEntry", "dataIndex"]);
|
|
98
100
|
|
|
99
|
-
return /*#__PURE__*/React__default.createElement("text", Object.assign({
|
|
101
|
+
return /*#__PURE__*/React__default['default'].createElement("text", Object.assign({
|
|
100
102
|
dominantBaseline: "central"
|
|
101
103
|
}, props));
|
|
102
104
|
}
|
|
103
|
-
Label.displayName = 'ReactMinimalPieChartLabel';
|
|
104
105
|
|
|
105
106
|
function round(number) {
|
|
106
107
|
var divisor = 1e14; // 14 decimals
|
|
@@ -138,12 +139,12 @@
|
|
|
138
139
|
var label = renderLabel(labelProps);
|
|
139
140
|
|
|
140
141
|
if (typeof label === 'string' || typeof label === 'number') {
|
|
141
|
-
return /*#__PURE__*/React__default.createElement(
|
|
142
|
+
return /*#__PURE__*/React__default['default'].createElement(ReactMinimalPieChartLabel, Object.assign({
|
|
142
143
|
key: "label-" + (labelProps.dataEntry.key || labelProps.dataIndex)
|
|
143
144
|
}, labelProps), label);
|
|
144
145
|
}
|
|
145
146
|
|
|
146
|
-
if (React__default.isValidElement(label)) {
|
|
147
|
+
if (React__default['default'].isValidElement(label)) {
|
|
147
148
|
return label;
|
|
148
149
|
}
|
|
149
150
|
|
|
@@ -201,7 +202,7 @@
|
|
|
201
202
|
return command.join(' ');
|
|
202
203
|
}).join(' ');
|
|
203
204
|
}
|
|
204
|
-
function
|
|
205
|
+
function ReactMinimalPieChartPath(_ref) {
|
|
205
206
|
var cx = _ref.cx,
|
|
206
207
|
cy = _ref.cy,
|
|
207
208
|
lengthAngle = _ref.lengthAngle,
|
|
@@ -232,16 +233,15 @@
|
|
|
232
233
|
strokeDashoffset = strokeDasharray - extractPercentage(strokeDasharray, reveal);
|
|
233
234
|
}
|
|
234
235
|
|
|
235
|
-
return /*#__PURE__*/React__default.createElement("path", Object.assign({
|
|
236
|
+
return /*#__PURE__*/React__default['default'].createElement("path", Object.assign({
|
|
236
237
|
d: pathCommands,
|
|
237
238
|
fill: "none",
|
|
238
239
|
strokeWidth: lineWidth,
|
|
239
240
|
strokeDasharray: strokeDasharray,
|
|
240
241
|
strokeDashoffset: strokeDashoffset,
|
|
241
242
|
strokeLinecap: rounded ? 'round' : undefined
|
|
242
|
-
}, props), title && /*#__PURE__*/React__default.createElement("title", null, title));
|
|
243
|
+
}, props), title && /*#__PURE__*/React__default['default'].createElement("title", null, title));
|
|
243
244
|
}
|
|
244
|
-
Path.displayName = 'ReactMinimalPieChartPath';
|
|
245
245
|
|
|
246
246
|
function combineSegmentTransitionsStyle(duration, easing, customStyle) {
|
|
247
247
|
// Merge chart's animation CSS transition with "transition" found to customStyle
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
var lineWidth = extractPercentage(radius, props.lineWidth);
|
|
282
282
|
var paths = data.map(function (dataEntry, index) {
|
|
283
283
|
var segmentsStyle = functionProp(props.segmentsStyle, index);
|
|
284
|
-
return /*#__PURE__*/React__default.createElement(
|
|
284
|
+
return /*#__PURE__*/React__default['default'].createElement(ReactMinimalPieChartPath, {
|
|
285
285
|
cx: cx,
|
|
286
286
|
cy: cy,
|
|
287
287
|
key: dataEntry.key || index,
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
});
|
|
307
307
|
|
|
308
308
|
if (props.background) {
|
|
309
|
-
paths.unshift( /*#__PURE__*/React__default.createElement(
|
|
309
|
+
paths.unshift( /*#__PURE__*/React__default['default'].createElement(ReactMinimalPieChartPath, {
|
|
310
310
|
cx: cx,
|
|
311
311
|
cy: cy,
|
|
312
312
|
key: "bg",
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
startAngle: 0,
|
|
336
336
|
viewBoxSize: [100, 100]
|
|
337
337
|
};
|
|
338
|
-
function
|
|
338
|
+
function ReactMinimalPieChart(props) {
|
|
339
339
|
var _useState = React.useState(props.animate ? 0 : null),
|
|
340
340
|
revealOverride = _useState[0],
|
|
341
341
|
setRevealOverride = _useState[1];
|
|
@@ -362,7 +362,7 @@
|
|
|
362
362
|
}
|
|
363
363
|
}, []);
|
|
364
364
|
var extendedData = extendData(props);
|
|
365
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
365
|
+
return /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
366
366
|
viewBox: "0 0 " + props.viewBoxSize[0] + " " + props.viewBoxSize[1],
|
|
367
367
|
width: "100%",
|
|
368
368
|
height: "100%",
|
|
@@ -370,10 +370,9 @@
|
|
|
370
370
|
style: props.style
|
|
371
371
|
}, renderSegments(extendedData, props, revealOverride), props.label && renderLabels(extendedData, props), props.children);
|
|
372
372
|
}
|
|
373
|
-
|
|
374
|
-
PieChart.displayName = 'ReactMinimalPieChart';
|
|
373
|
+
ReactMinimalPieChart.defaultProps = defaultProps;
|
|
375
374
|
|
|
376
|
-
exports.PieChart =
|
|
375
|
+
exports.PieChart = ReactMinimalPieChart;
|
|
377
376
|
|
|
378
377
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
379
378
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/Chart/extendData.ts","../src/Label.tsx","../src/Chart/renderLabels.tsx","../node_modules/svg-partial-circle/index.js","../src/Path.tsx","../src/Chart/renderSegments.tsx","../src/Chart/Chart.tsx"],"sourcesContent":["export function degreesToRadians(degrees: number) {\n return (degrees * Math.PI) / 180;\n}\n\nexport function valueBetween(value: number, min: number, max: number) {\n if (value > max) return max;\n if (value < min) return min;\n return value;\n}\n\nexport function extractPercentage(value: number, percentage: number) {\n return (percentage / 100) * value;\n}\n\nexport function bisectorAngle(startAngle: number, lengthAngle: number) {\n return startAngle + lengthAngle / 2;\n}\n\nexport function shiftVectorAlongAngle(angle: number, distance: number) {\n const angleRadians = degreesToRadians(angle);\n return {\n dx: distance * Math.cos(angleRadians),\n dy: distance * Math.sin(angleRadians),\n };\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function functionProp<Prop, Payload>(\n prop: Prop,\n payload?: Payload\n): Prop extends (...args: any) => any ? ReturnType<Prop> : Prop {\n return typeof prop === 'function' ? prop(payload) : prop;\n}\n","import { extractPercentage, valueBetween } from '../utils';\nimport type { Data, ExtendedData } from '../commonTypes';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\n\nfunction sumValues(data: Data): number {\n let sum = 0;\n for (let i = 0; i < data.length; i++) {\n sum += data[i].value;\n }\n return sum;\n}\n\n// Append \"percentage\", \"degrees\" and \"startAngle\" to each data entry\nexport default function extendData({\n data,\n lengthAngle: totalAngle,\n totalValue,\n paddingAngle,\n startAngle: chartStartAngle,\n}: ChartProps): ExtendedData {\n const total = totalValue || sumValues(data);\n const normalizedTotalAngle = valueBetween(totalAngle, -360, 360);\n const numberOfPaddings =\n Math.abs(normalizedTotalAngle) === 360 ? data.length : data.length - 1;\n const singlePaddingDegrees = Math.abs(paddingAngle) * Math.sign(totalAngle);\n const degreesTakenByPadding = singlePaddingDegrees * numberOfPaddings;\n const degreesTakenByPaths = normalizedTotalAngle - degreesTakenByPadding;\n let lastSegmentEnd = 0;\n const extendedData = [];\n\n // @NOTE: Shall we evaluate percentage accordingly to dataEntry.value's sign?\n for (let i = 0; i < data.length; i++) {\n const dataEntry = data[i];\n const valueInPercentage = total === 0 ? 0 : (dataEntry.value / total) * 100;\n const degrees = extractPercentage(degreesTakenByPaths, valueInPercentage);\n const startAngle = lastSegmentEnd + chartStartAngle;\n lastSegmentEnd = lastSegmentEnd + degrees + singlePaddingDegrees;\n extendedData.push(\n Object.assign(\n {\n percentage: valueInPercentage,\n startAngle,\n degrees,\n },\n dataEntry\n )\n );\n }\n return extendedData;\n}\n","import React from 'react';\nimport type { CSSProperties, SVGProps } from 'react';\nimport type { ExtendedDataEntry } from './commonTypes';\n\nexport type LabelRenderProps = {\n x: number;\n y: number;\n dx: number;\n dy: number;\n textAnchor: string;\n dataEntry: ExtendedDataEntry;\n dataIndex: number;\n style?: CSSProperties;\n};\n\ntype Props = SVGProps<SVGTextElement> & LabelRenderProps;\n\nexport default function Label({ dataEntry, dataIndex, ...props }: Props) {\n return <text dominantBaseline=\"central\" {...props} />;\n}\n\nLabel.displayName = 'ReactMinimalPieChartLabel';\n","import React from 'react';\nimport DefaultLabel from '../Label';\nimport {\n bisectorAngle,\n extractPercentage,\n functionProp,\n shiftVectorAlongAngle,\n} from '../utils';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\nimport type { LabelRenderProps } from '../Label';\nimport type { ExtendedData, LabelRenderFunction } from '../commonTypes';\n\nfunction round(number: number): number {\n const divisor = 1e14; // 14 decimals\n return Math.round((number + Number.EPSILON) * divisor) / divisor;\n}\n\nfunction evaluateTextAnchorPosition({\n labelPosition,\n lineWidth,\n labelHorizontalShift,\n}: {\n labelPosition: number;\n lineWidth: number;\n labelHorizontalShift: number;\n}) {\n const dx = round(labelHorizontalShift);\n // Label in the vertical center\n if (dx === 0) {\n return 'middle';\n }\n // Outward label\n if (labelPosition > 100) {\n return dx > 0 ? 'start' : 'end';\n }\n // Inward label\n const innerRadius = 100 - lineWidth;\n if (labelPosition < innerRadius) {\n return dx > 0 ? 'end' : 'start';\n }\n // Overlying label\n return 'middle';\n}\n\nfunction renderLabelElement(\n renderLabel: LabelRenderFunction,\n labelProps: LabelRenderProps\n): JSX.Element | null {\n const label = renderLabel(labelProps);\n if (typeof label === 'string' || typeof label === 'number') {\n return (\n <DefaultLabel\n key={`label-${labelProps.dataEntry.key || labelProps.dataIndex}`}\n {...labelProps}\n >\n {label}\n </DefaultLabel>\n );\n }\n\n if (React.isValidElement(label)) {\n return label;\n }\n return null;\n}\n\nexport default function renderLabels(data: ExtendedData, props: ChartProps) {\n return data.map((dataEntry, index) => {\n const segmentsShift = functionProp(props.segmentsShift, index) ?? 0;\n const distanceFromCenter =\n extractPercentage(props.radius, props.labelPosition) + segmentsShift;\n const { dx, dy } = shiftVectorAlongAngle(\n bisectorAngle(dataEntry.startAngle, dataEntry.degrees),\n distanceFromCenter\n );\n\n // This object is passed as argument to the \"label\" function prop\n const labelRenderProps = {\n x: props.center[0],\n y: props.center[1],\n dx,\n dy,\n textAnchor: evaluateTextAnchorPosition({\n labelPosition: props.labelPosition,\n lineWidth: props.lineWidth,\n labelHorizontalShift: dx,\n }),\n dataEntry,\n dataIndex: index,\n style: functionProp(props.labelStyle, index),\n };\n\n return props.label && renderLabelElement(props.label, labelRenderProps);\n });\n}\n","'use strict'\n\n// from http://stackoverflow.com/a/18473154\nconst partialCircle = (cx, cy, r, start, end) => {\n\tconst length = end - start\n\tif (length === 0) return []\n\n\tconst fromX = r * Math.cos(start) + cx\n\tconst fromY = r * Math.sin(start) + cy\n\tconst toX = r * Math.cos(end) + cx\n\tconst toY = r * Math.sin(end) + cy\n\tconst large = Math.abs(length) <= Math.PI ? '0' : '1'\n\tconst sweep = length < 0 ? '0' : '1'\n\n\treturn [\n\t\t['M', fromX, fromY],\n\t\t['A', r, r, 0, large, sweep, toX, toY]\n\t]\n}\n\nmodule.exports = partialCircle\n","import React from 'react';\nimport type { SVGProps } from 'react';\nimport partialCircle from 'svg-partial-circle';\nimport {\n bisectorAngle,\n degreesToRadians,\n extractPercentage,\n isNumber,\n shiftVectorAlongAngle,\n valueBetween,\n} from './utils';\n\nexport function makePathCommands(\n cx: number,\n cy: number,\n startAngle: number,\n lengthAngle: number,\n radius: number\n): string {\n const patchedLengthAngle = valueBetween(lengthAngle, -359.999, 359.999);\n\n return partialCircle(\n cx,\n cy, // center X and Y\n radius,\n degreesToRadians(startAngle),\n degreesToRadians(startAngle + patchedLengthAngle)\n )\n .map((command) => command.join(' '))\n .join(' ');\n}\n\ntype Props = SVGProps<SVGPathElement> & {\n cx: number;\n cy: number;\n lengthAngle: number;\n lineWidth: number;\n radius: number;\n reveal?: number;\n rounded?: boolean;\n shift?: number;\n startAngle: number;\n title?: string | number;\n};\n\nexport default function Path({\n cx,\n cy,\n lengthAngle,\n lineWidth,\n radius,\n shift = 0,\n reveal,\n rounded,\n startAngle,\n title,\n ...props\n}: Props) {\n const pathRadius = radius - lineWidth / 2;\n //@NOTE This shift might be rendered as a translation in future\n const { dx, dy } = shiftVectorAlongAngle(\n bisectorAngle(startAngle, lengthAngle),\n shift\n );\n\n const pathCommands = makePathCommands(\n cx + dx,\n cy + dy,\n startAngle,\n lengthAngle,\n pathRadius\n );\n let strokeDasharray;\n let strokeDashoffset;\n\n // Animate/hide paths with \"stroke-dasharray\" + \"stroke-dashoffset\"\n // https://css-tricks.com/svg-line-animation-works/\n if (isNumber(reveal)) {\n const pathLength = degreesToRadians(pathRadius) * lengthAngle;\n strokeDasharray = Math.abs(pathLength);\n strokeDashoffset =\n strokeDasharray - extractPercentage(strokeDasharray, reveal);\n }\n\n return (\n <path\n d={pathCommands}\n fill=\"none\"\n strokeWidth={lineWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n strokeLinecap={rounded ? 'round' : undefined}\n {...props}\n >\n {title && <title>{title}</title>}\n </path>\n );\n}\n\nPath.displayName = 'ReactMinimalPieChartPath';\n","import React from 'react';\nimport type { CSSProperties } from 'react';\nimport Path from '../Path';\nimport { extractPercentage, functionProp, isNumber } from '../utils';\nimport type { ExtendedData } from '../commonTypes';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\n\nfunction combineSegmentTransitionsStyle(\n duration: number,\n easing: string,\n customStyle?: CSSProperties\n): { transition: string } {\n // Merge chart's animation CSS transition with \"transition\" found to customStyle\n let transition = `stroke-dashoffset ${duration}ms ${easing}`;\n if (customStyle && customStyle.transition) {\n transition = `${transition},${customStyle.transition}`;\n }\n return {\n transition,\n };\n}\n\nfunction getRevealValue<Reveal>(props: { reveal?: Reveal; animate?: boolean }) {\n //@NOTE When animation is on, chart has to be fully revealed when reveal is not set\n if (props.animate && !isNumber(props.reveal)) {\n return 100;\n }\n return props.reveal;\n}\n\nfunction makeEventHandler<Event, EventHandler, Payload>(\n eventHandler: undefined | (EventHandler & Function),\n payload: Payload\n) {\n return (\n eventHandler &&\n ((e: Event) => {\n eventHandler(e, payload);\n })\n );\n}\n\nexport default function renderSegments(\n data: ExtendedData,\n props: ChartProps,\n revealOverride?: null | number\n) {\n // @NOTE this should go in Path component. Here for performance reasons\n const reveal = revealOverride ?? getRevealValue(props);\n const {\n radius,\n center: [cx, cy],\n } = props;\n const lineWidth = extractPercentage(radius, props.lineWidth);\n const paths = data.map((dataEntry, index) => {\n const segmentsStyle = functionProp(props.segmentsStyle, index);\n return (\n <Path\n cx={cx}\n cy={cy}\n key={dataEntry.key || index}\n lengthAngle={dataEntry.degrees}\n lineWidth={lineWidth}\n radius={radius}\n rounded={props.rounded}\n reveal={reveal}\n shift={functionProp(props.segmentsShift, index)}\n startAngle={dataEntry.startAngle}\n title={dataEntry.title}\n style={Object.assign(\n {},\n segmentsStyle,\n props.animate &&\n combineSegmentTransitionsStyle(\n props.animationDuration,\n props.animationEasing,\n segmentsStyle\n )\n )}\n stroke={dataEntry.color}\n tabIndex={props.segmentsTabIndex}\n onBlur={makeEventHandler(props.onBlur, index)}\n onClick={makeEventHandler(props.onClick, index)}\n onFocus={makeEventHandler(props.onFocus, index)}\n onKeyDown={makeEventHandler(props.onKeyDown, index)}\n onMouseOver={makeEventHandler(props.onMouseOver, index)}\n onMouseOut={makeEventHandler(props.onMouseOut, index)}\n />\n );\n });\n\n if (props.background) {\n paths.unshift(\n <Path\n cx={cx}\n cy={cy}\n key=\"bg\"\n lengthAngle={props.lengthAngle}\n lineWidth={lineWidth}\n radius={radius}\n rounded={props.rounded}\n startAngle={props.startAngle}\n stroke={props.background}\n />\n );\n }\n\n return paths;\n}\n","import React, { useState, useEffect } from 'react';\nimport type {\n CSSProperties,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n} from 'react';\nimport extendData from './extendData';\nimport renderLabels from './renderLabels';\nimport renderSegments from './renderSegments';\nimport type { Data, EventHandler, LabelRenderFunction } from '../commonTypes';\n\ntype Props = {\n animate?: boolean;\n animationDuration?: number;\n animationEasing?: string;\n background?: string;\n center?: [number, number];\n children?: ReactNode;\n className?: string;\n data: Data;\n lengthAngle?: number;\n lineWidth?: number;\n label?: LabelRenderFunction;\n labelPosition?: number;\n labelStyle?:\n | CSSProperties\n | ((dataIndex: number) => CSSProperties | undefined);\n onBlur?: EventHandler<FocusEvent>;\n onClick?: EventHandler<MouseEvent>;\n onFocus?: EventHandler<FocusEvent>;\n onKeyDown?: EventHandler<KeyboardEvent>;\n onMouseOut?: EventHandler<MouseEvent>;\n onMouseOver?: EventHandler<MouseEvent>;\n paddingAngle?: number;\n radius?: number;\n reveal?: number;\n rounded?: boolean;\n segmentsShift?: number | ((dataIndex: number) => number | undefined);\n segmentsStyle?:\n | CSSProperties\n | ((dataIndex: number) => CSSProperties | undefined);\n segmentsTabIndex?: number;\n startAngle?: number;\n style?: CSSProperties;\n totalValue?: number;\n viewBoxSize?: [number, number];\n};\n\nconst defaultProps = {\n animationDuration: 500,\n animationEasing: 'ease-out',\n center: [50, 50] as [number, number],\n data: [] as Data,\n labelPosition: 50,\n lengthAngle: 360,\n lineWidth: 100,\n paddingAngle: 0,\n radius: 50,\n startAngle: 0,\n viewBoxSize: [100, 100] as [number, number],\n};\n\nexport type PropsWithDefaults = Props & typeof defaultProps;\n\nexport function PieChart(props: PropsWithDefaults) {\n const [revealOverride, setRevealOverride] = useState(\n props.animate ? 0 : null\n );\n useEffect(() => {\n if (props.animate) {\n return startInitialAnimation();\n }\n\n function startInitialAnimation() {\n let animationTimerId: number | null;\n let animationRAFId: number | null;\n animationTimerId = setTimeout(() => {\n animationTimerId = null;\n animationRAFId = requestAnimationFrame(() => {\n animationRAFId = null;\n setRevealOverride(null); // Start animation\n });\n });\n\n return () => {\n animationTimerId && clearTimeout(animationTimerId);\n animationRAFId && cancelAnimationFrame(animationRAFId);\n };\n }\n }, []);\n\n const extendedData = extendData(props);\n return (\n <svg\n viewBox={`0 0 ${props.viewBoxSize[0]} ${props.viewBoxSize[1]}`}\n width=\"100%\"\n height=\"100%\"\n className={props.className}\n style={props.style}\n >\n {renderSegments(extendedData, props, revealOverride)}\n {props.label && renderLabels(extendedData, props)}\n {props.children}\n </svg>\n );\n}\n\nPieChart.defaultProps = defaultProps;\nPieChart.displayName = 'ReactMinimalPieChart';\n"],"names":["degreesToRadians","degrees","Math","PI","valueBetween","value","min","max","extractPercentage","percentage","bisectorAngle","startAngle","lengthAngle","shiftVectorAlongAngle","angle","distance","angleRadians","dx","cos","dy","sin","isNumber","functionProp","prop","payload","sumValues","data","sum","i","length","extendData","totalAngle","totalValue","paddingAngle","chartStartAngle","total","normalizedTotalAngle","numberOfPaddings","abs","singlePaddingDegrees","sign","degreesTakenByPadding","degreesTakenByPaths","lastSegmentEnd","extendedData","dataEntry","valueInPercentage","push","Object","assign","Label","dataIndex","props","React","displayName","round","number","divisor","Number","EPSILON","evaluateTextAnchorPosition","labelPosition","lineWidth","labelHorizontalShift","innerRadius","renderLabelElement","renderLabel","labelProps","label","DefaultLabel","key","isValidElement","renderLabels","map","index","segmentsShift","distanceFromCenter","radius","labelRenderProps","x","center","y","textAnchor","style","labelStyle","partialCircle","cx","cy","r","start","end","fromX","fromY","toX","toY","large","sweep","module","makePathCommands","patchedLengthAngle","command","join","Path","shift","reveal","rounded","title","pathRadius","pathCommands","strokeDasharray","strokeDashoffset","pathLength","undefined","combineSegmentTransitionsStyle","duration","easing","customStyle","transition","getRevealValue","animate","makeEventHandler","eventHandler","e","renderSegments","revealOverride","paths","segmentsStyle","animationDuration","animationEasing","color","segmentsTabIndex","onBlur","onClick","onFocus","onKeyDown","onMouseOver","onMouseOut","background","unshift","defaultProps","viewBoxSize","PieChart","useState","setRevealOverride","useEffect","startInitialAnimation","animationTimerId","animationRAFId","setTimeout","requestAnimationFrame","clearTimeout","cancelAnimationFrame","className","children"],"mappings":";;;;;;;;EAAO,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cAAJ;EACAD,MAAAA,gBAAgB,GAAGE,UAAU,CAAC,YAAM;EAClCF,QAAAA,gBAAgB,GAAG,IAAnB;EACAC,QAAAA,cAAc,GAAGE,qBAAqB,CAAC,YAAM;EAC3CF,UAAAA,cAAc,GAAG,IAAjB;EACAJ,UAAAA,iBAAiB,CAAC,IAAD,CAAjB,CAF2C;EAG5C,SAHqC,CAAtC;EAID,OAN4B,CAA7B;EAQA,aAAO,YAAM;EACXG,QAAAA,gBAAgB,IAAII,YAAY,CAACJ,gBAAD,CAAhC;EACAC,QAAAA,cAAc,IAAII,oBAAoB,CAACJ,cAAD,CAAtC;EACD,OAHD;EAID;EACF,GArBQ,EAqBN,EArBM,CAAT;EAuBA,MAAMvG,YAAY,GAAGd,UAAU,CAACsB,KAAD,CAA/B;EACA,sBACEC;EACE,IAAA,OAAO,WAASD,KAAK,CAACwF,WAAN,CAAkB,CAAlB,CAAT,SAAiCxF,KAAK,CAACwF,WAAN,CAAkB,CAAlB,CAD1C;EAEE,IAAA,KAAK,EAAC,MAFR;EAGE,IAAA,MAAM,EAAC,MAHT;EAIE,IAAA,SAAS,EAAExF,KAAK,CAACoG,SAJnB;EAKE,IAAA,KAAK,EAAEpG,KAAK,CAAC+B;EALf,KAOGwC,cAAc,CAAC/E,YAAD,EAAeQ,KAAf,EAAsBwE,cAAtB,CAPjB,EAQGxE,KAAK,CAACgB,KAAN,IAAeI,YAAY,CAAC5B,YAAD,EAAeQ,KAAf,CAR9B,EASGA,KAAK,CAACqG,QATT,CADF;EAaD;EAEDZ,QAAQ,CAACF,YAAT,GAAwBA,YAAxB;EACAE,QAAQ,CAACvF,WAAT,GAAuB,sBAAvB;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/Chart/extendData.ts","../src/Label.tsx","../src/Chart/renderLabels.tsx","../node_modules/svg-partial-circle/index.js","../src/Path.tsx","../src/Chart/renderSegments.tsx","../src/Chart/Chart.tsx"],"sourcesContent":["export function degreesToRadians(degrees: number) {\n return (degrees * Math.PI) / 180;\n}\n\nexport function valueBetween(value: number, min: number, max: number) {\n if (value > max) return max;\n if (value < min) return min;\n return value;\n}\n\nexport function extractPercentage(value: number, percentage: number) {\n return (percentage / 100) * value;\n}\n\nexport function bisectorAngle(startAngle: number, lengthAngle: number) {\n return startAngle + lengthAngle / 2;\n}\n\nexport function shiftVectorAlongAngle(angle: number, distance: number) {\n const angleRadians = degreesToRadians(angle);\n return {\n dx: distance * Math.cos(angleRadians),\n dy: distance * Math.sin(angleRadians),\n };\n}\n\nexport function isNumber(value: unknown): value is number {\n return typeof value === 'number';\n}\n\nexport function functionProp<Prop, Payload>(\n prop: Prop,\n payload?: Payload\n): Prop extends (...args: any) => any ? ReturnType<Prop> : Prop {\n return typeof prop === 'function' ? prop(payload) : prop;\n}\n","import { extractPercentage, valueBetween } from '../utils';\nimport type { Data, ExtendedData } from '../commonTypes';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\n\nfunction sumValues(data: Data): number {\n let sum = 0;\n for (let i = 0; i < data.length; i++) {\n sum += data[i].value;\n }\n return sum;\n}\n\n// Append \"percentage\", \"degrees\" and \"startAngle\" to each data entry\nexport default function extendData({\n data,\n lengthAngle: totalAngle,\n totalValue,\n paddingAngle,\n startAngle: chartStartAngle,\n}: ChartProps): ExtendedData {\n const total = totalValue || sumValues(data);\n const normalizedTotalAngle = valueBetween(totalAngle, -360, 360);\n const numberOfPaddings =\n Math.abs(normalizedTotalAngle) === 360 ? data.length : data.length - 1;\n const singlePaddingDegrees = Math.abs(paddingAngle) * Math.sign(totalAngle);\n const degreesTakenByPadding = singlePaddingDegrees * numberOfPaddings;\n const degreesTakenByPaths = normalizedTotalAngle - degreesTakenByPadding;\n let lastSegmentEnd = 0;\n const extendedData = [];\n\n // @NOTE: Shall we evaluate percentage accordingly to dataEntry.value's sign?\n for (let i = 0; i < data.length; i++) {\n const dataEntry = data[i];\n const valueInPercentage = total === 0 ? 0 : (dataEntry.value / total) * 100;\n const degrees = extractPercentage(degreesTakenByPaths, valueInPercentage);\n const startAngle = lastSegmentEnd + chartStartAngle;\n lastSegmentEnd = lastSegmentEnd + degrees + singlePaddingDegrees;\n extendedData.push(\n Object.assign(\n {\n percentage: valueInPercentage,\n startAngle,\n degrees,\n },\n dataEntry\n )\n );\n }\n return extendedData;\n}\n","import React from 'react';\nimport type { CSSProperties, SVGProps } from 'react';\nimport type { ExtendedDataEntry } from './commonTypes';\n\nexport type LabelRenderProps = {\n x: number;\n y: number;\n dx: number;\n dy: number;\n textAnchor: string;\n dataEntry: ExtendedDataEntry;\n dataIndex: number;\n style?: CSSProperties;\n};\n\ntype Props = SVGProps<SVGTextElement> & LabelRenderProps;\n\nexport default function ReactMinimalPieChartLabel({\n dataEntry,\n dataIndex,\n ...props\n}: Props) {\n return <text dominantBaseline=\"central\" {...props} />;\n}\n","import React from 'react';\nimport DefaultLabel from '../Label';\nimport {\n bisectorAngle,\n extractPercentage,\n functionProp,\n shiftVectorAlongAngle,\n} from '../utils';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\nimport type { LabelRenderProps } from '../Label';\nimport type { ExtendedData, LabelRenderFunction } from '../commonTypes';\n\nfunction round(number: number): number {\n const divisor = 1e14; // 14 decimals\n return Math.round((number + Number.EPSILON) * divisor) / divisor;\n}\n\nfunction evaluateTextAnchorPosition({\n labelPosition,\n lineWidth,\n labelHorizontalShift,\n}: {\n labelPosition: number;\n lineWidth: number;\n labelHorizontalShift: number;\n}) {\n const dx = round(labelHorizontalShift);\n // Label in the vertical center\n if (dx === 0) {\n return 'middle';\n }\n // Outward label\n if (labelPosition > 100) {\n return dx > 0 ? 'start' : 'end';\n }\n // Inward label\n const innerRadius = 100 - lineWidth;\n if (labelPosition < innerRadius) {\n return dx > 0 ? 'end' : 'start';\n }\n // Overlying label\n return 'middle';\n}\n\nfunction renderLabelElement(\n renderLabel: LabelRenderFunction,\n labelProps: LabelRenderProps\n): JSX.Element | null {\n const label = renderLabel(labelProps);\n if (typeof label === 'string' || typeof label === 'number') {\n return (\n <DefaultLabel\n key={`label-${labelProps.dataEntry.key || labelProps.dataIndex}`}\n {...labelProps}\n >\n {label}\n </DefaultLabel>\n );\n }\n\n if (React.isValidElement(label)) {\n return label;\n }\n return null;\n}\n\nexport default function renderLabels(data: ExtendedData, props: ChartProps) {\n return data.map((dataEntry, index) => {\n const segmentsShift = functionProp(props.segmentsShift, index) ?? 0;\n const distanceFromCenter =\n extractPercentage(props.radius, props.labelPosition) + segmentsShift;\n const { dx, dy } = shiftVectorAlongAngle(\n bisectorAngle(dataEntry.startAngle, dataEntry.degrees),\n distanceFromCenter\n );\n\n // This object is passed as argument to the \"label\" function prop\n const labelRenderProps = {\n x: props.center[0],\n y: props.center[1],\n dx,\n dy,\n textAnchor: evaluateTextAnchorPosition({\n labelPosition: props.labelPosition,\n lineWidth: props.lineWidth,\n labelHorizontalShift: dx,\n }),\n dataEntry,\n dataIndex: index,\n style: functionProp(props.labelStyle, index),\n };\n\n return props.label && renderLabelElement(props.label, labelRenderProps);\n });\n}\n","'use strict'\n\n// from http://stackoverflow.com/a/18473154\nconst partialCircle = (cx, cy, r, start, end) => {\n\tconst length = end - start\n\tif (length === 0) return []\n\n\tconst fromX = r * Math.cos(start) + cx\n\tconst fromY = r * Math.sin(start) + cy\n\tconst toX = r * Math.cos(end) + cx\n\tconst toY = r * Math.sin(end) + cy\n\tconst large = Math.abs(length) <= Math.PI ? '0' : '1'\n\tconst sweep = length < 0 ? '0' : '1'\n\n\treturn [\n\t\t['M', fromX, fromY],\n\t\t['A', r, r, 0, large, sweep, toX, toY]\n\t]\n}\n\nmodule.exports = partialCircle\n","import React from 'react';\nimport type { SVGProps } from 'react';\nimport partialCircle from 'svg-partial-circle';\nimport {\n bisectorAngle,\n degreesToRadians,\n extractPercentage,\n isNumber,\n shiftVectorAlongAngle,\n valueBetween,\n} from './utils';\n\nexport function makePathCommands(\n cx: number,\n cy: number,\n startAngle: number,\n lengthAngle: number,\n radius: number\n): string {\n const patchedLengthAngle = valueBetween(lengthAngle, -359.999, 359.999);\n\n return partialCircle(\n cx,\n cy, // center X and Y\n radius,\n degreesToRadians(startAngle),\n degreesToRadians(startAngle + patchedLengthAngle)\n )\n .map((command) => command.join(' '))\n .join(' ');\n}\n\ntype Props = SVGProps<SVGPathElement> & {\n cx: number;\n cy: number;\n lengthAngle: number;\n lineWidth: number;\n radius: number;\n reveal?: number;\n rounded?: boolean;\n shift?: number;\n startAngle: number;\n title?: string | number;\n};\n\nexport default function ReactMinimalPieChartPath({\n cx,\n cy,\n lengthAngle,\n lineWidth,\n radius,\n shift = 0,\n reveal,\n rounded,\n startAngle,\n title,\n ...props\n}: Props) {\n const pathRadius = radius - lineWidth / 2;\n //@NOTE This shift might be rendered as a translation in future\n const { dx, dy } = shiftVectorAlongAngle(\n bisectorAngle(startAngle, lengthAngle),\n shift\n );\n\n const pathCommands = makePathCommands(\n cx + dx,\n cy + dy,\n startAngle,\n lengthAngle,\n pathRadius\n );\n let strokeDasharray;\n let strokeDashoffset;\n\n // Animate/hide paths with \"stroke-dasharray\" + \"stroke-dashoffset\"\n // https://css-tricks.com/svg-line-animation-works/\n if (isNumber(reveal)) {\n const pathLength = degreesToRadians(pathRadius) * lengthAngle;\n strokeDasharray = Math.abs(pathLength);\n strokeDashoffset =\n strokeDasharray - extractPercentage(strokeDasharray, reveal);\n }\n\n return (\n <path\n d={pathCommands}\n fill=\"none\"\n strokeWidth={lineWidth}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n strokeLinecap={rounded ? 'round' : undefined}\n {...props}\n >\n {title && <title>{title}</title>}\n </path>\n );\n}\n","import React from 'react';\nimport type { CSSProperties } from 'react';\nimport Path from '../Path';\nimport { extractPercentage, functionProp, isNumber } from '../utils';\nimport type { ExtendedData } from '../commonTypes';\nimport type { PropsWithDefaults as ChartProps } from './Chart';\n\nfunction combineSegmentTransitionsStyle(\n duration: number,\n easing: string,\n customStyle?: CSSProperties\n): { transition: string } {\n // Merge chart's animation CSS transition with \"transition\" found to customStyle\n let transition = `stroke-dashoffset ${duration}ms ${easing}`;\n if (customStyle && customStyle.transition) {\n transition = `${transition},${customStyle.transition}`;\n }\n return {\n transition,\n };\n}\n\nfunction getRevealValue<Reveal>(props: { reveal?: Reveal; animate?: boolean }) {\n //@NOTE When animation is on, chart has to be fully revealed when reveal is not set\n if (props.animate && !isNumber(props.reveal)) {\n return 100;\n }\n return props.reveal;\n}\n\nfunction makeEventHandler<Event, EventHandler, Payload>(\n eventHandler: undefined | (EventHandler & Function),\n payload: Payload\n) {\n return (\n eventHandler &&\n ((e: Event) => {\n eventHandler(e, payload);\n })\n );\n}\n\nexport default function renderSegments(\n data: ExtendedData,\n props: ChartProps,\n revealOverride?: null | number\n) {\n // @NOTE this should go in Path component. Here for performance reasons\n const reveal = revealOverride ?? getRevealValue(props);\n const {\n radius,\n center: [cx, cy],\n } = props;\n const lineWidth = extractPercentage(radius, props.lineWidth);\n const paths = data.map((dataEntry, index) => {\n const segmentsStyle = functionProp(props.segmentsStyle, index);\n return (\n <Path\n cx={cx}\n cy={cy}\n key={dataEntry.key || index}\n lengthAngle={dataEntry.degrees}\n lineWidth={lineWidth}\n radius={radius}\n rounded={props.rounded}\n reveal={reveal}\n shift={functionProp(props.segmentsShift, index)}\n startAngle={dataEntry.startAngle}\n title={dataEntry.title}\n style={Object.assign(\n {},\n segmentsStyle,\n props.animate &&\n combineSegmentTransitionsStyle(\n props.animationDuration,\n props.animationEasing,\n segmentsStyle\n )\n )}\n stroke={dataEntry.color}\n tabIndex={props.segmentsTabIndex}\n onBlur={makeEventHandler(props.onBlur, index)}\n onClick={makeEventHandler(props.onClick, index)}\n onFocus={makeEventHandler(props.onFocus, index)}\n onKeyDown={makeEventHandler(props.onKeyDown, index)}\n onMouseOver={makeEventHandler(props.onMouseOver, index)}\n onMouseOut={makeEventHandler(props.onMouseOut, index)}\n />\n );\n });\n\n if (props.background) {\n paths.unshift(\n <Path\n cx={cx}\n cy={cy}\n key=\"bg\"\n lengthAngle={props.lengthAngle}\n lineWidth={lineWidth}\n radius={radius}\n rounded={props.rounded}\n startAngle={props.startAngle}\n stroke={props.background}\n />\n );\n }\n\n return paths;\n}\n","import React, { useState, useEffect } from 'react';\nimport type {\n CSSProperties,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n ReactNode,\n} from 'react';\nimport extendData from './extendData';\nimport renderLabels from './renderLabels';\nimport renderSegments from './renderSegments';\nimport type { Data, EventHandler, LabelRenderFunction } from '../commonTypes';\n\ntype Props = {\n animate?: boolean;\n animationDuration?: number;\n animationEasing?: string;\n background?: string;\n center?: [number, number];\n children?: ReactNode;\n className?: string;\n data: Data;\n lengthAngle?: number;\n lineWidth?: number;\n label?: LabelRenderFunction;\n labelPosition?: number;\n labelStyle?:\n | CSSProperties\n | ((dataIndex: number) => CSSProperties | undefined);\n onBlur?: EventHandler<FocusEvent>;\n onClick?: EventHandler<MouseEvent>;\n onFocus?: EventHandler<FocusEvent>;\n onKeyDown?: EventHandler<KeyboardEvent>;\n onMouseOut?: EventHandler<MouseEvent>;\n onMouseOver?: EventHandler<MouseEvent>;\n paddingAngle?: number;\n radius?: number;\n reveal?: number;\n rounded?: boolean;\n segmentsShift?: number | ((dataIndex: number) => number | undefined);\n segmentsStyle?:\n | CSSProperties\n | ((dataIndex: number) => CSSProperties | undefined);\n segmentsTabIndex?: number;\n startAngle?: number;\n style?: CSSProperties;\n totalValue?: number;\n viewBoxSize?: [number, number];\n};\n\nconst defaultProps = {\n animationDuration: 500,\n animationEasing: 'ease-out',\n center: [50, 50] as [number, number],\n data: [] as Data,\n labelPosition: 50,\n lengthAngle: 360,\n lineWidth: 100,\n paddingAngle: 0,\n radius: 50,\n startAngle: 0,\n viewBoxSize: [100, 100] as [number, number],\n};\n\nexport type PropsWithDefaults = Props & typeof defaultProps;\n\nexport function ReactMinimalPieChart(props: PropsWithDefaults) {\n const [revealOverride, setRevealOverride] = useState(\n props.animate ? 0 : null\n );\n useEffect(() => {\n if (props.animate) {\n return startInitialAnimation();\n }\n\n function startInitialAnimation() {\n let animationTimerId: NodeJS.Timeout | null;\n let animationRAFId: number | null;\n animationTimerId = setTimeout(() => {\n animationTimerId = null;\n animationRAFId = requestAnimationFrame(() => {\n animationRAFId = null;\n setRevealOverride(null); // Start animation\n });\n });\n\n return () => {\n animationTimerId && clearTimeout(animationTimerId);\n animationRAFId && cancelAnimationFrame(animationRAFId);\n };\n }\n }, []);\n\n const extendedData = extendData(props);\n return (\n <svg\n viewBox={`0 0 ${props.viewBoxSize[0]} ${props.viewBoxSize[1]}`}\n width=\"100%\"\n height=\"100%\"\n className={props.className}\n style={props.style}\n >\n {renderSegments(extendedData, props, revealOverride)}\n {props.label && renderLabels(extendedData, props)}\n {props.children}\n </svg>\n );\n}\n\nReactMinimalPieChart.defaultProps = defaultProps;\n"],"names":["degreesToRadians","degrees","Math","PI","valueBetween","value","min","max","extractPercentage","percentage","bisectorAngle","startAngle","lengthAngle","shiftVectorAlongAngle","angle","distance","angleRadians","dx","cos","dy","sin","isNumber","functionProp","prop","payload","sumValues","data","sum","i","length","extendData","totalAngle","totalValue","paddingAngle","chartStartAngle","total","normalizedTotalAngle","numberOfPaddings","abs","singlePaddingDegrees","sign","degreesTakenByPadding","degreesTakenByPaths","lastSegmentEnd","extendedData","dataEntry","valueInPercentage","push","Object","assign","ReactMinimalPieChartLabel","dataIndex","props","React","round","number","divisor","Number","EPSILON","evaluateTextAnchorPosition","labelPosition","lineWidth","labelHorizontalShift","innerRadius","renderLabelElement","renderLabel","labelProps","label","DefaultLabel","key","isValidElement","renderLabels","map","index","segmentsShift","distanceFromCenter","radius","labelRenderProps","x","center","y","textAnchor","style","labelStyle","partialCircle","cx","cy","r","start","end","fromX","fromY","toX","toY","large","sweep","module","makePathCommands","patchedLengthAngle","command","join","ReactMinimalPieChartPath","shift","reveal","rounded","title","pathRadius","pathCommands","strokeDasharray","strokeDashoffset","pathLength","undefined","combineSegmentTransitionsStyle","duration","easing","customStyle","transition","getRevealValue","animate","makeEventHandler","eventHandler","e","renderSegments","revealOverride","paths","segmentsStyle","Path","animationDuration","animationEasing","color","segmentsTabIndex","onBlur","onClick","onFocus","onKeyDown","onMouseOver","onMouseOut","background","unshift","defaultProps","viewBoxSize","ReactMinimalPieChart","useState","setRevealOverride","useEffect","startInitialAnimation","animationTimerId","animationRAFId","setTimeout","requestAnimationFrame","clearTimeout","cancelAnimationFrame","className","children"],"mappings":";;;;;;;;;;EAAO,SAASA,gBAAT,CAA0BC,OAA1B,EAA2C;EAChD,SAAQA,OAAO,GAAGC,IAAI,CAACC,EAAhB,GAAsB,GAA7B;EACD;EAEM,SAASC,YAAT,CAAsBC,KAAtB,EAAqCC,GAArC,EAAkDC,GAAlD,EAA+D;EACpE,MAAIF,KAAK,GAAGE,GAAZ,EAAiB,OAAOA,GAAP;EACjB,MAAIF,KAAK,GAAGC,GAAZ,EAAiB,OAAOA,GAAP;EACjB,SAAOD,KAAP;EACD;EAEM,SAASG,iBAAT,CAA2BH,KAA3B,EAA0CI,UAA1C,EAA8D;EACnE,SAAQA,UAAU,GAAG,GAAd,GAAqBJ,KAA5B;EACD;EAEM,SAASK,aAAT,CAAuBC,UAAvB,EAA2CC,WAA3C,EAAgE;EACrE,SAAOD,UAAU,GAAGC,WAAW,GAAG,CAAlC;EACD;EAEM,SAASC,qBAAT,CAA+BC,KAA/B,EAA8CC,QAA9C,EAAgE;EACrE,MAAMC,YAAY,GAAGhB,gBAAgB,CAACc,KAAD,CAArC;EACA,SAAO;EACLG,IAAAA,EAAE,EAAEF,QAAQ,GAAGb,IAAI,CAACgB,GAAL,CAASF,YAAT,CADV;EAELG,IAAAA,EAAE,EAAEJ,QAAQ,GAAGb,IAAI,CAACkB,GAAL,CAASJ,YAAT;EAFV,GAAP;EAID;EAEM,SAASK,QAAT,CAAkBhB,KAAlB,EAAmD;EACxD,SAAO,OAAOA,KAAP,KAAiB,QAAxB;EACD;EAEM,SAASiB,YAAT,CACLC,IADK,EAELC,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iesLoose(source, excluded) {
|
|
|
85
85
|
return target;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
props = _objectWithoutPropertiesLoose(_ref, ["dataEntry", "dataIndex"]);
|
|
88
|
+
function ReactMinimalPieChartLabel(_ref) {
|
|
89
|
+
_ref.dataEntry;
|
|
90
|
+
_ref.dataIndex;
|
|
91
|
+
var props = _objectWithoutPropertiesLoose(_ref, ["dataEntry", "dataIndex"]);
|
|
92
92
|
|
|
93
93
|
return /*#__PURE__*/React.createElement("text", Object.assign({
|
|
94
94
|
dominantBaseline: "central"
|
|
95
95
|
}, props));
|
|
96
96
|
}
|
|
97
|
-
Label.displayName = 'ReactMinimalPieChartLabel';
|
|
98
97
|
|
|
99
98
|
function round(number) {
|
|
100
99
|
var divisor = 1e14; // 14 decimals
|
|
@@ -132,7 +131,7 @@ function renderLabelElement(renderLabel, labelProps) {
|
|
|
132
131
|
var label = renderLabel(labelProps);
|
|
133
132
|
|
|
134
133
|
if (typeof label === 'string' || typeof label === 'number') {
|
|
135
|
-
return /*#__PURE__*/React.createElement(
|
|
134
|
+
return /*#__PURE__*/React.createElement(ReactMinimalPieChartLabel, Object.assign({
|
|
136
135
|
key: "label-" + (labelProps.dataEntry.key || labelProps.dataIndex)
|
|
137
136
|
}, labelProps), label);
|
|
138
137
|
}
|
|
@@ -195,7 +194,7 @@ function makePathCommands(cx, cy, startAngle, lengthAngle, radius) {
|
|
|
195
194
|
return command.join(' ');
|
|
196
195
|
}).join(' ');
|
|
197
196
|
}
|
|
198
|
-
function
|
|
197
|
+
function ReactMinimalPieChartPath(_ref) {
|
|
199
198
|
var cx = _ref.cx,
|
|
200
199
|
cy = _ref.cy,
|
|
201
200
|
lengthAngle = _ref.lengthAngle,
|
|
@@ -235,7 +234,6 @@ function Path(_ref) {
|
|
|
235
234
|
strokeLinecap: rounded ? 'round' : undefined
|
|
236
235
|
}, props), title && /*#__PURE__*/React.createElement("title", null, title));
|
|
237
236
|
}
|
|
238
|
-
Path.displayName = 'ReactMinimalPieChartPath';
|
|
239
237
|
|
|
240
238
|
function combineSegmentTransitionsStyle(duration, easing, customStyle) {
|
|
241
239
|
// Merge chart's animation CSS transition with "transition" found to customStyle
|
|
@@ -275,7 +273,7 @@ function renderSegments(data, props, revealOverride) {
|
|
|
275
273
|
var lineWidth = extractPercentage(radius, props.lineWidth);
|
|
276
274
|
var paths = data.map(function (dataEntry, index) {
|
|
277
275
|
var segmentsStyle = functionProp(props.segmentsStyle, index);
|
|
278
|
-
return /*#__PURE__*/React.createElement(
|
|
276
|
+
return /*#__PURE__*/React.createElement(ReactMinimalPieChartPath, {
|
|
279
277
|
cx: cx,
|
|
280
278
|
cy: cy,
|
|
281
279
|
key: dataEntry.key || index,
|
|
@@ -300,7 +298,7 @@ function renderSegments(data, props, revealOverride) {
|
|
|
300
298
|
});
|
|
301
299
|
|
|
302
300
|
if (props.background) {
|
|
303
|
-
paths.unshift( /*#__PURE__*/React.createElement(
|
|
301
|
+
paths.unshift( /*#__PURE__*/React.createElement(ReactMinimalPieChartPath, {
|
|
304
302
|
cx: cx,
|
|
305
303
|
cy: cy,
|
|
306
304
|
key: "bg",
|
|
@@ -329,7 +327,7 @@ var defaultProps = {
|
|
|
329
327
|
startAngle: 0,
|
|
330
328
|
viewBoxSize: [100, 100]
|
|
331
329
|
};
|
|
332
|
-
function
|
|
330
|
+
function ReactMinimalPieChart(props) {
|
|
333
331
|
var _useState = useState(props.animate ? 0 : null),
|
|
334
332
|
revealOverride = _useState[0],
|
|
335
333
|
setRevealOverride = _useState[1];
|
|
@@ -364,8 +362,7 @@ function PieChart(props) {
|
|
|
364
362
|
style: props.style
|
|
365
363
|
}, renderSegments(extendedData, props, revealOverride), props.label && renderLabels(extendedData, props), props.children);
|
|
366
364
|
}
|
|
367
|
-
|
|
368
|
-
PieChart.displayName = 'ReactMinimalPieChart';
|
|
365
|
+
ReactMinimalPieChart.defaultProps = defaultProps;
|
|
369
366
|
|
|
370
|
-
export { PieChart };
|
|
367
|
+
export { ReactMinimalPieChart as PieChart };
|
|
371
368
|
//# sourceMappingURL=index.js.map
|