diff --git a/package.json b/package.json index 2d130157..23e3ee7e 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "react-dom": "18" }, "dependencies": { + "@nivo/pie": "^0.83.0", "@status-im/components": "^0.2.6", "@status-im/react": "^0.1.1", "@tamagui/config": "1.36.4", diff --git a/src/App.tsx b/src/App.tsx index b90b2581..92899866 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,126 +1,199 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import { Button, TamaguiProvider } from 'tamagui' + + +import { TamaguiProvider } from 'tamagui' import './App.css' -import { Button as StatusButton, Provider as StatusProvider } from '@status-im/components' +import { Provider as StatusProvider } from '@status-im/components' +import { ResponsivePie } from '@nivo/pie' import config from '../tamagui.config' - -interface State { - series: number[] - options: { - chart: { - type: 'donut' - } - - labels: string[] - - dataLabels: { - enabled: boolean - } - - legend: { - show: boolean - } - - plotOptions: { - radialBar: { - startAngle: number - endAngle: number - - hollow: { - size: number | string - } - track: { - show: boolean - } - - dataLabels: { - show: boolean - } - } - } - - colors: string[] +const data = [ + { + "id": "php", + "label": "php", + "value": 127, + "color": "hsl(236, 70%, 50%)" + }, + { + "id": "javascript", + "label": "javascript", + "value": 540, + "color": "hsl(249, 70%, 50%)" + }, + { + "id": "java", + "label": "java", + "value": 240, + "color": "hsl(72, 70%, 50%)" + }, + { + "id": "python", + "label": "python", + "value": 435, + "color": "hsl(122, 70%, 50%)" + }, + { + "id": "scala", + "label": "scala", + "value": 197, + "color": "hsl(186, 70%, 50%)" } +] +interface Data { + id: string; + label: string; + value: number; + color: string; +} +interface MyPieProps { + data: Data[]; } -class ApexChart extends Component { - constructor(props: ApexChartProps) { - super(props) - this.state = { - series: props.series, - options: { - chart: { - type: 'donut', - }, - labels: [], - dataLabels: { - enabled: false, - }, - legend: { - show: false, - }, - plotOptions: { - radialBar: { - startAngle: 240, // Adjust this - endAngle: 0, - hollow: { - size: '70%', - }, - track: { - show: false, - }, - dataLabels: { - show: false, - }, - }, - }, - colors: [ '#ea5e78', 'rgba(234, 94, 120, 0)'], - }, - } - } +const MyResponsivePie = (props:MyPieProps) => { - render() { - return ( -
- + -
- ) - } -} + ) + } + + function App() { - //write function that recieves one number and returns rest to 100 (100 - number) and pass it to series prop of ApexChart component as an array of two numbers (the number and the result of the function) and then pass it to the App component as a prop (mySeries) - const num = 30 - const mySeries = [num, 100 - num] + return ( - - - Status LEL -
- - Vite logo - - - React logo - -
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

Click on the Vite and React logos to learn more

+ +
+ + +
) diff --git a/yarn.lock b/yarn.lock index e8437027..1b817466 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3346,6 +3346,121 @@ __metadata: languageName: node linkType: hard +"@nivo/arcs@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/arcs@npm:0.83.0" + dependencies: + "@nivo/colors": 0.83.0 + "@nivo/core": 0.83.0 + "@react-spring/web": 9.4.5 || ^9.7.2 + "@types/d3-shape": ^2.0.0 + d3-shape: ^1.3.5 + peerDependencies: + react: ">= 16.14.0 < 19.0.0" + checksum: cd76413c3bb826627534878a55d55c9cc11ac98895dc52cd14e33e3f07de95a126eb5e3412e39f8ebcf5327855959122961d7f07dff20ec5dcb3745bfcec1a67 + languageName: node + linkType: hard + +"@nivo/colors@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/colors@npm:0.83.0" + dependencies: + "@nivo/core": 0.83.0 + "@types/d3-color": ^2.0.0 + "@types/d3-scale": ^3.2.3 + "@types/d3-scale-chromatic": ^2.0.0 + "@types/prop-types": ^15.7.2 + d3-color: ^3.1.0 + d3-scale: ^3.2.3 + d3-scale-chromatic: ^2.0.0 + lodash: ^4.17.21 + prop-types: ^15.7.2 + peerDependencies: + react: ">= 16.14.0 < 19.0.0" + checksum: d06ea2b3f9dbec20aa1d623b2aefa8e5be9c925448285611aaef027c2ee2caa9262bb4f2a8db5315e8c2f706290df16d0a92d7020847ea4c0260ff85699433f1 + languageName: node + linkType: hard + +"@nivo/core@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/core@npm:0.83.0" + dependencies: + "@nivo/recompose": 0.83.0 + "@nivo/tooltip": 0.83.0 + "@react-spring/web": 9.4.5 || ^9.7.2 + "@types/d3-shape": ^2.0.0 + d3-color: ^3.1.0 + d3-format: ^1.4.4 + d3-interpolate: ^2.0.1 + d3-scale: ^3.2.3 + d3-scale-chromatic: ^2.0.0 + d3-shape: ^1.3.5 + d3-time-format: ^3.0.0 + lodash: ^4.17.21 + peerDependencies: + prop-types: ">= 15.5.10 < 16.0.0" + react: ">= 16.14.0 < 19.0.0" + checksum: d60e2626790b229bf8137600a704c597b3321ad862df1bcbb03bd19b7b36d58ea68786776c1f0c6d332aa914eac169364e4ed722ae13e20a183c35d7190a320a + languageName: node + linkType: hard + +"@nivo/legends@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/legends@npm:0.83.0" + dependencies: + "@nivo/colors": 0.83.0 + "@nivo/core": 0.83.0 + "@types/d3-scale": ^3.2.3 + "@types/prop-types": ^15.7.2 + d3-scale: ^3.2.3 + prop-types: ^15.7.2 + peerDependencies: + react: ">= 16.14.0 < 19.0.0" + checksum: 2732e2781b27c403b3623a59232573074ba4cf91668802a6d2d184be0300ec3455e29f3dde188d635e506ad94a56680cdf2f34a721f685a224cac1eab1be3a84 + languageName: node + linkType: hard + +"@nivo/pie@npm:^0.83.0": + version: 0.83.0 + resolution: "@nivo/pie@npm:0.83.0" + dependencies: + "@nivo/arcs": 0.83.0 + "@nivo/colors": 0.83.0 + "@nivo/core": 0.83.0 + "@nivo/legends": 0.83.0 + "@nivo/tooltip": 0.83.0 + "@types/d3-shape": ^2.0.0 + d3-shape: ^1.3.5 + peerDependencies: + react: ">= 16.14.0 < 19.0.0" + checksum: f681d40d4ca2e67fba597cdb0c678454b5697ef8d98a53891b90cd19952b3db0b291512c52d7dd9d458b53f3c3b668825e3921beed6e947e9289708ef7455c30 + languageName: node + linkType: hard + +"@nivo/recompose@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/recompose@npm:0.83.0" + dependencies: + "@types/prop-types": ^15.7.2 + "@types/react-lifecycles-compat": ^3.0.1 + prop-types: ^15.7.2 + react-lifecycles-compat: ^3.0.4 + peerDependencies: + react: ">= 16.14.0 < 19.0.0" + checksum: db8cf104c742c04acebd83e02a200909893a734c13b1d1a4a8e47b4d21ccad47dc7eb47bde60476f0e3e07f006a7937ef96eb50a18e78cd6d9425a1812af93b1 + languageName: node + linkType: hard + +"@nivo/tooltip@npm:0.83.0": + version: 0.83.0 + resolution: "@nivo/tooltip@npm:0.83.0" + dependencies: + "@nivo/core": 0.83.0 + "@react-spring/web": 9.4.5 || ^9.7.2 + checksum: d49627a3c5ce1d2af5098c1e7d7e6fad817e45cada3510835cb02739cecf23f7a4e2936d06ff32934fc884bc7ce8b8bcde2efa32eacba61c7620267adb0b2cdf + languageName: node + linkType: hard + "@noble/ed25519@npm:^1.6.0": version: 1.7.3 resolution: "@noble/ed25519@npm:1.7.3" @@ -4910,6 +5025,64 @@ __metadata: languageName: node linkType: hard +"@react-spring/animated@npm:~9.7.3": + version: 9.7.3 + resolution: "@react-spring/animated@npm:9.7.3" + dependencies: + "@react-spring/shared": ~9.7.3 + "@react-spring/types": ~9.7.3 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 468942ca3a11c02c3e56def26b2da9dd10ddbed548004245c4ac309cce00b58d971e781abed67db0d652f72737eaa73766ea9a43b8ef3b08a7ed2eddc04d4c39 + languageName: node + linkType: hard + +"@react-spring/core@npm:~9.7.3": + version: 9.7.3 + resolution: "@react-spring/core@npm:9.7.3" + dependencies: + "@react-spring/animated": ~9.7.3 + "@react-spring/shared": ~9.7.3 + "@react-spring/types": ~9.7.3 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 8a80a07276458fd14099320eda824e58a11ce3a9b03a5c9cd3f4252adb4d26da04ee5caf5cbc961199f55c2d58a99638d5ea292cdb6aa029208dbab741b5c531 + languageName: node + linkType: hard + +"@react-spring/shared@npm:~9.7.3": + version: 9.7.3 + resolution: "@react-spring/shared@npm:9.7.3" + dependencies: + "@react-spring/types": ~9.7.3 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 912b5e567eb5345c9a6c8e8c0c2d69b1f411af72a0685b95831809c267c89846a31341ca071f284ace98b3cb5de647054dc76f6ace81d6379513eaf96b52f195 + languageName: node + linkType: hard + +"@react-spring/types@npm:~9.7.3": + version: 9.7.3 + resolution: "@react-spring/types@npm:9.7.3" + checksum: f47b81fe556464aa54a78603311cb584d6a0f03088522229afb058265bbe2ade2095a55ec7f4e960c3b9cceaa5d47865bc41fc6643c0f5f4bd3d8650203d8389 + languageName: node + linkType: hard + +"@react-spring/web@npm:9.4.5 || ^9.7.2": + version: 9.7.3 + resolution: "@react-spring/web@npm:9.7.3" + dependencies: + "@react-spring/animated": ~9.7.3 + "@react-spring/core": ~9.7.3 + "@react-spring/shared": ~9.7.3 + "@react-spring/types": ~9.7.3 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 7f5cd05b2314b7f2f715e1926abcf9aa0a539399b222ab34e989144f48350adfcd2edab65d41425570f72c57f602fc6994d6730fbeed902171ac527b630a8a9b + languageName: node + linkType: hard + "@remix-run/router@npm:1.7.2": version: 1.7.2 resolution: "@remix-run/router@npm:1.7.2" @@ -7909,6 +8082,52 @@ __metadata: languageName: node linkType: hard +"@types/d3-color@npm:^2.0.0": + version: 2.0.3 + resolution: "@types/d3-color@npm:2.0.3" + checksum: b4a963b15f4fe0e7e49b0898df3e51b46392d91c21038b7ec61aef0f13e04bd7bcfebf06c9fad9ee92317c9682a105e18942c9295a7e2715855622d4d6fc415a + languageName: node + linkType: hard + +"@types/d3-path@npm:^2": + version: 2.0.2 + resolution: "@types/d3-path@npm:2.0.2" + checksum: 2ab49cc87b9d2cb90c189bedf5f0fdc2b1609c3c668664dc76c679054b4bb1bcfaf44e7836e1f7d0b38102cecc269a6c52a353e0ba238c992509cb0e9d6c5c33 + languageName: node + linkType: hard + +"@types/d3-scale-chromatic@npm:^2.0.0": + version: 2.0.1 + resolution: "@types/d3-scale-chromatic@npm:2.0.1" + checksum: 5c441309b4d226f51cf86b6adf6f5543067bd6f8adfa94024c5476e355b13b53571a9b52025fdc2713ad37e9146ebaea12a7d089f478dae55cf03797f5d212be + languageName: node + linkType: hard + +"@types/d3-scale@npm:^3.2.3": + version: 3.3.2 + resolution: "@types/d3-scale@npm:3.3.2" + dependencies: + "@types/d3-time": ^2 + checksum: 65dbf85f07a4d6ac26396075b0faa1930cfebb96dc248629d4b82c22457c89161d0f070f9a5554adccee80b959e2c6d7c1ef6b7355743afe91050d71014fe3cf + languageName: node + linkType: hard + +"@types/d3-shape@npm:^2.0.0": + version: 2.1.3 + resolution: "@types/d3-shape@npm:2.1.3" + dependencies: + "@types/d3-path": ^2 + checksum: d0855a1e2c11a4ab23367c86ef0cc104e12bf216f2c007fa5955da7179b60b0426d0e9ddbbbdf93d4342e7dd24c7bcfc3a2bc6258744e03fc44ca460a063dcc3 + languageName: node + linkType: hard + +"@types/d3-time@npm:^2": + version: 2.1.1 + resolution: "@types/d3-time@npm:2.1.1" + checksum: 115048d0cd312a3172ef7c03615dfbdbd8b92a93fd7b6d9ca93c49c704fcdb9575f4c57955eb54eb757b9834acaaf47fc52eae103d06246c59ae120de4559cbc + languageName: node + linkType: hard + "@types/detect-port@npm:^1.3.0": version: 1.3.3 resolution: "@types/detect-port@npm:1.3.3" @@ -8157,7 +8376,7 @@ __metadata: languageName: node linkType: hard -"@types/prop-types@npm:*": +"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.2": version: 15.7.5 resolution: "@types/prop-types@npm:15.7.5" checksum: 5b43b8b15415e1f298243165f1d44390403bb2bd42e662bca3b5b5633fdd39c938e91b7fce3a9483699db0f7a715d08cef220c121f723a634972fdf596aec980 @@ -8194,6 +8413,15 @@ __metadata: languageName: node linkType: hard +"@types/react-lifecycles-compat@npm:^3.0.1": + version: 3.0.1 + resolution: "@types/react-lifecycles-compat@npm:3.0.1" + dependencies: + "@types/react": "*" + checksum: e45450115da6f767217f87c10529d3bd07d5f8aed2f339b440e986cf9a28195249ecd3cd9a372cc3960fdb9c1ad4a0110ee2bce317604e6f0aa47909064bac66 + languageName: node + linkType: hard + "@types/react@npm:*, @types/react@npm:18, @types/react@npm:>=16": version: 18.2.18 resolution: "@types/react@npm:18.2.18" @@ -8756,20 +8984,6 @@ __metadata: languageName: node linkType: hard -"apexcharts@npm:^3.41.1": - version: 3.41.1 - resolution: "apexcharts@npm:3.41.1" - dependencies: - svg.draggable.js: ^2.2.2 - svg.easing.js: ^2.0.0 - svg.filter.js: ^2.0.2 - svg.pathmorphing.js: ^0.1.3 - svg.resize.js: ^1.4.3 - svg.select.js: ^3.0.1 - checksum: 096830c583f16093a16b940fc9268c5da620f084217df5695810a85b50aeb077f67b58aa3839c72e1c78a2ee4af6b4053286cf9f6599478789030ebbdff482fa - languageName: node - linkType: hard - "app-root-dir@npm:^1.0.2": version: 1.0.2 resolution: "app-root-dir@npm:1.0.2" @@ -10047,6 +10261,109 @@ __metadata: languageName: node linkType: hard +"d3-array@npm:2, d3-array@npm:^2.3.0": + version: 2.12.1 + resolution: "d3-array@npm:2.12.1" + dependencies: + internmap: ^1.0.0 + checksum: 97853b7b523aded17078f37c67742f45d81e88dda2107ae9994c31b9e36c5fa5556c4c4cf39650436f247813602dfe31bf7ad067ff80f127a16903827f10c6eb + languageName: node + linkType: hard + +"d3-color@npm:1 - 2": + version: 2.0.0 + resolution: "d3-color@npm:2.0.0" + checksum: b887354aa383937abd04fbffed3e26e5d6a788472cd3737fb10735930e427763e69fe93398663bccf88c0b53ee3e638ac6fcf0c02226b00ed9e4327c2dfbf3dc + languageName: node + linkType: hard + +"d3-color@npm:^3.1.0": + version: 3.1.0 + resolution: "d3-color@npm:3.1.0" + checksum: 4931fbfda5d7c4b5cfa283a13c91a954f86e3b69d75ce588d06cde6c3628cebfc3af2069ccf225e982e8987c612aa7948b3932163ce15eb3c11cd7c003f3ee3b + languageName: node + linkType: hard + +"d3-format@npm:1 - 2": + version: 2.0.0 + resolution: "d3-format@npm:2.0.0" + checksum: c4d3c8f9941d097d514d3986f54f21434e08e5876dc08d1d65226447e8e167600d5b9210235bb03fd45327225f04f32d6e365f08f76d2f4b8bff81594851aaf7 + languageName: node + linkType: hard + +"d3-format@npm:^1.4.4": + version: 1.4.5 + resolution: "d3-format@npm:1.4.5" + checksum: 1b8b2c0bca182173bccd290a43e8b635a83fc8cfe52ec878c7bdabb997d47daac11f2b175cebbe73f807f782ad655f542bdfe18180ca5eb3498a3a82da1e06ab + languageName: node + linkType: hard + +"d3-interpolate@npm:1 - 2, d3-interpolate@npm:1.2.0 - 2, d3-interpolate@npm:^2.0.1": + version: 2.0.1 + resolution: "d3-interpolate@npm:2.0.1" + dependencies: + d3-color: 1 - 2 + checksum: 4a2018ac34fbcc3e0e7241e117087ca1b2274b8b33673913658623efacc5db013b8d876586d167b23e3145bdb34ec8e441d301299b082e1a90985b2f18d4299c + languageName: node + linkType: hard + +"d3-path@npm:1": + version: 1.0.9 + resolution: "d3-path@npm:1.0.9" + checksum: d4382573baf9509a143f40944baeff9fead136926aed6872f7ead5b3555d68925f8a37935841dd51f1d70b65a294fe35c065b0906fb6e42109295f6598fc16d0 + languageName: node + linkType: hard + +"d3-scale-chromatic@npm:^2.0.0": + version: 2.0.0 + resolution: "d3-scale-chromatic@npm:2.0.0" + dependencies: + d3-color: 1 - 2 + d3-interpolate: 1 - 2 + checksum: 9fe5b4c1d9907abbda76e414856d9089182a0641f3bbf43d8d3008dbcccb52781e21793682e2b53663d3c6cd63e76965f961894e53ed3b01a345797412fe5b1f + languageName: node + linkType: hard + +"d3-scale@npm:^3.2.3": + version: 3.3.0 + resolution: "d3-scale@npm:3.3.0" + dependencies: + d3-array: ^2.3.0 + d3-format: 1 - 2 + d3-interpolate: 1.2.0 - 2 + d3-time: ^2.1.1 + d3-time-format: 2 - 3 + checksum: f77e73f0fb422292211d0687914c30d26e29011a936ad2a535a868ae92f306c3545af1fe7ea5db1b3e67dbce7a6c6cd952e53d02d1d557543e7e5d30e30e52f2 + languageName: node + linkType: hard + +"d3-shape@npm:^1.3.5": + version: 1.3.7 + resolution: "d3-shape@npm:1.3.7" + dependencies: + d3-path: 1 + checksum: 46566a3ab64a25023653bf59d64e81e9e6c987e95be985d81c5cedabae5838bd55f4a201a6b69069ca862eb63594cd263cac9034afc2b0e5664dfe286c866129 + languageName: node + linkType: hard + +"d3-time-format@npm:2 - 3, d3-time-format@npm:^3.0.0": + version: 3.0.0 + resolution: "d3-time-format@npm:3.0.0" + dependencies: + d3-time: 1 - 2 + checksum: c20c1667dbea653f81d923e741f84c23e4b966002ba0d6ed94cbc70692105566e55e89d18d175404534a879383fd1123300bd12885a3c924fe924032bb0060db + languageName: node + linkType: hard + +"d3-time@npm:1 - 2, d3-time@npm:^2.1.1": + version: 2.1.1 + resolution: "d3-time@npm:2.1.1" + dependencies: + d3-array: 2 + checksum: d1c7b9658c20646e46c3dd19e11c38e02dec098e8baa7d2cd868af8eb01953668f5da499fa33dc63541cf74a26e788786f8828c4381dbbf475a76b95972979a6 + languageName: node + linkType: hard + "datastore-core@npm:^8.0.1": version: 8.0.4 resolution: "datastore-core@npm:8.0.4" @@ -12590,6 +12907,13 @@ __metadata: languageName: node linkType: hard +"internmap@npm:^1.0.0": + version: 1.0.1 + resolution: "internmap@npm:1.0.1" + checksum: 9d00f8c0cf873a24a53a5a937120dab634c41f383105e066bb318a61864e6292d24eb9516e8e7dccfb4420ec42ca474a0f28ac9a6cc82536898fa09bbbe53813 + languageName: node + linkType: hard + "invariant@npm:^2.2.4": version: 2.2.4 resolution: "invariant@npm:2.2.4" @@ -15099,6 +15423,7 @@ __metadata: resolution: "nimbus-gui@workspace:." dependencies: "@fsouza/prettierd": ^0.24.2 + "@nivo/pie": ^0.83.0 "@status-im/components": ^0.2.6 "@status-im/react": ^0.1.1 "@storybook/addon-essentials": ^7.2.0 @@ -15119,7 +15444,6 @@ __metadata: "@typescript-eslint/eslint-plugin": ^6.0.0 "@typescript-eslint/parser": ^6.0.0 "@vitejs/plugin-react": ^4.0.3 - apexcharts: ^3.41.1 eslint: ^8.45.0 eslint-plugin-react-hooks: ^4.6.0 eslint-plugin-react-refresh: ^0.4.3 @@ -16100,7 +16424,7 @@ __metadata: languageName: node linkType: hard -"prop-types@npm:^15.6.0, prop-types@npm:^15.7.2, prop-types@npm:^15.8.1": +"prop-types@npm:^15.6.0, prop-types@npm:^15.7.2": version: 15.8.1 resolution: "prop-types@npm:15.8.1" dependencies: @@ -16355,18 +16679,6 @@ __metadata: languageName: node linkType: hard -"react-apexcharts@npm:^1.4.1": - version: 1.4.1 - resolution: "react-apexcharts@npm:1.4.1" - dependencies: - prop-types: ^15.8.1 - peerDependencies: - apexcharts: ^3.41.0 - react: ">=0.13" - checksum: 32d1a946ad40493ecd82f7ba68c8657424a8cf0d08e0cd813752211175d6b23dd3ae9f0f7edbac9dd2bbc050a7f3531ca6e5d7ea0158f1c276c49c4f397f347f - languageName: node - linkType: hard - "react-colorful@npm:^5.1.2": version: 5.6.1 resolution: "react-colorful@npm:5.6.1" @@ -16499,6 +16811,13 @@ __metadata: languageName: node linkType: hard +"react-lifecycles-compat@npm:^3.0.4": + version: 3.0.4 + resolution: "react-lifecycles-compat@npm:3.0.4" + checksum: a904b0fc0a8eeb15a148c9feb7bc17cec7ef96e71188280061fc340043fd6d8ee3ff233381f0e8f95c1cf926210b2c4a31f38182c8f35ac55057e453d6df204f + languageName: node + linkType: hard + "react-native-svg@npm:^13.10.0": version: 13.10.0 resolution: "react-native-svg@npm:13.10.0"