@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/line-chart/index.js","mappings":";4CASiBA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAgDC,GAA7BF,OAAOC,IAAI,kBAAoBE,OAAOC,UAAUC,gBAAeC,EAAER,EAAES,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,KAAKC,EAAED,GAAGF,EA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,EAAE+G,cAAe,GAAEC,EAEtD,SAA0BxK,GAChC,IAAAyK,GAA0CC,EAAAA,EAAAA,eAAe,CACxDH,aAAAA,EACAI,2BAA2B,EAC3BC,YAAa,CAAEtF,MAAO,IAAKC,OAAQ,OAH5BsF,EAASJ,EAATI,UAAkBC,EAAWL,EAAlBnF,MAObyF,EAAiBD,EAAcE,KAAKC,IAAKH,EAAaV,GAAa,IACnEc,EAAkBH,EAAiBV,EAEzC,OACChG,EAAAA,EAAAA,KAAA,OACCpF,IAAM4L,EACNM,MAAQ,CACP7F,MAAO,OACP8F,UAAW,GAAF3G,OAAMyG,EAAe,OAC5BvG,UAEHN,EAAAA,EAAAA,KAACmD,EAAgBoC,EAAA,CAChBtE,MAAQyF,EACRxF,OAAS2F,GAEFlL,KAIX,GAjCM,IACNwH,EAGAhE,EAA8E2G,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/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://@automattic/charts/external commonjs2 \"@visx/xychart\"","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/line-chart/line-chart.module.scss?db8b","webpack://@automattic/charts/./src/components/line-chart/line-chart.tsx","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","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 };","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/xychart\");","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\");","// extracted by mini-css-extract-plugin\nexport default {\"line-chart\":\"vbyo4J2HC_KvyGgsWui7\",\"line-chart__tooltip\":\"nLSohGgB7OyUmLRN_dLD\",\"line-chart__tooltip-date\":\"MGw7UT3IImVKXXuBYmwf\",\"line-chart__tooltip-row\":\"KwvDxit9dbF2E6ZzF29e\",\"line-chart__tooltip-label\":\"WmFS4ekGu9e3G6URbkhd\"};","import {\n\tXYChart,\n\tAnimatedLineSeries,\n\tAnimatedAxis,\n\tAnimatedGrid,\n\tTooltip,\n\tbuildChartTheme,\n} from '@visx/xychart';\nimport clsx from 'clsx';\nimport { FC } from 'react';\nimport { useChartTheme } from '../../providers/theme/theme-provider';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport styles from './line-chart.module.scss';\nimport type { BaseChartProps, DataPointDate, SeriesData } from '../../types';\n\n// TODO: revisit grid and axis options - accept as props for frid lines, axis, values: x, y, all, none\n\ninterface LineChartProps extends BaseChartProps< SeriesData[] > {\n\tmargin?: { top: number; right: number; bottom: number; left: number };\n}\n\ntype TooltipData = {\n\tdate: Date;\n\t[ key: string ]: number | Date;\n};\n\ntype TooltipDatum = {\n\tkey: string;\n\tvalue: number;\n};\n\nconst renderTooltip = ( {\n\ttooltipData,\n}: {\n\ttooltipData?: {\n\t\tnearestDatum?: {\n\t\t\tdatum: TooltipData;\n\t\t\tkey: string;\n\t\t};\n\t\tdatumByKey?: { [ key: string ]: { datum: TooltipData } };\n\t};\n} ) => {\n\tconst nearestDatum = tooltipData?.nearestDatum?.datum;\n\tif ( ! nearestDatum ) return null;\n\n\tconst tooltipPoints: TooltipDatum[] = Object.entries( tooltipData?.datumByKey || {} )\n\t\t.map( ( [ key, { datum } ] ) => ( {\n\t\t\tkey,\n\t\t\tvalue: datum.value as number,\n\t\t} ) )\n\t\t.sort( ( a, b ) => b.value - a.value );\n\n\treturn (\n\t\t<div className={ styles[ 'line-chart__tooltip' ] }>\n\t\t\t<div className={ styles[ 'line-chart__tooltip-date' ] }>\n\t\t\t\t{ nearestDatum.date.toLocaleDateString() }\n\t\t\t</div>\n\t\t\t{ tooltipPoints.map( point => (\n\t\t\t\t<div key={ point.key } className={ styles[ 'line-chart__tooltip-row' ] }>\n\t\t\t\t\t<span className={ styles[ 'line-chart__tooltip-label' ] }>{ point.key }:</span>\n\t\t\t\t\t<span className={ styles[ 'line-chart__tooltip-value' ] }>{ point.value }</span>\n\t\t\t\t</div>\n\t\t\t) ) }\n\t\t</div>\n\t);\n};\n\nconst formatDateTick = ( value: number ) => {\n\tconst date = new Date( value );\n\treturn date.toLocaleDateString( undefined, {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t} );\n};\n\nconst LineChart: FC< LineChartProps > = ( {\n\tdata,\n\twidth,\n\theight,\n\tmargin = { top: 20, right: 20, bottom: 40, left: 40 },\n\tclassName,\n\twithTooltips = true,\n\tshowLegend = false,\n\tlegendOrientation = 'horizontal',\n} ) => {\n\tconst providerTheme = useChartTheme();\n\n\tif ( ! data?.length ) {\n\t\treturn (\n\t\t\t<div className={ clsx( 'line-chart-empty', styles[ 'line-chart-empty' ] ) }>Empty...</div>\n\t\t);\n\t}\n\n\t// Create legend items from group labels, this iterates over groups rather than data points\n\tconst legendItems = data.map( ( group, index ) => ( {\n\t\tlabel: group.label, // Label for each unique group\n\t\tvalue: '', // Empty string since we don't want to show a specific value\n\t\tcolor: providerTheme.colors[ index % providerTheme.colors.length ],\n\t} ) );\n\n\tconst accessors = {\n\t\txAccessor: ( d: DataPointDate ) => d.date,\n\t\tyAccessor: ( d: DataPointDate ) => d.value,\n\t};\n\n\tconst theme = buildChartTheme( {\n\t\tbackgroundColor: providerTheme.backgroundColor,\n\t\tcolors: providerTheme.colors,\n\t\tgridStyles: providerTheme.gridStyles,\n\t\ttickLength: providerTheme?.tickLength || 0,\n\t\tgridColor: providerTheme?.gridColor || '',\n\t\tgridColorDark: providerTheme?.gridColorDark || '',\n\t} );\n\n\treturn (\n\t\t<div className={ clsx( 'line-chart', styles[ 'line-chart' ], className ) }>\n\t\t\t<XYChart\n\t\t\t\ttheme={ theme }\n\t\t\t\twidth={ width }\n\t\t\t\theight={ height }\n\t\t\t\tmargin={ margin }\n\t\t\t\txScale={ { type: 'time' } }\n\t\t\t\tyScale={ { type: 'linear', nice: true } }\n\t\t\t>\n\t\t\t\t<AnimatedGrid columns={ false } numTicks={ 4 } />\n\t\t\t\t<AnimatedAxis orientation=\"bottom\" numTicks={ 5 } tickFormat={ formatDateTick } />\n\t\t\t\t<AnimatedAxis orientation=\"left\" numTicks={ 4 } />\n\n\t\t\t\t{ data.map( ( seriesData, index ) => (\n\t\t\t\t\t<AnimatedLineSeries\n\t\t\t\t\t\tkey={ seriesData?.label }\n\t\t\t\t\t\tdataKey={ seriesData?.label }\n\t\t\t\t\t\tdata={ seriesData.data as DataPointDate[] } // TODO: this needs fixing or a more specific type for each chart\n\t\t\t\t\t\t{ ...accessors }\n\t\t\t\t\t\tstroke={ theme.colors[ index % theme.colors.length ] }\n\t\t\t\t\t\tstrokeWidth={ 2 }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\n\t\t\t\t{ withTooltips && (\n\t\t\t\t\t<Tooltip\n\t\t\t\t\t\tsnapTooltipToDatumX\n\t\t\t\t\t\tsnapTooltipToDatumY\n\t\t\t\t\t\tshowSeriesGlyphs\n\t\t\t\t\t\trenderTooltip={ renderTooltip }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</XYChart>\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[ 'line-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport default withResponsive< LineChartProps >( LineChart );\n","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","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","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","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","_arrayLikeToArray","length","Array","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","renderTooltip","_tooltipData$nearestD","tooltipData","nearestDatum","datum","tooltipPoints","entries","datumByKey","_ref2","_ref3","isArray","l","u","next","done","push","toString","slice","name","from","test","sort","date","toLocaleDateString","point","formatDateTick","Date","month","day","WrappedComponent","_ref4","data","_ref4$margin","margin","top","right","bottom","left","_ref4$withTooltips","withTooltips","_ref4$showLegend","showLegend","_ref4$legendOrientati","legendOrientation","providerTheme","useContext","legendItems","group","index","accessors","xAccessor","yAccessor","theme","buildChartTheme","XYChart","xScale","yScale","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","seriesData","AnimatedLineSeries","_objectSpread","dataKey","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend","_ref$maxWidth","maxWidth","aspectRatio","_ref$aspectRatio","debounceTime","_ref$debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","Math","min","containerHeight","style","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/line-chart/line-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[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","renderTooltip","tooltipData","nearestDatum","datum","tooltipPoints","Object","entries","datumByKey","key","sort","a","b","jsxs","date","toLocaleDateString","point","formatDateTick","Date","undefined","month","day","lineChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","Math","min","containerHeight","ref","style","minHeight","size","withResponsive","data","margin","top","right","bottom","left","withTooltips","showLegend","legendOrientation","withGradientFill","options","providerTheme","useContext","length","legendItems","group","index","accessors","xAccessor","d","yAccessor","theme","buildChartTheme","XYChart","xScale","type","yScale","nice","AnimatedGrid","columns","numTicks","AnimatedAxis","tickFormat","axis","x","y","seriesData","_Fragment","LinearGradient","id","from","to","toOpacity","gradient","AnimatedLineSeries","dataKey","AnimatedAreaSeries","renderLine","Tooltip","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend"],"mappings":"6NAKA,MCEMA,EAAeC,EAAAA,cDFY,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,uXEAhB,MAAMC,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAAA,aAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,aACCV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAAAA,IAACM,EAAAA,cACA,CAAAC,MAAQf,EACRgB,UAAYvB,EAA4BM,GACxCkB,MAAM,OACNC,WAAa,GACbC,YAAc,GACdrB,UAAYY,EAAQ,yBAElBU,GACDZ,EAAAA,WAAKV,UAAYY,EAAQ,WAAYX,KAAgBc,SAClDO,EAAOjB,KAAKE,GACbgB,EAAAA,YAAwBvB,UAAYY,EAAQ,eAC3CG,SAAA,CAAAL,EAAAc,IAAA,MAAA,CAAKC,MAAQ,GAAKC,OAAS,YAC1BhB,EACCc,IAAA,OAAA,CAAAC,MAAQ,GACRC,OAAS,GACTC,KAAOpB,EAAMqB,MACb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
@@ -1,4 +1,95 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
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
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
11
|
+
padding: 0.5rem;
|
|
12
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
13
|
+
color: white;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
17
|
+
position: absolute;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
transform: translate(-50%, -100%);
|
|
20
|
+
}
|
|
21
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
22
|
+
position: relative;
|
|
23
|
+
text-align: center;
|
|
24
|
+
}
|
|
25
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
26
|
+
margin-top: 1rem;
|
|
27
|
+
}
|
|
28
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
29
|
+
margin-bottom: 0px;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
}
|
|
33
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
34
|
+
margin-top: 0px;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
}
|
|
37
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
38
|
+
stroke: #d7d6d6;
|
|
39
|
+
stroke-width: 1px;
|
|
40
|
+
shape-rendering: crispEdges;
|
|
41
|
+
}
|
|
42
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: row;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
gap: 16px;
|
|
47
|
+
}
|
|
48
|
+
.legend-module__legend--vertical__Scfzo {
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
gap: 8px;
|
|
52
|
+
}
|
|
3
53
|
|
|
4
|
-
|
|
54
|
+
.legend-module__legend-item__feemn {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
font-size: 0.875rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
62
|
+
border-radius: 2px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.legend-module__legend-item-label__ksx6I {
|
|
66
|
+
color: var(--jp-gray-80, #2c3338);
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: 0.5rem;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.legend-module__legend-item-value__d9x1j {
|
|
73
|
+
font-weight: 500;
|
|
74
|
+
}
|
|
75
|
+
.line-chart-module__line-chart__ITM3d {
|
|
76
|
+
position: relative;
|
|
77
|
+
}
|
|
78
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
79
|
+
background: #fff;
|
|
80
|
+
padding: 0.5rem;
|
|
81
|
+
}
|
|
82
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
83
|
+
font-weight: bold;
|
|
84
|
+
padding-bottom: 10px;
|
|
85
|
+
}
|
|
86
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
87
|
+
display: flex;
|
|
88
|
+
align-items: center;
|
|
89
|
+
padding: 4px 0;
|
|
90
|
+
justify-content: space-between;
|
|
91
|
+
}
|
|
92
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
93
|
+
font-weight: 500;
|
|
94
|
+
padding-right: 1rem;
|
|
95
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@visx/group"),l=require("@visx/shape"),a=require("clsx"),i=require("react"),o=require("@visx/event"),s=require("@visx/tooltip"),n=require("@visx/legend"),r=require("@visx/scale"),d=require("@visx/responsive");const c={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""},h=i.createContext(c);var p={"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 u={horizontal:"row",vertical:"column"},g=({items:t,className:l,orientation:i="horizontal"})=>{const o=r.scaleOrdinal({domain:t.map((e=>e.label)),range:t.map((e=>e.color))});return e.jsx("div",{className:a(p.legend,p[`legend--${i}`],l),role:"list",children:e.jsx(n.LegendOrdinal,{scale:o,direction:u[i],shape:"rect",shapeWidth:16,shapeHeight:16,className:p["legend-items"],children:l=>e.jsx("div",{className:p[`legend--${i}`],children:l.map((l=>e.jsxs("div",{className:p["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:l.value,className:p["legend-item-swatch"]})}),e.jsxs("span",{className:p["legend-item-label"],children:[l.text,t.find((e=>e.label===l.text))?.value&&e.jsx("span",{className:p["legend-item-value"],children:t.find((e=>e.label===l.text))?.value})]})]},l.text)))})})})};var m="base-tooltip-module__tooltip__OfX6n";const v=({data:t})=>e.jsxs(e.Fragment,{children:[t?.label,": ",t?.valueDisplay||t?.value]}),x=({data:t,top:l,left:a,component:i=v,children:o,className:s})=>e.jsx("div",{className:m,style:{top:l,left:a},role:"tooltip",children:o||t&&e.jsx(i,{data:t,className:s})});var _={"pie-chart":"pie-chart-module__pie-chart__R12Vh"};const f=({data:n,withTooltips:r=!1,className:d,showLegend:p,legendOrientation:u,size:m,thickness:v=1,padding:f=20,gapScale:j=0,cornerScale:b=0})=>{const N=i.useContext(h),{onMouseMove:F,onMouseLeave:w,tooltipOpen:C,tooltipData:M,tooltipLeft:k,tooltipTop:T}=(({withTooltips:e})=>{const{tooltipOpen:t,tooltipLeft:l,tooltipTop:a,tooltipData:n,hideTooltip:r,showTooltip:d}=s.useTooltip();return{onMouseMove:i.useCallback(((t,l)=>{if(!e)return;const a=o.localPoint(t);a&&d({tooltipData:l,tooltipLeft:a.x,tooltipTop:a.y-10})}),[e,d]),onMouseLeave:i.useCallback((()=>{e&&r()}),[e,r]),tooltipOpen:t,tooltipData:n||null,tooltipLeft:l,tooltipTop:a}})({withTooltips:r}),{isValid:q,message:L}=(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:""}})(n);if(!q)return e.jsx("div",{className:a("pie-chart",_["pie-chart"],d),children:e.jsx("div",{className:_["error-message"],children:L})});const y=m,z=m,D=Math.min(y,z)/2,R=y/2,S=z/2,A=j*(2*Math.PI/n.length),O=D-f,V=O*(1-v),P=(O-V)/2,$=b?Math.min(b*O,P):0,B=n.map(((e,t)=>({...e,index:t}))),I={value:e=>e.value,fill:e=>e?.color||N.colors[e.index]},W=n.map(((e,t)=>({label:e.label,value:e.value.toString(),color:N.colors[t%N.colors.length]})));return e.jsxs("div",{className:a("pie-chart",_["pie-chart"],d),children:[e.jsx("svg",{viewBox:`0 0 ${m} ${m}`,preserveAspectRatio:"xMidYMid meet",children:e.jsx(t.Group,{top:S,left:R,children:e.jsx(l.Pie,{data:B,pieValue:I.value,outerRadius:O,innerRadius:V,padAngle:A,cornerRadius:$,children:t=>t.arcs.map(((l,a)=>{const[i,o]=t.path.centroid(l),s=l.endAngle-l.startAngle>=.25,n=e=>F(e,l.data),d={d:t.path(l)||"",fill:I.fill(l.data)};return r&&(d.onMouseMove=n,d.onMouseLeave=w),e.jsxs("g",{children:[e.jsx("path",{...d}),s&&e.jsx("text",{x:i,y:o,dy:".33em",fill:N.labelBackgroundColor||c.labelBackgroundColor,fontSize:12,textAnchor:"middle",pointerEvents:"none",children:l.data.label})]},`arc-${a}`)}))})})}),p&&e.jsx(g,{items:W,orientation:u,className:_["pie-chart-legend"]}),r&&C&&M&&e.jsx(x,{data:M,top:T||0,left:k||0,style:{transform:"translate(-50%, -100%)"}})]})};f.displayName="PieChart";var j=function(t,l){const{maxWidth:a=1200,aspectRatio:i=.5,debounceTime:o=50}=l||{};return function(l){const{parentRef:s,width:n}=d.useParentSize({debounceTime:o,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),r=n?Math.min(n,a):600,c=r*i;return e.jsx("div",{ref:s,style:{width:"100%",minHeight:`${c}px`},children:e.jsx(t,{width:r,height:c,size:r,...l})})}}(f);exports.PieChart=j;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components/pie-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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ObsG,EAAiBD,EAActD,KAAKC,IAAKqD,EAAaV,GAAa,IACnEY,EAAkBD,EAAiBV,EAEzC,OACC7G,EAAAA,EAAAA,KAAA,OACCrF,IAAM0M,EACNpF,MAAQ,CACPhB,MAAO,OACPwG,UAAW,GAAFrH,OAAMoH,EAAe,OAC5BlH,UAEHN,EAAAA,EAAAA,KAAC0G,EAAgBpC,EAAA,CAChBrD,MAAQsG,EACRrG,OAASsG,GAEF9L,KAIX,GAjCM,IACNgL,EAGAvH,EAA8EwH,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/arrayLikeToArray.js","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/group\"","webpack://@automattic/charts/external commonjs2 \"@visx/shape\"","webpack://@automattic/charts/external commonjs2 \"clsx\"","webpack://@automattic/charts/external commonjs2 \"@visx/event\"","webpack://@automattic/charts/external commonjs2 \"@visx/tooltip\"","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-chart/pie-chart.module.scss?1ca3","webpack://@automattic/charts/./src/components/pie-chart/pie-chart.tsx","webpack://@automattic/charts/./src/hooks/use-chart-mouse-handler.ts","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://@automattic/charts/../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","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 _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","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/group\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/shape\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"clsx\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/event\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@visx/tooltip\");","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\"};","// extracted by mini-css-extract-plugin\nexport default {\"pie-chart\":\"R2Ly_tkJtgL0HA8P3fpm\"};","import { Group } from '@visx/group';\nimport { Pie } from '@visx/shape';\nimport clsx from 'clsx';\nimport { SVGProps, type MouseEvent } from 'react';\nimport useChartMouseHandler from '../../hooks/use-chart-mouse-handler';\nimport { useChartTheme, defaultTheme } from '../../providers/theme';\nimport { Legend } from '../legend';\nimport { withResponsive } from '../shared/with-responsive';\nimport { BaseTooltip } from '../tooltip';\nimport styles from './pie-chart.module.scss';\nimport type { BaseChartProps, DataPointPercentage } from '../../types';\n\n// TODO: add animation\n\ninterface PieChartProps extends BaseChartProps< DataPointPercentage[] > {\n\t/**\n\t * Inner radius in pixels. If > 0, creates a donut chart. Defaults to 0.\n\t */\n\tinnerRadius?: number;\n}\n\n/**\n * Renders a pie or donut chart using the provided data.\n *\n * @param {PieChartProps} props - Component props\n * @return {JSX.Element} The rendered chart component\n */\nconst PieChart = ( {\n\tdata,\n\twidth = 500, //TODO: replace when making the components responsive\n\theight = 500, //TODO: replace when making the components responsive\n\twithTooltips = false,\n\tinnerRadius = 0,\n\tclassName,\n\tshowLegend,\n\tlegendOrientation,\n}: PieChartProps ) => {\n\tconst providerTheme = useChartTheme();\n\tconst { onMouseMove, onMouseLeave, tooltipOpen, tooltipData, tooltipLeft, tooltipTop } =\n\t\tuseChartMouseHandler( {\n\t\t\twithTooltips,\n\t\t} );\n\n\t// Calculate radius based on width/height\n\tconst radius = Math.min( width, height ) / 2;\n\tconst centerX = width / 2;\n\tconst centerY = height / 2;\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\tconst accessors = {\n\t\tvalue: ( d: DataPointPercentage ) => d.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 ],\n\t};\n\n\t// Create legend items from data\n\tconst legendItems = data.map( ( item, index ) => ( {\n\t\tlabel: item.label,\n\t\tvalue: item.value.toString(),\n\t\tcolor: providerTheme.colors[ index % providerTheme.colors.length ],\n\t} ) );\n\n\treturn (\n\t\t<div className={ clsx( 'pie-chart', styles[ 'pie-chart' ], className ) }>\n\t\t\t<svg width={ width } height={ height }>\n\t\t\t\t<Group top={ centerY } left={ centerX }>\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 - 20 } // Leave space for labels/tooltips\n\t\t\t\t\t\tinnerRadius={ innerRadius }\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, index ) => {\n\t\t\t\t\t\t\t\tconst [ centroidX, centroidY ] = pie.path.centroid( arc );\n\t\t\t\t\t\t\t\tconst hasSpaceForLabel = arc.endAngle - arc.startAngle >= 0.25;\n\t\t\t\t\t\t\t\tconst handleMouseMove = ( event: MouseEvent< SVGElement > ) =>\n\t\t\t\t\t\t\t\t\tonMouseMove( event, arc.data );\n\n\t\t\t\t\t\t\t\tconst pathProps: SVGProps< SVGPathElement > = {\n\t\t\t\t\t\t\t\t\td: pie.path( arc ) || '',\n\t\t\t\t\t\t\t\t\tfill: accessors.fill( arc.data ),\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif ( withTooltips ) {\n\t\t\t\t\t\t\t\t\tpathProps.onMouseMove = handleMouseMove;\n\t\t\t\t\t\t\t\t\tpathProps.onMouseLeave = onMouseLeave;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<g key={ `arc-${ index }` }>\n\t\t\t\t\t\t\t\t\t\t<path { ...pathProps } />\n\t\t\t\t\t\t\t\t\t\t{ hasSpaceForLabel && (\n\t\t\t\t\t\t\t\t\t\t\t<text\n\t\t\t\t\t\t\t\t\t\t\t\tx={ centroidX }\n\t\t\t\t\t\t\t\t\t\t\t\ty={ centroidY }\n\t\t\t\t\t\t\t\t\t\t\t\tdy=\".33em\"\n\t\t\t\t\t\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\t\t\t\t\t\tproviderTheme.labelBackgroundColor || defaultTheme.labelBackgroundColor\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tfontSize={ 12 }\n\t\t\t\t\t\t\t\t\t\t\t\ttextAnchor=\"middle\"\n\t\t\t\t\t\t\t\t\t\t\t\tpointerEvents=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ arc.data.label }\n\t\t\t\t\t\t\t\t\t\t\t</text>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</g>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t</Pie>\n\t\t\t\t</Group>\n\t\t\t</svg>\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-chart-legend' ] }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ withTooltips && tooltipOpen && tooltipData && (\n\t\t\t\t<BaseTooltip\n\t\t\t\t\tdata={ tooltipData }\n\t\t\t\t\ttop={ tooltipTop || 0 }\n\t\t\t\t\tleft={ tooltipLeft || 0 }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\ttransform: 'translate(-50%, -100%)',\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nPieChart.displayName = 'PieChart';\nexport default withResponsive< PieChartProps >( PieChart );\n","import { localPoint } from '@visx/event';\nimport { useTooltip } from '@visx/tooltip';\nimport { useCallback, type MouseEvent } from 'react';\nimport type { DataPoint } from '../types';\n\ntype UseChartMouseHandlerProps = {\n\t/**\n\t * Whether tooltips are enabled\n\t */\n\twithTooltips: boolean;\n};\n\ntype UseChartMouseHandlerReturn = {\n\t/**\n\t * Handler for mouse move events\n\t */\n\tonMouseMove: ( event: React.MouseEvent< SVGElement >, data: DataPoint ) => void;\n\t/**\n\t * Handler for mouse leave events\n\t */\n\tonMouseLeave: () => void;\n\t/**\n\t * Whether the tooltip is currently open\n\t */\n\ttooltipOpen: boolean;\n\t/**\n\t * The current tooltip data\n\t */\n\ttooltipData: DataPoint | null;\n\t/**\n\t * The current tooltip left position\n\t */\n\ttooltipLeft: number | undefined;\n\t/**\n\t * The current tooltip top position\n\t */\n\ttooltipTop: number | undefined;\n};\n\n/**\n * Hook to handle mouse interactions for chart components\n *\n * @param {UseChartMouseHandlerProps} props - Hook configuration\n * @return {UseChartMouseHandlerReturn} Object containing handlers and tooltip state\n */\nconst useChartMouseHandler = ( {\n\twithTooltips,\n}: UseChartMouseHandlerProps ): UseChartMouseHandlerReturn => {\n\tconst { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =\n\t\tuseTooltip< DataPoint >();\n\n\t// TODO: either debounce/throttle or use useTooltipInPortal with built-in debounce\n\tconst onMouseMove = useCallback(\n\t\t( event: MouseEvent< SVGElement >, data: DataPoint ) => {\n\t\t\tif ( ! withTooltips ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst coords = localPoint( event );\n\t\t\tif ( ! coords ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tshowTooltip( {\n\t\t\t\ttooltipData: 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[ withTooltips, showTooltip ]\n\t);\n\n\tconst onMouseLeave = useCallback( () => {\n\t\tif ( ! withTooltips ) {\n\t\t\treturn;\n\t\t}\n\t\thideTooltip();\n\t}, [ withTooltips, hideTooltip ] );\n\n\treturn {\n\t\tonMouseMove,\n\t\tonMouseLeave,\n\t\ttooltipOpen,\n\t\ttooltipData: tooltipData || null,\n\t\ttooltipLeft,\n\t\ttooltipTop,\n\t};\n};\n\nexport default useChartMouseHandler;\n","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","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","_arrayLikeToArray","length","Array","_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","PieChart","_ref$width","_ref$height","_ref$withTooltips","withTooltips","_ref$innerRadius","innerRadius","showLegend","legendOrientation","providerTheme","useContext","_useChartMouseHandler","_useTooltip","useTooltip","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","onMouseMove","useCallback","event","coords","localPoint","x","y","onMouseLeave","useChartMouseHandler","radius","Math","min","centerX","centerY","dataWithIndex","index","_objectSpread","accessors","legendItems","toString","Group","Pie","pieValue","outerRadius","pie","arcs","arc","_pie$path$centroid2","path","centroid","isArray","u","next","done","push","slice","name","from","test","centroidX","centroidY","hasSpaceForLabel","endAngle","startAngle","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform","displayName","WrappedComponent","_ref$maxWidth","maxWidth","aspectRatio","_ref$aspectRatio","debounceTime","_ref$debounceTime","_useParentSize","useParentSize","enableDebounceLeadingCall","initialSize","parentRef","parentWidth","containerWidth","containerHeight","minHeight"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/hooks/use-chart-mouse-handler.ts","../../../../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-chart/pie-chart.tsx","../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null,null,null,null,null,null,null],"names":["defaultTheme","backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","ThemeContext","createContext","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","PieChart","withTooltips","showLegend","legendOrientation","size","thickness","padding","gapScale","cornerScale","providerTheme","useContext","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","hideTooltip","showTooltip","useTooltip","useCallback","event","coords","localPoint","x","y","useChartMouseHandler","isValid","message","length","some","percentage","totalPercentage","reduce","sum","Math","abs","validateData","radius","min","centerX","centerY","padAngle","PI","outerRadius","innerRadius","maxCornerRadius","cornerRadius","dataWithIndex","d","index","accessors","legendItems","toString","viewBox","preserveAspectRatio","Group","Pie","pieValue","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","pathProps","dy","fontSize","textAnchor","pointerEvents","Legend","transform","displayName","pieChart","WrappedComponent","config","maxWidth","aspectRatio","debounceTime","props","parentRef","parentWidth","useParentSize","enableDebounceLeadingCall","initialSize","containerWidth","containerHeight","ref","minHeight","withResponsive"],"mappings":"4QA6CA,MCxCMA,EAA2B,CAChCC,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,ICRVC,EAAeC,EAAAA,cAA6BX,qXCQlD,MAAMY,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAGEC,EAAgC,EAC5CC,QACAC,YACAC,cAAc,iBAEd,MAAMC,EAAcC,EAAAA,aAAc,CACjCC,OAAQL,EAAMM,KAAKC,GAAQA,EAAKC,QAChCC,MAAOT,EAAMM,KAAKC,GAAQA,EAAKG,UAGhC,OACCC,aACCV,UAAYW,EAAMC,EAAOC,OAAQD,EAAQ,WAAYX,KAAkBD,GACvEc,KAAK,OAELC,SAAAL,EAAAA,IAACM,EAAAA,cACA,CAAAC,MAAQf,EACRgB,UAAYvB,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__lmYNi {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
.bar-chart-module__bar-chart-legend__vgKKq {
|
|
5
|
+
margin-top: 1rem;
|
|
6
|
+
}
|
|
7
|
+
.line-chart-module__line-chart__ITM3d {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
.line-chart-module__line-chart__tooltip__aqcme {
|
|
11
|
+
background: #fff;
|
|
12
|
+
padding: 0.5rem;
|
|
13
|
+
}
|
|
14
|
+
.line-chart-module__line-chart__tooltip-date__4Dzab {
|
|
15
|
+
font-weight: bold;
|
|
16
|
+
padding-bottom: 10px;
|
|
17
|
+
}
|
|
18
|
+
.line-chart-module__line-chart__tooltip-row__6A37G {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
padding: 4px 0;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
}
|
|
24
|
+
.line-chart-module__line-chart__tooltip-label__IvnFF {
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
padding-right: 1rem;
|
|
27
|
+
}
|
|
28
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 {
|
|
29
|
+
position: relative;
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y {
|
|
33
|
+
margin-top: 1rem;
|
|
34
|
+
}
|
|
35
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__label__nPqOg {
|
|
36
|
+
margin-bottom: 0px;
|
|
37
|
+
font-weight: 600;
|
|
38
|
+
font-size: 16px;
|
|
39
|
+
}
|
|
40
|
+
.pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module__note__LpBZQ {
|
|
41
|
+
margin-top: 0px;
|
|
42
|
+
font-size: 14px;
|
|
43
|
+
}
|
|
44
|
+
.grid-control-module__grid-control__KOnZN .visx-line {
|
|
45
|
+
stroke: #d7d6d6;
|
|
46
|
+
stroke-width: 1px;
|
|
47
|
+
shape-rendering: crispEdges;
|
|
48
|
+
}
|
|
49
|
+
.legend-module__legend--horizontal__IUN13 {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
flex-wrap: wrap;
|
|
53
|
+
gap: 16px;
|
|
54
|
+
}
|
|
55
|
+
.legend-module__legend--vertical__Scfzo {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 8px;
|
|
59
|
+
}
|
|
4
60
|
|
|
5
|
-
|
|
61
|
+
.legend-module__legend-item__feemn {
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
font-size: 0.875rem;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.legend-module__legend-item-swatch__nRyXf {
|
|
69
|
+
border-radius: 2px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.legend-module__legend-item-label__ksx6I {
|
|
73
|
+
color: var(--jp-gray-80, #2c3338);
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.legend-module__legend-item-value__d9x1j {
|
|
80
|
+
font-weight: 500;
|
|
81
|
+
}
|
|
82
|
+
.base-tooltip-module__tooltip__OfX6n {
|
|
83
|
+
padding: 0.5rem;
|
|
84
|
+
background-color: rgba(0, 0, 0, 0.85);
|
|
85
|
+
color: white;
|
|
86
|
+
border-radius: 4px;
|
|
87
|
+
font-size: 14px;
|
|
88
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
89
|
+
position: absolute;
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
transform: translate(-50%, -100%);
|
|
92
|
+
}
|
|
93
|
+
.pie-chart-module__pie-chart__R12Vh {
|
|
94
|
+
position: relative;
|
|
95
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/event"),i=require("@visx/group"),t=require("@visx/shape/lib/shapes/Pie"),a=require("@visx/text"),s=require("@visx/tooltip"),r=require("clsx"),o=require("react"),n=require("@visx/legend"),c=require("@visx/scale"),d=require("@visx/responsive");const h=o.createContext({backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:0,gridColor:"",gridColorDark:""});var u={"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 m={horizontal:"row",vertical:"column"},p=({items:l,className:i,orientation:t="horizontal"})=>{const a=c.scaleOrdinal({domain:l.map((e=>e.label)),range:l.map((e=>e.color))});return e.jsx("div",{className:r(u.legend,u[`legend--${t}`],i),role:"list",children:e.jsx(n.LegendOrdinal,{scale:a,direction:m[t],shape:"rect",shapeWidth:16,shapeHeight:16,className:u["legend-items"],children:i=>e.jsx("div",{className:u[`legend--${t}`],children:i.map((i=>e.jsxs("div",{className:u["legend-item"],children:[e.jsx("svg",{width:16,height:16,children:e.jsx("rect",{width:16,height:16,fill:i.value,className:u["legend-item-swatch"]})}),e.jsxs("span",{className:u["legend-item-label"],children:[i.text,l.find((e=>e.label===i.text))?.value&&e.jsx("span",{className:u["legend-item-value"],children:l.find((e=>e.label===i.text))?.value})]})]},i.text)))})})})};var g="base-tooltip-module__tooltip__OfX6n";const x=({data:l})=>e.jsxs(e.Fragment,{children:[l?.label,": ",l?.valueDisplay||l?.value]}),v=({data:l,top:i,left:t,component:a=x,children:s,className:r})=>e.jsx("div",{className:g,style:{top:i,left:t},role:"tooltip",children:s||l&&e.jsx(a,{data:l,className:r})});var _="pie-semi-circle-chart-module__pie-semi-circle-chart__r5jk9",j="pie-semi-circle-chart-module__pie-semi-circle-chart-legend__c8W1Y",b="pie-semi-circle-chart-module__label__nPqOg",f="pie-semi-circle-chart-module__note__LpBZQ";const C=({data:n,size:c=500,label:d,note:u,className:m,withTooltips:g=!1,clockwise:x=!0,thickness:C=.4,showLegend:F,legendOrientation:N})=>{const w=o.useContext(h),{tooltipOpen:k,tooltipLeft:q,tooltipTop:y,tooltipData:D,hideTooltip:P,showTooltip:T}=s.useTooltip(),z=c/2,A=c/2,L=c/2,M=L*(1-C+.03),S=n.map(((e,l)=>({...e,index:l}))),I=x?-Math.PI/2:Math.PI/2,O=x?Math.PI/2:-Math.PI/2,R={value:e=>e.value,sort:(e,l)=>l.value-e.value,fill:e=>e.color||w.colors[e.index%w.colors.length]},$=o.useCallback(((e,i)=>{const t=l.localPoint(e);t&&T({tooltipData:i.data,tooltipLeft:t.x,tooltipTop:t.y-10})}),[T]),B=o.useCallback((()=>{P()}),[P]),W=o.useCallback((e=>l=>{$(l,e)}),[$]),G=n.map(((e,l)=>({label:e.label,value:e.valueDisplay||e.value.toString(),color:R.fill({...e,index:l})})));return e.jsxs("div",{className:r("pie-semi-circle-chart",_,m),children:[e.jsx("svg",{viewBox:`0 0 ${c} ${A}`,children:e.jsxs(i.Group,{top:z,left:z,children:[e.jsx(t,{data:S,pieValue:R.value,outerRadius:L,innerRadius:M,cornerRadius:3,padAngle:.03,startAngle:I,endAngle:O,pieSort:R.sort,children:l=>l.arcs.map((i=>e.jsx("g",{onMouseMove:W(i),onMouseLeave:B,children:e.jsx("path",{d:l.path(i)||"",fill:R.fill(i.data)})},i.data.label)))}),e.jsxs(i.Group,{children:[e.jsx(a.Text,{textAnchor:"middle",verticalAnchor:"start",y:-40,className:b,children:d}),e.jsx(a.Text,{textAnchor:"middle",verticalAnchor:"start",y:-20,className:f,children:u})]})]})}),g&&k&&D&&e.jsx(v,{data:{label:D.label,value:D.value,valueDisplay:D.valueDisplay},top:y||0,left:q||0}),F&&e.jsx(p,{items:G,orientation:N,className:j})]})};C.displayName="PieSemiCircleChart";var F=function(l,i){const{maxWidth:t=1200,aspectRatio:a=.5,debounceTime:s=50}=i||{};return function(i){const{parentRef:r,width:o}=d.useParentSize({debounceTime:s,enableDebounceLeadingCall:!0,initialSize:{width:600,height:400}}),n=o?Math.min(o,t):600,c=n*a;return e.jsx("div",{ref:r,style:{width:"100%",minHeight:`${c}px`},children:e.jsx(l,{width:n,height:c,size:n,...i})})}}(C);exports.PieSemiCircleChart=F;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|