@automattic/charts 0.3.0 → 0.4.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/CHANGELOG.md +14 -0
- package/dist/cjs/components/bar-chart/index.js +2 -3
- package/dist/cjs/components/bar-chart/index.js.map +1 -1
- package/dist/cjs/components/bar-chart/style.css +94 -5
- package/dist/cjs/components/grid-control/index.js +2 -3
- package/dist/cjs/components/grid-control/index.js.map +1 -1
- package/dist/cjs/components/grid-control/style.css +94 -2
- package/dist/cjs/components/legend/index.js +2 -3
- package/dist/cjs/components/legend/index.js.map +1 -1
- package/dist/cjs/components/legend/style.css +94 -2
- package/dist/cjs/components/line-chart/index.js +2 -3
- package/dist/cjs/components/line-chart/index.js.map +1 -1
- package/dist/cjs/components/line-chart/style.css +94 -3
- package/dist/cjs/components/pie-chart/index.js +2 -3
- package/dist/cjs/components/pie-chart/index.js.map +1 -1
- package/dist/cjs/components/pie-chart/style.css +94 -4
- package/dist/cjs/components/pie-semi-circle-chart/index.js +2 -3
- package/dist/cjs/components/pie-semi-circle-chart/index.js.map +1 -1
- package/dist/cjs/components/pie-semi-circle-chart/style.css +94 -4
- package/dist/cjs/components/tooltip/index.js +2 -3
- package/dist/cjs/components/tooltip/index.js.map +1 -1
- package/dist/cjs/components/tooltip/style.css +94 -2
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/providers/theme/index.js +2 -3
- package/dist/cjs/providers/theme/index.js.map +1 -1
- package/dist/cjs/providers/theme/style.css +95 -0
- package/dist/cjs/style.css +95 -9
- package/dist/index.d.ts +301 -0
- package/dist/mjs/components/bar-chart/index.js +2 -3
- package/dist/mjs/components/bar-chart/index.js.map +1 -1
- package/dist/mjs/components/bar-chart/style.css +94 -5
- package/dist/mjs/components/grid-control/index.js +2 -3
- package/dist/mjs/components/grid-control/index.js.map +1 -1
- package/dist/mjs/components/grid-control/style.css +94 -2
- package/dist/mjs/components/legend/index.js +2 -3
- package/dist/mjs/components/legend/index.js.map +1 -1
- package/dist/mjs/components/legend/style.css +94 -2
- package/dist/mjs/components/line-chart/index.js +2 -3
- package/dist/mjs/components/line-chart/index.js.map +1 -1
- package/dist/mjs/components/line-chart/style.css +94 -3
- package/dist/mjs/components/pie-chart/index.js +2 -3
- package/dist/mjs/components/pie-chart/index.js.map +1 -1
- package/dist/mjs/components/pie-chart/style.css +94 -4
- package/dist/mjs/components/pie-semi-circle-chart/index.js +2 -3
- package/dist/mjs/components/pie-semi-circle-chart/index.js.map +1 -1
- package/dist/mjs/components/pie-semi-circle-chart/style.css +94 -4
- package/dist/mjs/components/tooltip/index.js +2 -3
- package/dist/mjs/components/tooltip/index.js.map +1 -1
- package/dist/mjs/components/tooltip/style.css +94 -2
- package/dist/mjs/index.js +2 -3
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/providers/theme/index.js +2 -3
- package/dist/mjs/providers/theme/index.js.map +1 -1
- package/dist/mjs/providers/theme/style.css +95 -0
- package/dist/mjs/style.css +95 -9
- package/global.d.ts +14 -0
- package/package.json +29 -8
- package/rollup.config.mjs +142 -0
- package/src/components/line-chart/line-chart.tsx +50 -15
- package/src/components/pie-chart/__tests__/pie-chart.test.tsx +59 -0
- package/src/components/pie-chart/pie-chart.tsx +91 -6
- package/src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx +17 -12
- package/src/components/shared/with-responsive.tsx +4 -3
- package/src/types.ts +25 -0
- package/tests/jest.config.cjs +12 -0
- package/tests/jest.setup.js +13 -0
- package/dist/cjs/components/bar-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/bar-chart/style.css.map +0 -1
- package/dist/cjs/components/grid-control/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/grid-control/style.css.map +0 -1
- package/dist/cjs/components/legend/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/legend/style.css.map +0 -1
- package/dist/cjs/components/line-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/line-chart/style.css.map +0 -1
- package/dist/cjs/components/pie-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/pie-chart/style.css.map +0 -1
- package/dist/cjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/pie-semi-circle-chart/style.css.map +0 -1
- package/dist/cjs/components/tooltip/index.js.LICENSE.txt +0 -9
- package/dist/cjs/components/tooltip/style.css.map +0 -1
- package/dist/cjs/index.js.LICENSE.txt +0 -9
- package/dist/cjs/providers/theme/index.js.LICENSE.txt +0 -9
- package/dist/cjs/style.css.map +0 -1
- package/dist/mjs/components/bar-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/bar-chart/style.css.map +0 -1
- package/dist/mjs/components/grid-control/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/grid-control/style.css.map +0 -1
- package/dist/mjs/components/legend/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/legend/style.css.map +0 -1
- package/dist/mjs/components/line-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/line-chart/style.css.map +0 -1
- package/dist/mjs/components/pie-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/pie-chart/style.css.map +0 -1
- package/dist/mjs/components/pie-semi-circle-chart/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/pie-semi-circle-chart/style.css.map +0 -1
- package/dist/mjs/components/tooltip/index.js.LICENSE.txt +0 -9
- package/dist/mjs/components/tooltip/style.css.map +0 -1
- package/dist/mjs/index.js.LICENSE.txt +0 -9
- package/dist/mjs/providers/theme/index.js.LICENSE.txt +0 -9
- package/dist/mjs/style.css.map +0 -1
- package/dist/types/components/bar-chart/bar-chart.d.ts +0 -5
- package/dist/types/components/bar-chart/index.d.ts +0 -1
- package/dist/types/components/grid-control/grid-control.d.ts +0 -4
- package/dist/types/components/grid-control/index.d.ts +0 -1
- package/dist/types/components/legend/base-legend.d.ts +0 -3
- package/dist/types/components/legend/index.d.ts +0 -2
- package/dist/types/components/legend/types.d.ts +0 -12
- package/dist/types/components/line-chart/index.d.ts +0 -1
- package/dist/types/components/line-chart/line-chart.d.ts +0 -11
- package/dist/types/components/pie-chart/index.d.ts +0 -1
- package/dist/types/components/pie-chart/pie-chart.d.ts +0 -9
- package/dist/types/components/pie-semi-circle-chart/index.d.ts +0 -1
- package/dist/types/components/pie-semi-circle-chart/pie-semi-circle-chart.d.ts +0 -22
- package/dist/types/components/shared/with-responsive.d.ts +0 -17
- package/dist/types/components/tooltip/base-tooltip.d.ts +0 -29
- package/dist/types/components/tooltip/index.d.ts +0 -2
- package/dist/types/hooks/use-chart-mouse-handler.d.ts +0 -41
- package/dist/types/index.d.ts +0 -8
- package/dist/types/providers/theme/index.d.ts +0 -2
- package/dist/types/providers/theme/theme-provider.d.ts +0 -18
- package/dist/types/providers/theme/themes.d.ts +0 -14
- package/dist/types/types.d.ts +0 -137
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/pie-semi-circle-chart/index.js","mappings":";wCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAA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ACXH,KAAO,CACN1B,MAAOuD,EAAYvD,MACnBtC,MAAO6F,EAAY7F,MACnBkE,aAAc2B,EAAY3B,cAE3BG,IAAMuB,GAAc,EACpBtB,KAAOqB,GAAe,IAItBP,IACD3C,EAAAA,EAAAA,KAAC+F,EAAM,CACN3G,MAAQ0F,EACRvF,YAAcqD,EACdvD,UCnLyF,2BDwL9F,EAEA6C,EAAmB8D,YAAc,qBACjC,SEzKCC,EFyKyD/D,EEtKqBgE,GAA9E/G,EAA4E,CAAC,GAArEgH,SAAAA,OAAQ,IAAAD,EAAG,KAAIA,EAAEE,OAAW,KAAbC,EAAAlH,EAAEiH,aAAc,GAAGC,EAAEC,OAAY,KAAdC,EAAApH,EAAEmH,cAAe,GAAEC,EAEtD,SAA0B1K,GAChC,IAAA2K,GAA0CC,EAAAA,EAAAA,eAAe,CACxDH,aAAAA,EACAI,2BAA2B,EAC3BC,YAAa,CAAE1F,MAAO,IAAKC,OAAQ,OAH5B0F,EAASJ,EAATI,UAAkBC,EAAWL,EAAlBvF,MAOb6F,EAAiBD,EAAc/C,KAAKiD,IAAKF,EAAaV,GAAa,IACnEa,EAAkBF,EAAiBV,EAEzC,OACCpG,EAAAA,EAAAA,KAAA,OACClF,IAAM8L,EACN3E,MAAQ,CACPhB,MAAO,OACPgG,UAAW,GAAF7G,OAAM4G,EAAe,OAC5B1G,UAEHN,EAAAA,EAAAA,KAACiG,EAAgBrC,EAAA,CAChB3C,MAAQ6F,EACR5F,OAAS8F,GAEFnL,KAIX,GAjCM,IACNoK,EAGA9G,EAA8E+G,EAAtEC,EAAeE,EAAED,EAAiBG,EAAED","sources":["webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://@automattic/charts/../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js","webpack://@automattic/charts/external commonjs2 \"react\"","webpack://@automattic/charts/webpack/bootstrap","webpack://@automattic/charts/webpack/runtime/compat get default export","webpack://@automattic/charts/webpack/runtime/define property getters","webpack://@automattic/charts/webpack/runtime/hasOwnProperty shorthand","webpack://@automattic/charts/webpack/runtime/make namespace object","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape/lib/shapes/Pie\"","webpack://@automattic/charts/external commonjs2 \"@visx/text\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/./src/providers/theme/themes.ts","webpack://@automattic/charts/./src/providers/theme/theme-provider.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/legend\"","webpack://@automattic/charts/external commonjs2 \"@visx/scale\"","webpack://@automattic/charts/./src/components/legend/legend.module.scss?843e","webpack://@automattic/charts/./src/components/legend/base-legend.tsx","webpack://@automattic/charts/external commonjs2 \"@visx/responsive\"","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.tsx","webpack://@automattic/charts/./src/components/tooltip/base-tooltip.module.scss?1d14","webpack://@automattic/charts/./src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx","webpack://@automattic/charts/./src/components/pie-semi-circle-chart/pie-semi-circle-chart.module.scss?31c2","webpack://@automattic/charts/./src/components/shared/with-responsive.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape/lib/shapes/Pie\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/text\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","import type { ChartTheme } from '../../types';\n\n/**\n * Default theme configuration\n */\nconst defaultTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Jetpack theme configuration\n */\nconst jetpackTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#98C8DF', '#006DAB', '#A6DC80', '#1F9828', '#FF8C8F' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\n/**\n * Woo theme configuration\n */\nconst wooTheme: ChartTheme = {\n\tbackgroundColor: '#FFFFFF', // chart background color\n\tlabelBackgroundColor: '#FFFFFF', // label background color\n\tcolors: [ '#80C8FF', '#B999FF', '#3858E9' ],\n\tgridStyles: {\n\t\tstroke: '#787C82',\n\t\tstrokeWidth: 1,\n\t},\n\ttickLength: 0,\n\tgridColor: '',\n\tgridColorDark: '',\n};\n\nexport { defaultTheme, jetpackTheme, wooTheme };\n","import { createContext, useContext, FC, type ReactNode } from 'react';\nimport { defaultTheme } from './themes';\nimport type { ChartTheme } from '../../types';\n\n/**\n * Context for sharing theme configuration across components\n */\nconst ThemeContext = createContext< ChartTheme >( defaultTheme );\n\n/**\n * Hook to access chart theme\n * @return {object} A built theme configuration compatible with visx charts\n */\nconst useChartTheme = () => {\n\tconst theme = useContext( ThemeContext );\n\treturn theme;\n};\n\n/**\n * Props for the ThemeProvider component\n */\ntype ThemeProviderProps = {\n\t/** Optional partial theme override */\n\ttheme?: Partial< ChartTheme >;\n\t/** Child components that will have access to the theme */\n\tchildren: ReactNode;\n};\n\n// Provider component for chart theming\n// Allows theme customization through props while maintaining default values\nconst ThemeProvider: FC< ThemeProviderProps > = ( { theme = {}, children } ) => {\n\tconst mergedTheme = { ...defaultTheme, ...theme };\n\treturn <ThemeContext.Provider value={ mergedTheme }>{ children }</ThemeContext.Provider>;\n};\n\nexport { ThemeProvider, useChartTheme };\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/legend\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/scale\");","// extracted by mini-css-extract-plugin\nexport default {\"legend--horizontal\":\"b1_5FxxoK4aEFLoe67IA\",\"legend--vertical\":\"vpmQkJAPhp3XJ9Wb6vOw\",\"legend-item\":\"IKM8KG1lF9e5NzDqMLOJ\",\"legend-item-swatch\":\"_eccyBq0v2puKsHw8XND\",\"legend-item-label\":\"UeZrUEpEK0tLzXHmeUco\",\"legend-item-value\":\"R5msPOYKm79jYV13H0v7\"};","import { LegendOrdinal } from '@visx/legend';\nimport { scaleOrdinal } from '@visx/scale';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport styles from './legend.module.scss';\nimport type { LegendProps } from './types';\n\n/**\n * Base legend component that displays color-coded items with labels using visx\n * @param {object} props - Component properties\n * @param {Array} props.items - Array of legend items to display\n * @param {string} props.className - Additional CSS class names\n * @param {string} props.orientation - Layout orientation (horizontal/vertical)\n * @return {JSX.Element} Rendered legend component\n */\nconst orientationToFlexDirection = {\n\thorizontal: 'row' as const,\n\tvertical: 'column' as const,\n};\n\nexport const BaseLegend: FC< LegendProps > = ( {\n\titems,\n\tclassName,\n\torientation = 'horizontal',\n} ) => {\n\tconst legendScale = scaleOrdinal( {\n\t\tdomain: items.map( item => item.label ),\n\t\trange: items.map( item => item.color ),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( styles.legend, styles[ `legend--${ orientation }` ], className ) }\n\t\t\trole=\"list\"\n\t\t>\n\t\t\t<LegendOrdinal\n\t\t\t\tscale={ legendScale }\n\t\t\t\tdirection={ orientationToFlexDirection[ orientation ] }\n\t\t\t\tshape=\"rect\"\n\t\t\t\tshapeWidth={ 16 }\n\t\t\t\tshapeHeight={ 16 }\n\t\t\t\tclassName={ styles[ 'legend-items' ] }\n\t\t\t>\n\t\t\t\t{ labels => (\n\t\t\t\t\t<div className={ styles[ `legend--${ orientation }` ] }>\n\t\t\t\t\t\t{ labels.map( label => (\n\t\t\t\t\t\t\t<div key={ label.text } className={ styles[ 'legend-item' ] }>\n\t\t\t\t\t\t\t\t<svg width={ 16 } height={ 16 }>\n\t\t\t\t\t\t\t\t\t<rect\n\t\t\t\t\t\t\t\t\t\twidth={ 16 }\n\t\t\t\t\t\t\t\t\t\theight={ 16 }\n\t\t\t\t\t\t\t\t\t\tfill={ label.value }\n\t\t\t\t\t\t\t\t\t\tclassName={ styles[ 'legend-item-swatch' ] }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-label' ] }>\n\t\t\t\t\t\t\t\t\t{ label.text }\n\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value && (\n\t\t\t\t\t\t\t\t\t\t<span className={ styles[ 'legend-item-value' ] }>\n\t\t\t\t\t\t\t\t\t\t\t{ items.find( item => item.label === label.text )?.value }\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</LegendOrdinal>\n\t\t</div>\n\t);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/responsive\");","import styles from './base-tooltip.module.scss';\nimport type { CSSProperties, ComponentType, ReactNode } from 'react';\n\ntype TooltipData = {\n\tlabel: string;\n\tvalue: number;\n\tvalueDisplay?: string;\n};\n\ntype TooltipComponentProps = {\n\tdata: TooltipData;\n\tclassName?: string;\n};\n\ntype TooltipCommonProps = {\n\ttop: number;\n\tleft: number;\n\tstyle?: CSSProperties;\n\tclassName?: string;\n};\n\ntype DefaultDataTooltip = {\n\tdata: TooltipData;\n\tcomponent?: ComponentType< TooltipComponentProps >;\n\tchildren?: never;\n};\n\ntype CustomTooltip = {\n\tchildren: ReactNode;\n\tdata?: never;\n\tcomponent?: never;\n};\n\ntype BaseTooltipProps = TooltipCommonProps & ( DefaultDataTooltip | CustomTooltip );\n\nconst DefaultTooltipContent = ( { data }: TooltipComponentProps ) => (\n\t<>\n\t\t{ data?.label }: { data?.valueDisplay || data?.value }\n\t</>\n);\n\nexport const BaseTooltip = ( {\n\tdata,\n\ttop,\n\tleft,\n\tcomponent: Component = DefaultTooltipContent,\n\tchildren,\n\tclassName,\n}: BaseTooltipProps ) => {\n\treturn (\n\t\t<div className={ styles.tooltip } style={ { top, left } } role=\"tooltip\">\n\t\t\t{ children || ( data && <Component data={ data } className={ className } /> ) }\n\t\t</div>\n\t);\n};\n\nexport type { BaseTooltipProps, TooltipData };\n","// extracted by mini-css-extract-plugin\nexport default {\"tooltip\":\"Jmgc7XAf2uAyK5059rBe\"};","import { localPoint } from '@visx/event';\nimport { Group } from '@visx/group';\nimport Pie, { type PieArcDatum } from '@visx/shape/lib/shapes/Pie';\nimport { Text } from '@visx/text';\nimport { useTooltip } from '@visx/tooltip';\nimport clsx from 'clsx';\nimport { FC, useCallback } from 'react';\nimport { useChartTheme } from '../../providers/theme/theme-provider';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './pie-semi-circle-chart.module.scss';\nimport type { BaseChartProps, DataPointPercentage } from '../../types';\n\ninterface PieSemiCircleChartProps extends BaseChartProps< DataPointPercentage[] > {\n\t/**\n\t * Label text to display above the chart\n\t */\n\tlabel: string;\n\t/**\n\t * Note text to display below the label\n\t */\n\tnote: string;\n\t/**\n\t * Direction of chart rendering\n\t * true for clockwise, false for counter-clockwise\n\t */\n\tclockwise?: boolean;\n\t/**\n\t * Thickness of the pie chart. A value between 0 and 1\n\t */\n\tthickness?: number;\n}\n\ntype ArcData = PieArcDatum< DataPointPercentage >;\n\nconst PieSemiCircleChart: FC< PieSemiCircleChartProps > = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\tlabel,\n\tnote,\n\tclassName,\n\twithTooltips = false,\n\tclockwise = true,\n\tthickness = 0.4,\n\tshowLegend,\n\tlegendOrientation,\n} ) => {\n\tconst providerTheme = useChartTheme();\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPointPercentage >();\n\n\tconst centerX = width / 2;\n\tconst height = width / 2;\n\tconst radius = width / 2;\n\tconst pad = 0.03;\n\tconst innerRadius = radius * ( 1 - thickness + pad );\n\n\t// Map the data to include index for color assignment\n\tconst dataWithIndex = data.map( ( d, index ) => ( {\n\t\t...d,\n\t\tindex,\n\t} ) );\n\n\t// Set the clockwise direction based on the prop\n\tconst startAngle = clockwise ? -Math.PI / 2 : Math.PI / 2;\n\tconst endAngle = clockwise ? Math.PI / 2 : -Math.PI / 2;\n\n\tconst accessors = {\n\t\tvalue: ( d: DataPointPercentage & { index: number } ) => d.value,\n\t\tsort: (\n\t\t\ta: DataPointPercentage & { index: number },\n\t\t\tb: DataPointPercentage & { index: number }\n\t\t) => b.value - a.value,\n\t\t// Use the color property from the data object as a last resort. The theme provides colours by default.\n\t\tfill: ( d: DataPointPercentage & { index: number } ) =>\n\t\t\td.color || providerTheme.colors[ d.index % providerTheme.colors.length ],\n\t};\n\n\tconst handleMouseMove = useCallback(\n\t\t( event: React.MouseEvent, arc: ArcData ) => {\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) return;\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: arc.data,\n\t\t\t\ttooltipLeft: coords.x,\n\t\t\t\ttooltipTop: coords.y - 10,\n\t\t\t} );\n\t\t},\n\t\t[ showTooltip ]\n\t);\n\n\tconst handleMouseLeave = useCallback( () => {\n\t\thideTooltip();\n\t}, [ hideTooltip ] );\n\n\tconst handleArcMouseMove = useCallback(\n\t\t( arc: ArcData ) => ( event: React.MouseEvent ) => {\n\t\t\thandleMouseMove( event, arc );\n\t\t},\n\t\t[ handleMouseMove ]\n\t);\n\n\t// Create legend items\n\tconst legendItems = data.map( ( item, index ) => ( {\n\t\tlabel: item.label,\n\t\tvalue: item.valueDisplay || item.value.toString(),\n\t\tcolor: accessors.fill( { ...item, index } ),\n\t} ) );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'pie-semi-circle-chart', styles[ 'pie-semi-circle-chart' ], className ) }\n\t\t>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t{ /* Main chart group that contains both the pie and text elements */ }\n\t\t\t\t<Group top={ centerX } left={ centerX }>\n\t\t\t\t\t{ /* Pie chart */ }\n\t\t\t\t\t<Pie< DataPointPercentage & { index: number } >\n\t\t\t\t\t\tdata={ dataWithIndex }\n\t\t\t\t\t\tpieValue={ accessors.value }\n\t\t\t\t\t\touterRadius={ radius }\n\t\t\t\t\t\tinnerRadius={ innerRadius }\n\t\t\t\t\t\tcornerRadius={ 3 }\n\t\t\t\t\t\tpadAngle={ pad }\n\t\t\t\t\t\tstartAngle={ startAngle }\n\t\t\t\t\t\tendAngle={ endAngle }\n\t\t\t\t\t\tpieSort={ accessors.sort }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ pie => {\n\t\t\t\t\t\t\treturn pie.arcs.map( arc => (\n\t\t\t\t\t\t\t\t<g\n\t\t\t\t\t\t\t\t\tkey={ arc.data.label }\n\t\t\t\t\t\t\t\t\tonMouseMove={ handleArcMouseMove( arc ) }\n\t\t\t\t\t\t\t\t\tonMouseLeave={ handleMouseLeave }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<path d={ pie.path( arc ) || '' } fill={ accessors.fill( arc.data ) } />\n\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t) );\n\t\t\t\t\t\t} }\n\t\t\t\t\t</Pie>\n\n\t\t\t\t\t<Group>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\tverticalAnchor=\"start\"\n\t\t\t\t\t\t\ty={ -40 } // double font size to make room for a note\n\t\t\t\t\t\t\tclassName={ styles.label }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\tverticalAnchor=\"start\"\n\t\t\t\t\t\t\ty={ -20 } // font size with padding\n\t\t\t\t\t\t\tclassName={ styles.note }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ note }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Group>\n\t\t\t\t</Group>\n\t\t\t</svg>\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip\n\t\t\t\t\tdata={ {\n\t\t\t\t\t\tlabel: tooltipData.label,\n\t\t\t\t\t\tvalue: tooltipData.value,\n\t\t\t\t\t\tvalueDisplay: tooltipData.valueDisplay,\n\t\t\t\t\t} }\n\t\t\t\t\ttop={ tooltipTop || 0 }\n\t\t\t\t\tleft={ tooltipLeft || 0 }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ showLegend && (\n\t\t\t\t<Legend\n\t\t\t\t\titems={ legendItems }\n\t\t\t\t\torientation={ legendOrientation }\n\t\t\t\t\tclassName={ styles[ 'pie-semi-circle-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nPieSemiCircleChart.displayName = 'PieSemiCircleChart';\nexport default withResponsive< PieSemiCircleChartProps >( PieSemiCircleChart );\n","// extracted by mini-css-extract-plugin\nexport default {\"pie-semi-circle-chart\":\"oJsjYo330oeLpWqpqf4w\",\"pie-semi-circle-chart-legend\":\"aV40KcaCeoEycQ2crVkB\",\"label\":\"bxF3iRlHVJNqwEjRY9QD\",\"note\":\"tA3u0r3RunHmbWFBLrqW\"};","import { useParentSize } from '@visx/responsive';\nimport { ComponentType } from 'react';\nimport type { BaseChartProps } from '../../types';\n\ntype ResponsiveConfig = {\n\tmaxWidth?: number;\n\taspectRatio?: number;\n\tdebounceTime?: number;\n};\n\n/**\n * A higher-order component that provides responsive width and height\n * to the wrapped chart component using useParentSize from @visx/responsive.\n *\n * @param WrappedComponent - The chart component to be wrapped.\n * @param config - Optional configuration for responsive behavior\n * @return A functional component that renders the wrapped component with responsive dimensions.\n */\nexport function withResponsive< T extends BaseChartProps< unknown > >(\n\tWrappedComponent: ComponentType< T >,\n\tconfig?: ResponsiveConfig\n) {\n\tconst { maxWidth = 1200, aspectRatio = 0.5, debounceTime = 50 } = config || {};\n\n\treturn function ResponsiveChart( props: Omit< T, 'width' | 'height' > ) {\n\t\tconst { parentRef, width: parentWidth } = useParentSize( {\n\t\t\tdebounceTime,\n\t\t\tenableDebounceLeadingCall: true,\n\t\t\tinitialSize: { width: 600, height: 400 },\n\t\t} );\n\n\t\t// Calculate dimensions\n\t\tconst containerWidth = parentWidth ? Math.min( parentWidth, maxWidth ) : 600;\n\t\tconst containerHeight = containerWidth * aspectRatio;\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ parentRef }\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tminHeight: `${ containerHeight }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<WrappedComponent\n\t\t\t\t\twidth={ containerWidth }\n\t\t\t\t\theight={ containerHeight }\n\t\t\t\t\t// When width and height are passed as props, they will override the responsive values, and the chart will become fixed size.\n\t\t\t\t\t{ ...( props as T ) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t};\n}\n"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","module","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","obj","prop","r","toStringTag","value","_typeof","iterator","constructor","t","i","toPrimitive","TypeError","String","toPropertyKey","configurable","writable","defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","orientationToFlexDirection","horizontal","vertical","BaseLegend","_ref","items","className","_ref$orientation","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","concat","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_items$find","_items$find2","_jsxs","width","height","fill","text","find","DefaultTooltipContent","data","_Fragment","valueDisplay","BaseTooltip","_ref2","top","left","_ref2$component","component","Component","style","PieSemiCircleChart","_ref$width","note","_ref$withTooltips","withTooltips","_ref$clockwise","clockwise","_ref$thickness","thickness","showLegend","legendOrientation","providerTheme","useContext","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","centerX","radius","innerRadius","dataWithIndex","index","_objectSpread","startAngle","Math","PI","endAngle","accessors","sort","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend","displayName","WrappedComponent","_ref$maxWidth","maxWidth","aspectRatio","_ref$aspectRatio","debounceTime","_ref$debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","min","containerHeight","minHeight"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/providers/theme/themes.ts","../../../../src/providers/theme/theme-provider.tsx","../../../../src/components/legend/base-legend.tsx","../../../../src/components/tooltip/base-tooltip.tsx","../../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["ThemeContext","createContext","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","orientationToFlexDirection","horizontal","vertical","BaseLegend","items","className","orientation","legendScale","scaleOrdinal","domain","map","item","label","range","color","_jsx","clsx","styles","legend","role","children","LegendOrdinal","scale","direction","shape","shapeWidth","shapeHeight","labels","_jsxs","jsx","width","height","fill","value","text","find","DefaultTooltipContent","data","jsxs","_Fragment","Fragment","valueDisplay","BaseTooltip","top","left","component","Component","style","PieSemiCircleChart","size","note","withTooltips","clockwise","thickness","showLegend","legendOrientation","providerTheme","useContext","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","centerX","radius","innerRadius","dataWithIndex","d","index","startAngle","Math","PI","endAngle","accessors","sort","a","b","length","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","legendItems","toString","viewBox","Group","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","textAnchor","verticalAnchor","Legend","displayName","pieSemiCircleChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","min","containerHeight","ref","minHeight","withResponsive"],"mappings":"mTAKA,MCEMA,EAAeC,EAAAA,cDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UAC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Y5B,MACnBQ,aAAcoB,EAAYpB,cAE3BE,IAAMiB,GAAc,EACpBhB,KAAOe,GAAe,IAItBL,GACDvC,MAAC6F,EACA,CAAAxG,MAAQsF,EACRpF,YAAciD,EACdlD,UAAYY,MAId,EAGH+B,EAAmB6D,YAAc,qBACjC,IAAeC,EC9KC,SACfC,EACAC,GAEA,MAAMC,SAAEA,EAAW,KAAIC,YAAEA,EAAc,GAAGC,aAAEA,EAAe,IAAOH,GAAU,GAE5E,OAAO,SAA0BI,GAChC,MAAMC,UAAEA,EAAWvF,MAAOwF,GAAgBC,EAAAA,cAAe,CACxDJ,eACAK,2BAA2B,EAC3BC,YAAa,CAAE3F,MAAO,IAAKC,OAAQ,OAI9B2F,EAAiBJ,EAAc9C,KAAKmD,IAAKL,EAAaL,GAAa,IACnEW,EAAkBF,EAAiBR,EAEzC,OACCnG,EACCc,IAAA,MAAA,CAAAgG,IAAMR,EACNtE,MAAQ,CACPjB,MAAO,OACPgG,UAAW,GAAIF,OACfxG,SAEDL,MAACgG,EAAgB,CAChBjF,MAAQ4F,EACR3F,OAAS6F,EACT3E,KAAOyE,KACAN,KAIX,CACD,CD4IeW,CAA2C/E"}
|
|
@@ -1,5 +1,95 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.line-chart-module__line-chart__ITM3d {
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
14
|
+
background: #fff;
|
|
15
|
+
padding: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
padding-bottom: 10px;
|
|
20
|
+
}
|
|
21
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 4px 0;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
}
|
|
27
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
padding-right: 1rem;
|
|
30
|
+
}
|
|
31
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
32
|
+
stroke: #d7d6d6;
|
|
33
|
+
stroke-width: 1px;
|
|
34
|
+
shape-rendering: crispEdges;
|
|
35
|
+
}
|
|
36
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
gap: 16px;
|
|
41
|
+
}
|
|
42
|
+
.legend-module__legend--vertical__Scfzo {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
gap: 8px;
|
|
46
|
+
}
|
|
4
47
|
|
|
5
|
-
|
|
48
|
+
.legend-module__legend-item__feemn {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
font-size: 0.875rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
56
|
+
border-radius: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.legend-module__legend-item-label__ksx6I {
|
|
60
|
+
color: var(--jp-gray-80, #2c3338);
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 0.5rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.legend-module__legend-item-value__d9x1j {
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
}
|
|
69
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
70
|
+
padding: 0.5rem;
|
|
71
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
72
|
+
color: white;
|
|
73
|
+
border-radius: 4px;
|
|
74
|
+
font-size: 14px;
|
|
75
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
76
|
+
position: absolute;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
transform: translate(-50%, -100%);
|
|
79
|
+
}
|
|
80
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
81
|
+
position: relative;
|
|
82
|
+
text-align: center;
|
|
83
|
+
}
|
|
84
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
85
|
+
margin-top: 1rem;
|
|
86
|
+
}
|
|
87
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
88
|
+
margin-bottom: 0px;
|
|
89
|
+
font-weight: 600;
|
|
90
|
+
font-size: 16px;
|
|
91
|
+
}
|
|
92
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
93
|
+
margin-top: 0px;
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t="base-tooltip-module__tooltip__OfX6n";const a=({data:t})=>e.jsxs(e.Fragment,{children:[t?.label,": ",t?.valueDisplay||t?.value]});exports.BaseTooltip=({data:l,top:s,left:o,component:i=a,children:r,className:c})=>e.jsx("div",{className:t,style:{top:s,left:o},role:"tooltip",children:r||l&&e.jsx(i,{data:l,className:c})});
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/tooltip/base-tooltip.tsx"],"sourcesContent":[null],"names":["DefaultTooltipContent","data","_jsxs","jsxs","_Fragment","Fragment","children","label","valueDisplay","value","top","left","component","Component","className","_jsx","styles","style","role","jsx"],"mappings":"wFAmCA,MAAMA,EAAwB,EAAIC,UACjCC,EACGC,KAAAC,EAAAC,SAAA,CAAAC,SAAA,CAAAL,GAAMM,MAAK,KAAMN,GAAMO,cAAgBP,GAAMQ,6BAItB,EAC1BR,OACAS,MACAC,OACAC,UAAWC,EAAYb,EACvBM,WACAQ,eAGCC,MAAK,MAAA,CAAAD,UAAYE,EAAiBC,MAAQ,CAAEP,MAAKC,QAASO,KAAK,UAC5DZ,SAAAA,GAAcL,GAAQc,EAACI,IAAAN,GAAUZ,KAAOA,EAAOa,UAAYA"}
|
|
@@ -1,3 +1,95 @@
|
|
|
1
|
-
.
|
|
1
|
+
.bar-chart-module__bar-chart__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.line-chart-module__line-chart__ITM3d {
|
|
11
|
+
position: relative;
|
|
12
|
+
}
|
|
13
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
14
|
+
background: #fff;
|
|
15
|
+
padding: 0.5rem;
|
|
16
|
+
}
|
|
17
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
18
|
+
font-weight: bold;
|
|
19
|
+
padding-bottom: 10px;
|
|
20
|
+
}
|
|
21
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
padding: 4px 0;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
}
|
|
27
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
28
|
+
font-weight: 500;
|
|
29
|
+
padding-right: 1rem;
|
|
30
|
+
}
|
|
31
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: 16px;
|
|
36
|
+
}
|
|
37
|
+
.legend-module__legend--vertical__Scfzo {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: 8px;
|
|
41
|
+
}
|
|
2
42
|
|
|
3
|
-
|
|
43
|
+
.legend-module__legend-item__feemn {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
font-size: 0.875rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
51
|
+
border-radius: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.legend-module__legend-item-label__ksx6I {
|
|
55
|
+
color: var(--jp-gray-80, #2c3338);
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
gap: 0.5rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.legend-module__legend-item-value__d9x1j {
|
|
62
|
+
font-weight: 500;
|
|
63
|
+
}
|
|
64
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
65
|
+
position: relative;
|
|
66
|
+
text-align: center;
|
|
67
|
+
}
|
|
68
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
69
|
+
margin-top: 1rem;
|
|
70
|
+
}
|
|
71
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
72
|
+
margin-bottom: 0px;
|
|
73
|
+
font-weight: 600;
|
|
74
|
+
font-size: 16px;
|
|
75
|
+
}
|
|
76
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
77
|
+
margin-top: 0px;
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
}
|
|
80
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
81
|
+
stroke: #d7d6d6;
|
|
82
|
+
stroke-width: 1px;
|
|
83
|
+
shape-rendering: crispEdges;
|
|
84
|
+
}
|
|
85
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
86
|
+
padding: 0.5rem;
|
|
87
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
88
|
+
color: white;
|
|
89
|
+
border-radius: 4px;
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
92
|
+
position: absolute;
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
transform: translate(-50%, -100%);
|
|
95
|
+
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{"use strict";var e={572:(e,t,r)=>{var o=r(953),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var o,i={},s=null,u=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!c.hasOwnProperty(o)&&(i[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===i[o]&&(i[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:u,props:i,_owner:a.current}}t.Fragment=i,t.jsx=s,t.jsxs=s},48:(e,t,r)=>{e.exports=r(572)},953:e=>{e.exports=require("react")}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function i(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function l(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}r.r(o),r.d(o,{BarChart:()=>q,BaseTooltip:()=>E,Legend:()=>C,LineChart:()=>X,PieChart:()=>Z,PieSemiCircleChart:()=>le,ThemeProvider:()=>P,useChartMouseHandler:()=>U});const a=require("@visx/axis"),c=require("@visx/event"),s=require("@visx/group"),u=require("@visx/scale"),d=require("@visx/shape"),p=require("@visx/tooltip"),h=require("clsx");var v=r.n(h),f=r(953);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t,r){return(t=function(e){var t=function(e){if("object"!=m(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==m(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var y={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},g=r(48);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=(0,f.createContext)(y),w=function(){return(0,f.useContext)(O)},P=function(e){var t=e.theme,r=void 0===t?{}:t,o=e.children,n=x(x({},y),r);return(0,g.jsx)(O.Provider,{value:n,children:o})};const S=require("@visx/grid"),D=function(e){var t=e.width,r=e.height,o=e.xScale,n=e.yScale,i=e.gridVisibility,l=void 0===i?"x":i,a=e.top,c=void 0===a?0:a;return(0,g.jsxs)("g",{transform:"translate(0, ".concat(c,")"),className:"jfpeES0fbFrqCPR8dRN7",children:[l.includes("x")&&(0,g.jsx)(S.GridRows,{scale:o,width:t}),l.includes("y")&&(0,g.jsx)(S.GridColumns,{scale:n,height:r})]})},T=require("@visx/legend"),k={"legend--horizontal":"b1_5FxxoK4aEFLoe67IA","legend--vertical":"vpmQkJAPhp3XJ9Wb6vOw","legend-item":"IKM8KG1lF9e5NzDqMLOJ","legend-item-swatch":"_eccyBq0v2puKsHw8XND","legend-item-label":"UeZrUEpEK0tLzXHmeUco","legend-item-value":"R5msPOYKm79jYV13H0v7"};var L={horizontal:"row",vertical:"column"},C=function(e){var t=e.items,r=e.className,o=e.orientation,n=void 0===o?"horizontal":o,i=(0,u.scaleOrdinal)({domain:t.map((function(e){return e.label})),range:t.map((function(e){return e.color}))});return(0,g.jsx)("div",{className:v()(k.legend,k["legend--".concat(n)],r),role:"list",children:(0,g.jsx)(T.LegendOrdinal,{scale:i,direction:L[n],shape:"rect",shapeWidth:16,shapeHeight:16,className:k["legend-items"],children:function(e){return(0,g.jsx)("div",{className:k["legend--".concat(n)],children:e.map((function(e){var r,o;return(0,g.jsxs)("div",{className:k["legend-item"],children:[(0,g.jsx)("svg",{width:16,height:16,children:(0,g.jsx)("rect",{width:16,height:16,fill:e.value,className:k["legend-item-swatch"]})}),(0,g.jsxs)("span",{className:k["legend-item-label"],children:[e.text,(null===(r=t.find((function(t){return t.label===e.text})))||void 0===r?void 0:r.value)&&(0,g.jsx)("span",{className:k["legend-item-value"],children:null===(o=t.find((function(t){return t.label===e.text})))||void 0===o?void 0:o.value})]})]},e.text)}))})}})})};const N=require("@visx/responsive");function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function M(e,t){var r=t||{},o=r.maxWidth,n=void 0===o?1200:o,i=r.aspectRatio,l=void 0===i?.5:i,a=r.debounceTime,c=void 0===a?50:a;return function(t){var r=(0,N.useParentSize)({debounceTime:c,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),o=r.parentRef,i=r.width,a=i?Math.min(i,n):600,s=a*l;return(0,g.jsx)("div",{ref:o,style:{width:"100%",minHeight:"".concat(s,"px")},children:(0,g.jsx)(e,A({width:a,height:s},t))})}}var F=function(e){var t=e.data;return(0,g.jsxs)(g.Fragment,{children:[null==t?void 0:t.label,": ",(null==t?void 0:t.valueDisplay)||(null==t?void 0:t.value)]})},E=function(e){var t=e.data,r=e.top,o=e.left,n=e.component,i=void 0===n?F:n,l=e.children,a=e.className;return(0,g.jsx)("div",{className:"Jmgc7XAf2uAyK5059rBe",style:{top:r,left:o},role:"tooltip",children:l||t&&(0,g.jsx)(i,{data:t,className:a})})};const R={"bar-chart":"Vm_cn8YnIXBavFt6eHSp","bar-chart-legend":"e4dhKgBP7e6FBRAX2SrP"};var B=function(e){var t,r=e.data,o=e.margin,n=void 0===o?{top:20,right:20,bottom:40,left:40}:o,i=e.withTooltips,h=void 0!==i&&i,m=e.showLegend,b=void 0!==m&&m,y=e.legendOrientation,j=void 0===y?"horizontal":y,x=e.className,O=e.gridVisibility,P=void 0===O?"x":O,S=e.width,T=e.height,k=void 0===T?400:T,L=w(),N=(0,p.useTooltip)(),_=N.tooltipOpen,A=N.tooltipLeft,M=N.tooltipTop,F=N.tooltipData,B=N.hideTooltip,q=N.showTooltip,I=(0,f.useCallback)((function(e,t,r,o,n){var i=(0,c.localPoint)(e);i&&q({tooltipData:{value:t,xLabel:r,yLabel:o,seriesIndex:n},tooltipLeft:i.x,tooltipTop:i.y-10})}),[q]),G=(0,f.useCallback)((function(){B()}),[B]);if(null==r||!r.length)return(0,g.jsx)("div",{className:v()("bar-chart-empty",R["bat-chart-empty"]),children:"Empty..."});var K=n,z=S-K.left-K.right,H=k-K.top-K.bottom,V=null===(t=r[0].data)||void 0===t?void 0:t.map((function(e){return(null==e?void 0:e.label)||""})),W=(0,u.scaleBand)({range:[0,z],domain:V,padding:.2}),X=(0,u.scaleBand)({range:[0,W.bandwidth()],domain:r.map((function(e,t){return t.toString()})),padding:.1}),U=(0,u.scaleLinear)({range:[H,0],domain:[0,Math.max.apply(Math,l(r.map((function(e){return Math.max.apply(Math,l(e.data.map((function(e){return(null==e?void 0:e.value)||0}))))}))))]}),Y=r.map((function(e,t){return{label:e.label,value:"",color:L.colors[t%L.colors.length]}}));return(0,g.jsxs)("div",{className:v()("bar-chart",x,R["bar-chart"]),children:[(0,g.jsx)("svg",{width:S,height:k,children:(0,g.jsxs)(s.Group,{left:K.left,top:K.top,children:[(0,g.jsx)(D,{width:z,height:H,xScale:W,yScale:U,gridVisibility:P}),r.map((function(e,t){return(0,g.jsx)(s.Group,{children:e.data.map((function(r){var o,n,i=W((null==r?void 0:r.label)||"");if(void 0===i)return null;var l=X.bandwidth(),a=i+(null!==(o=X(t.toString()))&&void 0!==o?o:0);return(0,g.jsx)(d.Bar,{x:a,y:U(r.value),width:l,height:H-(null!==(n=U(r.value))&&void 0!==n?n:0),fill:L.colors[t%L.colors.length],onMouseMove:h?function(o){return I(o,r.value,(null==r?void 0:r.label)||"",e.label,t)}:void 0,onMouseLeave:h?G:void 0},"bar-".concat(t,"-").concat(r.label))}))},t)})),(0,g.jsx)(a.AxisLeft,{scale:U}),(0,g.jsx)(a.AxisBottom,{scale:W,top:H})]})}),h&&_&&F&&(0,g.jsx)(E,{top:M||0,left:A||0,children:(0,g.jsxs)("div",{children:[(0,g.jsx)("div",{children:F.yLabel}),(0,g.jsxs)("div",{children:[F.xLabel,": ",F.value]})]})}),b&&(0,g.jsx)(C,{items:Y,orientation:j,className:R["bar-chart-legend"]})]})};B.displayName="BarChart";const q=M(B);function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,i,l,a=[],c=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(o=i.call(r)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(e){s=!0,n=e}finally{try{if(!c&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw n}}return a}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const G=require("@visx/xychart"),K={"line-chart":"vbyo4J2HC_KvyGgsWui7","line-chart__tooltip":"nLSohGgB7OyUmLRN_dLD","line-chart__tooltip-date":"MGw7UT3IImVKXXuBYmwf","line-chart__tooltip-row":"KwvDxit9dbF2E6ZzF29e","line-chart__tooltip-label":"WmFS4ekGu9e3G6URbkhd"};function z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?z(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var V=function(e){var t,r=e.tooltipData,o=null==r||null===(t=r.nearestDatum)||void 0===t?void 0:t.datum;if(!o)return null;var n=Object.entries((null==r?void 0:r.datumByKey)||{}).map((function(e){var t=I(e,2);return{key:t[0],value:t[1].datum.value}})).sort((function(e,t){return t.value-e.value}));return(0,g.jsxs)("div",{className:K["line-chart__tooltip"],children:[(0,g.jsx)("div",{className:K["line-chart__tooltip-date"],children:o.date.toLocaleDateString()}),n.map((function(e){return(0,g.jsxs)("div",{className:K["line-chart__tooltip-row"],children:[(0,g.jsxs)("span",{className:K["line-chart__tooltip-label"],children:[e.key,":"]}),(0,g.jsx)("span",{className:K["line-chart__tooltip-value"],children:e.value})]},e.key)}))]})},W=function(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})};const X=M((function(e){var t=e.data,r=e.width,o=e.height,n=e.margin,i=void 0===n?{top:20,right:20,bottom:40,left:40}:n,l=e.className,a=e.withTooltips,c=void 0===a||a,s=e.showLegend,u=void 0!==s&&s,d=e.legendOrientation,p=void 0===d?"horizontal":d,h=w();if(null==t||!t.length)return(0,g.jsx)("div",{className:v()("line-chart-empty",K["line-chart-empty"]),children:"Empty..."});var f=t.map((function(e,t){return{label:e.label,value:"",color:h.colors[t%h.colors.length]}})),m={xAccessor:function(e){return e.date},yAccessor:function(e){return e.value}},b=(0,G.buildChartTheme)({backgroundColor:h.backgroundColor,colors:h.colors,gridStyles:h.gridStyles,tickLength:(null==h?void 0:h.tickLength)||0,gridColor:(null==h?void 0:h.gridColor)||"",gridColorDark:(null==h?void 0:h.gridColorDark)||""});return(0,g.jsxs)("div",{className:v()("line-chart",K["line-chart"],l),children:[(0,g.jsxs)(G.XYChart,{theme:b,width:r,height:o,margin:i,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[(0,g.jsx)(G.AnimatedGrid,{columns:!1,numTicks:4}),(0,g.jsx)(G.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:W}),(0,g.jsx)(G.AnimatedAxis,{orientation:"left",numTicks:4}),t.map((function(e,t){return(0,g.jsx)(G.AnimatedLineSeries,H(H({dataKey:null==e?void 0:e.label,data:e.data},m),{},{stroke:b.colors[t%b.colors.length],strokeWidth:2}),null==e?void 0:e.label)})),c&&(0,g.jsx)(G.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:V})]}),u&&(0,g.jsx)(C,{items:f,orientation:p,className:K["line-chart-legend"]})]})})),U=function(e){var t=e.withTooltips,r=(0,p.useTooltip)(),o=r.tooltipOpen,n=r.tooltipLeft,i=r.tooltipTop,l=r.tooltipData,a=r.hideTooltip,s=r.showTooltip;return{onMouseMove:(0,f.useCallback)((function(e,r){if(t){var o=(0,c.localPoint)(e);o&&s({tooltipData:r,tooltipLeft:o.x,tooltipTop:o.y-10})}}),[t,s]),onMouseLeave:(0,f.useCallback)((function(){t&&a()}),[t,a]),tooltipOpen:o,tooltipData:l||null,tooltipLeft:n,tooltipTop:i}},Y={"pie-chart":"R2Ly_tkJtgL0HA8P3fpm"};function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function Q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var $=function(e){var t=e.data,r=e.width,o=void 0===r?500:r,n=e.height,i=void 0===n?500:n,l=e.withTooltips,a=void 0!==l&&l,c=e.innerRadius,u=void 0===c?0:c,p=e.className,h=e.showLegend,f=e.legendOrientation,m=w(),b=U({withTooltips:a}),j=b.onMouseMove,x=b.onMouseLeave,O=b.tooltipOpen,P=b.tooltipData,S=b.tooltipLeft,D=b.tooltipTop,T=Math.min(o,i)/2,k=o/2,L=i/2,N=t.map((function(e,t){return Q(Q({},e),{},{index:t})})),_={value:function(e){return e.value},fill:function(e){return(null==e?void 0:e.color)||m.colors[e.index]}},A=t.map((function(e,t){return{label:e.label,value:e.value.toString(),color:m.colors[t%m.colors.length]}}));return(0,g.jsxs)("div",{className:v()("pie-chart",Y["pie-chart"],p),children:[(0,g.jsx)("svg",{width:o,height:i,children:(0,g.jsx)(s.Group,{top:L,left:k,children:(0,g.jsx)(d.Pie,{data:N,pieValue:_.value,outerRadius:T-20,innerRadius:u,children:function(e){return e.arcs.map((function(t,r){var o=I(e.path.centroid(t),2),n=o[0],i=o[1],l=t.endAngle-t.startAngle>=.25,c={d:e.path(t)||"",fill:_.fill(t.data)};return a&&(c.onMouseMove=function(e){return j(e,t.data)},c.onMouseLeave=x),(0,g.jsxs)("g",{children:[(0,g.jsx)("path",Q({},c)),l&&(0,g.jsx)("text",{x:n,y:i,dy:".33em",fill:m.labelBackgroundColor||y.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:t.data.label})]},"arc-".concat(r))}))}})})}),h&&(0,g.jsx)(C,{items:A,orientation:f,className:Y["pie-chart-legend"]}),a&&O&&P&&(0,g.jsx)(E,{data:P,top:D||0,left:S||0,style:{transform:"translate(-50%, -100%)"}})]})};$.displayName="PieChart";const Z=M($),ee=require("@visx/shape/lib/shapes/Pie");var te=r.n(ee);const re=require("@visx/text");function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function ne(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var ie=function(e){var t=e.data,r=e.width,o=void 0===r?500:r,n=e.label,i=e.note,l=e.className,a=e.withTooltips,u=void 0!==a&&a,d=e.clockwise,h=void 0===d||d,m=e.thickness,b=void 0===m?.4:m,y=e.showLegend,j=e.legendOrientation,x=w(),O=(0,p.useTooltip)(),P=O.tooltipOpen,S=O.tooltipLeft,D=O.tooltipTop,T=O.tooltipData,k=O.hideTooltip,L=O.showTooltip,N=o/2,_=o/2,A=o/2,M=A*(1-b+.03),F=t.map((function(e,t){return ne(ne({},e),{},{index:t})})),R=h?-Math.PI/2:Math.PI/2,B=h?Math.PI/2:-Math.PI/2,q={value:function(e){return e.value},sort:function(e,t){return t.value-e.value},fill:function(e){return e.color||x.colors[e.index%x.colors.length]}},I=(0,f.useCallback)((function(e,t){var r=(0,c.localPoint)(e);r&&L({tooltipData:t.data,tooltipLeft:r.x,tooltipTop:r.y-10})}),[L]),G=(0,f.useCallback)((function(){k()}),[k]),K=(0,f.useCallback)((function(e){return function(t){I(t,e)}}),[I]),z=t.map((function(e,t){return{label:e.label,value:e.valueDisplay||e.value.toString(),color:q.fill(ne(ne({},e),{},{index:t}))}}));return(0,g.jsxs)("div",{className:v()("pie-semi-circle-chart","oJsjYo330oeLpWqpqf4w",l),children:[(0,g.jsx)("svg",{width:o,height:_,children:(0,g.jsxs)(s.Group,{top:N,left:N,children:[(0,g.jsx)(te(),{data:F,pieValue:q.value,outerRadius:A,innerRadius:M,cornerRadius:3,padAngle:.03,startAngle:R,endAngle:B,pieSort:q.sort,children:function(e){return e.arcs.map((function(t){return(0,g.jsx)("g",{onMouseMove:K(t),onMouseLeave:G,children:(0,g.jsx)("path",{d:e.path(t)||"",fill:q.fill(t.data)})},t.data.label)}))}}),(0,g.jsxs)(s.Group,{children:[(0,g.jsx)(re.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:"bxF3iRlHVJNqwEjRY9QD",children:n}),(0,g.jsx)(re.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:"tA3u0r3RunHmbWFBLrqW",children:i})]})]})}),u&&P&&T&&(0,g.jsx)(E,{data:{label:T.label,value:T.value,valueDisplay:T.valueDisplay},top:D||0,left:S||0}),y&&(0,g.jsx)(C,{items:z,orientation:j,className:"aV40KcaCeoEycQ2crVkB"})]})};ie.displayName="PieSemiCircleChart";const le=M(ie);module.exports=o})();
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@visx/axis"),a=require("@visx/event"),l=require("@visx/group"),i=require("@visx/scale"),o=require("@visx/shape"),r=require("@visx/tooltip"),s=require("clsx"),n=require("react"),c=require("@visx/grid"),d=require("@visx/legend"),h=require("@visx/responsive"),p=require("@visx/gradient"),m=require("@visx/xychart"),u=require("@visx/shape/lib/shapes/Pie"),g=require("@visx/text");const x={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},v=n.createContext(x),_=()=>n.useContext(v);var b="grid-control-module__grid-control__KOnZN";const j=({width:t,height:a,xScale:l,yScale:i,gridVisibility:o="x",top:r=0})=>e.jsxs("g",{transform:`translate(0, ${r})`,className:b,children:[o.includes("x")&&e.jsx(c.GridRows,{scale:l,width:t}),o.includes("y")&&e.jsx(c.GridColumns,{scale:i,height:a})]});var f={"legend--horizontal":"legend-module__legend--horizontal__IUN13","legend--vertical":"legend-module__legend--vertical__Scfzo","legend-item":"legend-module__legend-item__feemn","legend-item-swatch":"legend-module__legend-item-swatch__nRyXf","legend-item-label":"legend-module__legend-item-label__ksx6I","legend-item-value":"legend-module__legend-item-value__d9x1j"};const y={horizontal:"row",vertical:"column"},w=({items:t,className:a,orientation:l="horizontal"})=>{const o=i.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:s(f.legend,f[`legend--${l}`],a),role:"list",children:e.jsx(d.LegendOrdinal,{scale:o,direction:y[l],shape:"rect",shapeWidth:16,shapeHeight:16,className:f["legend-items"],children:a=>e.jsx("div",{className:f[`legend--${l}`],children:a.map((a=>e.jsxs("div",{className:f["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:a.value,className:f["legend-item-swatch"]})}),e.jsxs("span",{className:f["legend-item-label"],children:[a.text,t.find((e=>e.label===a.text))?.value&&e.jsx("span",{className:f["legend-item-value"],children:t.find((e=>e.label===a.text))?.value})]})]},a.text)))})})})};function N(t,a){const{maxWidth:l=1200,aspectRatio:i=.5,debounceTime:o=50}=a||{};return function(a){const{parentRef:r,width:s}=h.useParentSize({debounceTime:o,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),n=s?Math.min(s,l):600,c=n*i;return e.jsx("div",{ref:r,style:{width:"100%",minHeight:`${c}px`},children:e.jsx(t,{width:n,height:c,size:n,...a})})}}var T="base-tooltip-module__tooltip__OfX6n";const C=({data:t})=>e.jsxs(e.Fragment,{children:[t?.label,": ",t?.valueDisplay||t?.value]}),k=({data:t,top:a,left:l,component:i=C,children:o,className:r})=>e.jsx("div",{className:T,style:{top:a,left:l},role:"tooltip",children:o||t&&e.jsx(i,{data:t,className:r})});var L={"bar-chart":"bar-chart-module__bar-chart__lmYNi","bar-chart-legend":"bar-chart-module__bar-chart-legend__vgKKq"};const M=({data:c,margin:d={top:20,right:20,bottom:40,left:40},withTooltips:h=!1,showLegend:p=!1,legendOrientation:m="horizontal",className:u,gridVisibility:g="x",width:x,height:v=400})=>{const b=_(),{tooltipOpen:f,tooltipLeft:y,tooltipTop:N,tooltipData:T,hideTooltip:C,showTooltip:M}=r.useTooltip(),A=n.useCallback(((e,t,l,i,o)=>{const r=a.localPoint(e);r&&M({tooltipData:{value:t,xLabel:l,yLabel:i,seriesIndex:o},tooltipLeft:r.x,tooltipTop:r.y-10})}),[M]),D=n.useCallback((()=>{C()}),[C]);if(!c?.length)return e.jsx("div",{className:s("bar-chart-empty",L["bat-chart-empty"]),children:"Empty..."});const S=d,F=x-S.left-S.right,q=v-S.top-S.bottom,P=c[0].data?.map((e=>e?.label||"")),O=i.scaleBand({range:[0,F],domain:P,padding:.2}),B=i.scaleBand({range:[0,O.bandwidth()],domain:c.map(((e,t)=>t.toString())),padding:.1}),z=i.scaleLinear({range:[q,0],domain:[0,Math.max(...c.map((e=>Math.max(...e.data.map((e=>e?.value||0))))))]}),$=c.map(((e,t)=>({label:e.label,value:"",color:b.colors[t%b.colors.length]})));return e.jsxs("div",{className:s("bar-chart",u,L["bar-chart"]),children:[e.jsx("svg",{width:x,height:v,children:e.jsxs(l.Group,{left:S.left,top:S.top,children:[e.jsx(j,{width:F,height:q,xScale:O,yScale:z,gridVisibility:g}),c.map(((t,a)=>e.jsx(l.Group,{children:t.data.map((l=>{const i=O(l?.label||"");if(void 0===i)return null;const r=B.bandwidth(),s=i+(B(a.toString())??0);return e.jsx(o.Bar,{x:s,y:z(l.value),width:r,height:q-(z(l.value)??0),fill:b.colors[a%b.colors.length],onMouseMove:h?e=>A(e,l.value,l?.label||"",t.label,a):void 0,onMouseLeave:h?D:void 0},`bar-${a}-${l.label}`)}))},a))),e.jsx(t.AxisLeft,{scale:z}),e.jsx(t.AxisBottom,{scale:O,top:q})]})}),h&&f&&T&&e.jsx(k,{top:N||0,left:y||0,children:e.jsxs("div",{children:[e.jsx("div",{children:T.yLabel}),e.jsxs("div",{children:[T.xLabel,": ",T.value]})]})}),p&&e.jsx(w,{items:$,orientation:m,className:L["bar-chart-legend"]})]})};M.displayName="BarChart";var A=N(M),D={"line-chart":"line-chart-module__line-chart__ITM3d","line-chart__tooltip":"line-chart-module__line-chart__tooltip__aqcme","line-chart__tooltip-date":"line-chart-module__line-chart__tooltip-date__4Dzab","line-chart__tooltip-row":"line-chart-module__line-chart__tooltip-row__6A37G","line-chart__tooltip-label":"line-chart-module__line-chart__tooltip-label__IvnFF"};const S=({tooltipData:t})=>{const a=t?.nearestDatum?.datum;if(!a)return null;const l=Object.entries(t?.datumByKey||{}).map((([e,{datum:t}])=>({key:e,value:t.value}))).sort(((e,t)=>t.value-e.value));return e.jsxs("div",{className:D["line-chart__tooltip"],children:[e.jsx("div",{className:D["line-chart__tooltip-date"],children:a.date.toLocaleDateString()}),l.map((t=>e.jsxs("div",{className:D["line-chart__tooltip-row"],children:[e.jsxs("span",{className:D["line-chart__tooltip-label"],children:[t.key,":"]}),e.jsx("span",{className:D["line-chart__tooltip-value"],children:t.value})]},t.key)))]})},F=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});var q=N((({data:t,width:a,height:l,margin:i={top:20,right:20,bottom:40,left:40},className:o,withTooltips:r=!0,showLegend:n=!1,legendOrientation:c="horizontal",withGradientFill:d=!1,options:h={}})=>{const u=_();if(!t?.length)return e.jsx("div",{className:s("line-chart-empty",D["line-chart-empty"]),children:"Empty..."});const g=t.map(((e,t)=>({label:e.label,value:"",color:u.colors[t%u.colors.length]}))),x={xAccessor:e=>e.date,yAccessor:e=>e.value},v=m.buildChartTheme({backgroundColor:u.backgroundColor,colors:u.colors,gridStyles:u.gridStyles,tickLength:u?.tickLength||0,gridColor:u?.gridColor||"",gridColorDark:u?.gridColorDark||""});return e.jsxs("div",{className:s("line-chart",D["line-chart"],o),children:[e.jsxs(m.XYChart,{theme:v,width:a,height:l,margin:i,xScale:{type:"time"},yScale:{type:"linear",nice:!0},children:[e.jsx(m.AnimatedGrid,{columns:!1,numTicks:4}),e.jsx(m.AnimatedAxis,{orientation:"bottom",numTicks:5,tickFormat:F,...h?.axis?.x}),e.jsx(m.AnimatedAxis,{orientation:"left",numTicks:4,...h?.axis?.y}),t.map(((t,a)=>{const l=t.options?.stroke??v.colors[a%v.colors.length];return e.jsxs(e.Fragment,{children:[e.jsx(p.LinearGradient,{id:`area-gradient-${a+1}`,from:l,to:"white",toOpacity:.1,...t.options?.gradient}),e.jsx(m.AnimatedLineSeries,{dataKey:t?.label,data:t.data,...x,stroke:l,strokeWidth:2},t?.label),d&&e.jsx(m.AnimatedAreaSeries,{dataKey:t?.label,data:t.data,...x,stroke:l,strokeWidth:0,fill:`url(#area-gradient-${a+1})`,renderLine:!1},t?.label)]})})),r&&e.jsx(m.Tooltip,{snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:S})]}),n&&e.jsx(w,{items:g,orientation:c,className:D["line-chart-legend"]})]})}));const P=({withTooltips:e})=>{const{tooltipOpen:t,tooltipLeft:l,tooltipTop:i,tooltipData:o,hideTooltip:s,showTooltip:c}=r.useTooltip();return{onMouseMove:n.useCallback(((t,l)=>{if(!e)return;const i=a.localPoint(t);i&&c({tooltipData:l,tooltipLeft:i.x,tooltipTop:i.y-10})}),[e,c]),onMouseLeave:n.useCallback((()=>{e&&s()}),[e,s]),tooltipOpen:t,tooltipData:o||null,tooltipLeft:l,tooltipTop:i}};var O={"pie-chart":"pie-chart-module__pie-chart__R12Vh"};const B=({data:t,withTooltips:a=!1,className:i,showLegend:r,legendOrientation:n,size:c,thickness:d=1,padding:h=20,gapScale:p=0,cornerScale:m=0})=>{const u=_(),{onMouseMove:g,onMouseLeave:v,tooltipOpen:b,tooltipData:j,tooltipLeft:f,tooltipTop:y}=P({withTooltips:a}),{isValid:N,message:T}=(e=>{if(!e.length)return{isValid:!1,message:"No data available"};if(e.some((e=>e.percentage<0||e.value<0)))return{isValid:!1,message:"Invalid data: Negative values are not allowed"};const t=e.reduce(((e,t)=>e+t.percentage),0);return Math.abs(t-100)>.01?{isValid:!1,message:"Invalid percentage total: Must equal 100"}:{isValid:!0,message:""}})(t);if(!N)return e.jsx("div",{className:s("pie-chart",O["pie-chart"],i),children:e.jsx("div",{className:O["error-message"],children:T})});const C=c,L=c,M=Math.min(C,L)/2,A=C/2,D=L/2,S=p*(2*Math.PI/t.length),F=M-h,q=F*(1-d),B=(F-q)/2,z=m?Math.min(m*F,B):0,$=t.map(((e,t)=>({...e,index:t}))),G={value:e=>e.value,fill:e=>e?.color||u.colors[e.index]},I=t.map(((e,t)=>({label:e.label,value:e.value.toString(),color:u.colors[t%u.colors.length]})));return e.jsxs("div",{className:s("pie-chart",O["pie-chart"],i),children:[e.jsx("svg",{viewBox:`0 0 ${c} ${c}`,preserveAspectRatio:"xMidYMid meet",children:e.jsx(l.Group,{top:D,left:A,children:e.jsx(o.Pie,{data:$,pieValue:G.value,outerRadius:F,innerRadius:q,padAngle:S,cornerRadius:z,children:t=>t.arcs.map(((l,i)=>{const[o,r]=t.path.centroid(l),s=l.endAngle-l.startAngle>=.25,n=e=>g(e,l.data),c={d:t.path(l)||"",fill:G.fill(l.data)};return a&&(c.onMouseMove=n,c.onMouseLeave=v),e.jsxs("g",{children:[e.jsx("path",{...c}),s&&e.jsx("text",{x:o,y:r,dy:".33em",fill:u.labelBackgroundColor||x.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:l.data.label})]},`arc-${i}`)}))})})}),r&&e.jsx(w,{items:I,orientation:n,className:O["pie-chart-legend"]}),a&&b&&j&&e.jsx(k,{data:j,top:y||0,left:f||0,style:{transform:"translate(-50%, -100%)"}})]})};B.displayName="PieChart";var z=N(B),$="pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9",G="pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y",I="pie-semi-circle-chart-module__label__nPqOg",R="pie-semi-circle-chart-module__note__LpBZQ";const V=({data:t,size:i=500,label:o,note:c,className:d,withTooltips:h=!1,clockwise:p=!0,thickness:m=.4,showLegend:x,legendOrientation:v})=>{const b=_(),{tooltipOpen:j,tooltipLeft:f,tooltipTop:y,tooltipData:N,hideTooltip:T,showTooltip:C}=r.useTooltip(),L=i/2,M=i/2,A=i/2,D=A*(1-m+.03),S=t.map(((e,t)=>({...e,index:t}))),F=p?-Math.PI/2:Math.PI/2,q=p?Math.PI/2:-Math.PI/2,P={value:e=>e.value,sort:(e,t)=>t.value-e.value,fill:e=>e.color||b.colors[e.index%b.colors.length]},O=n.useCallback(((e,t)=>{const l=a.localPoint(e);l&&C({tooltipData:t.data,tooltipLeft:l.x,tooltipTop:l.y-10})}),[C]),B=n.useCallback((()=>{T()}),[T]),z=n.useCallback((e=>t=>{O(t,e)}),[O]),V=t.map(((e,t)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:P.fill({...e,index:t})})));return e.jsxs("div",{className:s("pie-semi-circle-chart",$,d),children:[e.jsx("svg",{viewBox:`0 0 ${i} ${M}`,children:e.jsxs(l.Group,{top:L,left:L,children:[e.jsx(u,{data:S,pieValue:P.value,outerRadius:A,innerRadius:D,cornerRadius:3,padAngle:.03,startAngle:F,endAngle:q,pieSort:P.sort,children:t=>t.arcs.map((a=>e.jsx("g",{onMouseMove:z(a),onMouseLeave:B,children:e.jsx("path",{d:t.path(a)||"",fill:P.fill(a.data)})},a.data.label)))}),e.jsxs(l.Group,{children:[e.jsx(g.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:I,children:o}),e.jsx(g.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:R,children:c})]})]})}),h&&j&&N&&e.jsx(k,{data:{label:N.label,value:N.value,valueDisplay:N.valueDisplay},top:y||0,left:f||0}),x&&e.jsx(w,{items:V,orientation:v,className:G})]})};V.displayName="PieSemiCircleChart";var K=N(V);exports.BarChart=A,exports.BaseTooltip=k,exports.Legend=w,exports.LineChart=q,exports.PieChart=z,exports.PieSemiCircleChart=K,exports.ThemeProvider=({theme:t={},children:a})=>{const l={...x,...t};return e.jsx(v.Provider,{value:l,children:a})},exports.useChartMouseHandler=P;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|