@automattic/charts 0.12.0 → 0.13.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 +22 -0
- package/dist/cjs/components/bar-chart/bar-chart.js +1 -1
- package/dist/cjs/components/bar-chart/bar-chart.js.map +1 -1
- package/dist/cjs/components/bar-chart/use-bar-chart-options.js +1 -1
- package/dist/cjs/components/bar-chart/use-bar-chart-options.js.map +1 -1
- package/dist/cjs/components/bar-list-chart/bar-list-chart.js +1 -1
- package/dist/cjs/components/bar-list-chart/bar-list-chart.js.map +1 -1
- package/dist/cjs/components/legend/base-legend.js +1 -1
- package/dist/cjs/components/legend/base-legend.js.map +1 -1
- package/dist/cjs/components/legend/utils.js +1 -1
- package/dist/cjs/components/legend/utils.js.map +1 -1
- package/dist/cjs/components/line-chart/line-chart.js +1 -1
- package/dist/cjs/components/line-chart/line-chart.js.map +1 -1
- package/dist/cjs/components/pie-chart/pie-chart.js.map +1 -1
- package/dist/cjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js.map +1 -1
- package/dist/cjs/components/shared/date-parsing.js +2 -0
- package/dist/cjs/components/shared/date-parsing.js.map +1 -0
- package/dist/cjs/components/shared/use-chart-margin.js.map +1 -1
- package/dist/cjs/components/shared/use-element-height.js +2 -0
- package/dist/cjs/components/shared/use-element-height.js.map +1 -0
- package/dist/cjs/components/shared/utils.js.map +1 -1
- package/dist/cjs/components/shared/with-responsive.js +1 -1
- package/dist/cjs/components/shared/with-responsive.js.map +1 -1
- package/dist/cjs/hooks/use-chart-mouse-handler.js.map +1 -1
- package/dist/cjs/providers/theme/theme-provider.js.map +1 -1
- package/dist/cjs/providers/theme/themes.js +1 -1
- package/dist/cjs/providers/theme/themes.js.map +1 -1
- package/dist/cjs/style.css +1 -0
- package/dist/index.d.ts +52 -10
- package/dist/mjs/components/bar-chart/bar-chart.js +1 -1
- package/dist/mjs/components/bar-chart/bar-chart.js.map +1 -1
- package/dist/mjs/components/bar-chart/use-bar-chart-options.js +1 -1
- package/dist/mjs/components/bar-chart/use-bar-chart-options.js.map +1 -1
- package/dist/mjs/components/bar-list-chart/bar-list-chart.js +1 -1
- package/dist/mjs/components/bar-list-chart/bar-list-chart.js.map +1 -1
- package/dist/mjs/components/legend/base-legend.js +1 -1
- package/dist/mjs/components/legend/base-legend.js.map +1 -1
- package/dist/mjs/components/legend/utils.js +1 -1
- package/dist/mjs/components/legend/utils.js.map +1 -1
- package/dist/mjs/components/line-chart/line-chart.js +1 -1
- package/dist/mjs/components/line-chart/line-chart.js.map +1 -1
- package/dist/mjs/components/pie-chart/pie-chart.js.map +1 -1
- package/dist/mjs/components/pie-semi-circle-chart/pie-semi-circle-chart.js.map +1 -1
- package/dist/mjs/components/shared/date-parsing.js +2 -0
- package/dist/mjs/components/shared/date-parsing.js.map +1 -0
- package/dist/mjs/components/shared/use-chart-margin.js.map +1 -1
- package/dist/mjs/components/shared/use-element-height.js +2 -0
- package/dist/mjs/components/shared/use-element-height.js.map +1 -0
- package/dist/mjs/components/shared/utils.js.map +1 -1
- package/dist/mjs/components/shared/with-responsive.js +1 -1
- package/dist/mjs/components/shared/with-responsive.js.map +1 -1
- package/dist/mjs/hooks/use-chart-mouse-handler.js.map +1 -1
- package/dist/mjs/providers/theme/theme-provider.js.map +1 -1
- package/dist/mjs/providers/theme/themes.js +1 -1
- package/dist/mjs/providers/theme/themes.js.map +1 -1
- package/dist/mjs/style.css +1 -0
- package/package.json +10 -9
- package/rollup.config.mjs +1 -1
- package/src/components/bar-chart/bar-chart.module.scss +5 -1
- package/src/components/bar-chart/bar-chart.tsx +10 -5
- package/src/components/bar-chart/use-bar-chart-options.ts +2 -2
- package/src/components/legend/base-legend.tsx +99 -89
- package/src/components/legend/legend.module.scss +0 -1
- package/src/components/legend/types.ts +2 -1
- package/src/components/legend/utils.ts +1 -1
- package/src/components/line-chart/line-chart.module.scss +4 -0
- package/src/components/line-chart/line-chart.tsx +97 -7
- package/src/components/shared/date-parsing.ts +103 -0
- package/src/components/shared/use-element-height.ts +38 -0
- package/src/components/shared/with-responsive.tsx +48 -17
- package/src/index.ts +3 -0
- package/src/providers/theme/themes.ts +14 -0
- package/src/types.ts +17 -1
- package/dist/cjs/_virtual/_commonjs-dynamic-modules.js +0 -2
- package/dist/cjs/_virtual/_commonjs-dynamic-modules.js.map +0 -1
- package/dist/cjs/_virtual/_commonjsHelpers.js +0 -2
- package/dist/cjs/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/cjs/_virtual/browser.js +0 -2
- package/dist/cjs/_virtual/browser.js.map +0 -1
- package/dist/cjs/_virtual/index.js +0 -2
- package/dist/cjs/_virtual/index.js.map +0 -1
- package/dist/cjs/_virtual/index2.js +0 -2
- package/dist/cjs/_virtual/index2.js.map +0 -1
- package/dist/cjs/_virtual/moment-timezone-utils.js +0 -2
- package/dist/cjs/_virtual/moment-timezone-utils.js.map +0 -1
- package/dist/cjs/_virtual/moment-timezone.js +0 -2
- package/dist/cjs/_virtual/moment-timezone.js.map +0 -1
- package/dist/cjs/_virtual/moment.js +0 -2
- package/dist/cjs/_virtual/moment.js.map +0 -1
- package/dist/cjs/_virtual/node.js +0 -2
- package/dist/cjs/_virtual/node.js.map +0 -1
- package/dist/cjs/index.css +0 -1
- package/dist/cjs/node_modules/.pnpm/@wordpress_date@5.24.0/node_modules/@wordpress/date/build-module/index.js +0 -2
- package/dist/cjs/node_modules/.pnpm/@wordpress_date@5.24.0/node_modules/@wordpress/date/build-module/index.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js +0 -2
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js +0 -2
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js +0 -2
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js +0 -2
- package/dist/cjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/data/packed/latest.json.js +0 -2
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/data/packed/latest.json.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/index.js +0 -2
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/index.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone-utils.js +0 -8
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone-utils.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone.js +0 -8
- package/dist/cjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js +0 -4
- package/dist/cjs/node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js.map +0 -1
- package/dist/cjs/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -2
- package/dist/cjs/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/constants.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/constants.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/create-number-formatters.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/create-number-formatters.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/get-cached-formatter.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/get-cached-formatter.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/index.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/index.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/currencies.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/currencies.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/index.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/index.js.map +0 -1
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format.js +0 -2
- package/dist/cjs/projects/js-packages/number-formatters/dist/esm/number-format.js.map +0 -1
- package/dist/mjs/_virtual/_commonjs-dynamic-modules.js +0 -2
- package/dist/mjs/_virtual/_commonjs-dynamic-modules.js.map +0 -1
- package/dist/mjs/_virtual/_commonjsHelpers.js +0 -2
- package/dist/mjs/_virtual/_commonjsHelpers.js.map +0 -1
- package/dist/mjs/_virtual/browser.js +0 -2
- package/dist/mjs/_virtual/browser.js.map +0 -1
- package/dist/mjs/_virtual/index.js +0 -2
- package/dist/mjs/_virtual/index.js.map +0 -1
- package/dist/mjs/_virtual/index2.js +0 -2
- package/dist/mjs/_virtual/index2.js.map +0 -1
- package/dist/mjs/_virtual/moment-timezone-utils.js +0 -2
- package/dist/mjs/_virtual/moment-timezone-utils.js.map +0 -1
- package/dist/mjs/_virtual/moment-timezone.js +0 -2
- package/dist/mjs/_virtual/moment-timezone.js.map +0 -1
- package/dist/mjs/_virtual/moment.js +0 -2
- package/dist/mjs/_virtual/moment.js.map +0 -1
- package/dist/mjs/_virtual/node.js +0 -2
- package/dist/mjs/_virtual/node.js.map +0 -1
- package/dist/mjs/index.css +0 -1
- package/dist/mjs/node_modules/.pnpm/@wordpress_date@5.24.0/node_modules/@wordpress/date/build-module/index.js +0 -2
- package/dist/mjs/node_modules/.pnpm/@wordpress_date@5.24.0/node_modules/@wordpress/date/build-module/index.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js +0 -2
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/browser.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js +0 -2
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/common.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js +0 -2
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/index.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js +0 -2
- package/dist/mjs/node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/data/packed/latest.json.js +0 -2
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/data/packed/latest.json.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/index.js +0 -2
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/index.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone-utils.js +0 -8
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone-utils.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone.js +0 -8
- package/dist/mjs/node_modules/.pnpm/moment-timezone@0.5.48/node_modules/moment-timezone/moment-timezone.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js +0 -4
- package/dist/mjs/node_modules/.pnpm/moment@2.30.1/node_modules/moment/moment.js.map +0 -1
- package/dist/mjs/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +0 -2
- package/dist/mjs/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/constants.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/constants.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/create-number-formatters.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/create-number-formatters.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/get-cached-formatter.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/get-cached-formatter.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/index.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/index.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/currencies.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/currencies.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/index.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format-currency/index.js.map +0 -1
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format.js +0 -2
- package/dist/mjs/projects/js-packages/number-formatters/dist/esm/number-format.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.13.0] - 2025-06-11
|
|
9
|
+
### Added
|
|
10
|
+
- Add responsive configuration options for charts [#43871]
|
|
11
|
+
- Add supports for customizing legend label/container styles [#43868]
|
|
12
|
+
- Charts: Add support for the glyph at the start of the line chart [#43819]
|
|
13
|
+
- Support date literals [#43791]
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Janitorial: clean up dependency versions. [#43841]
|
|
17
|
+
- Set SVG overflow to visible in bar-chart and line-chart styles [#43869]
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- Chart components now subtract legend height from total height, ensuring the rendered chart (including legend) does not exceed the specified height prop [#43844]
|
|
21
|
+
- Fix default bar chart gridVisibility [#43845]
|
|
22
|
+
- Fix output CSS file name [#43842]
|
|
23
|
+
|
|
24
|
+
## [0.12.1] - 2025-06-06
|
|
25
|
+
### Fixed
|
|
26
|
+
- Fix @automattic/number-formatters dependency issue [#43813]
|
|
27
|
+
|
|
8
28
|
## [0.12.0] - 2025-06-06
|
|
9
29
|
### Added
|
|
10
30
|
- Add bar list chart component [#43763]
|
|
@@ -212,6 +232,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
212
232
|
- Fixed lints following ESLint rule changes for TS [#40584]
|
|
213
233
|
- Fixing a bug in Chart storybook data. [#40640]
|
|
214
234
|
|
|
235
|
+
[0.13.0]: https://github.com/Automattic/charts/compare/v0.12.1...v0.13.0
|
|
236
|
+
[0.12.1]: https://github.com/Automattic/charts/compare/v0.12.0...v0.12.1
|
|
215
237
|
[0.12.0]: https://github.com/Automattic/charts/compare/v0.11.4...v0.12.0
|
|
216
238
|
[0.11.4]: https://github.com/Automattic/charts/compare/v0.11.3...v0.11.4
|
|
217
239
|
[0.11.3]: https://github.com/Automattic/charts/compare/v0.11.2...v0.11.3
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),a=require("@visx/xychart"),r=require("clsx"),s=require("react"),t=require("../../providers/theme/theme-provider.js"),i=require("../legend/base-legend.js"),l=require("../shared/use-chart-margin.js"),o=require("../shared/with-responsive.js"),c=require("./bar-chart.module.scss.js"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),a=require("@visx/xychart"),r=require("clsx"),s=require("react"),t=require("../../providers/theme/theme-provider.js"),i=require("../legend/base-legend.js"),l=require("../shared/use-chart-margin.js"),o=require("../shared/use-element-height.js"),n=require("../shared/with-responsive.js"),c=require("./bar-chart.module.scss.js"),h=require("./use-bar-chart-options.js");var d=n.withResponsive((({data:n,width:d,height:u=400,className:p,margin:m,withTooltips:x=!1,showLegend:b=!1,legendOrientation:g="horizontal",legendShape:j="rect",gridVisibility:v,renderTooltip:y,options:N={},orientation:T="vertical"})=>{const _="horizontal"===T,q=t.useXYChartTheme(n),w=h.useBarChartOptions(n,_,N),S=l.useChartMargin(u,w,n,q,_),[A,D]=o.useElementHeight(),B=s.useCallback((({tooltipData:a})=>{const r=a?.nearestDatum?.datum;return r?e.jsxs("div",{className:c["bar-chart__tooltip"],children:[e.jsx("div",{className:c["bar-chart__tooltip-header"],children:a?.nearestDatum?.key}),e.jsxs("div",{className:c["bar-chart__tooltip-row"],children:[e.jsxs("span",{className:c["bar-chart__tooltip-label"],children:[w.tooltip.labelFormatter(r.label||r.date.getTime(),0,[]),":"]}),e.jsx("span",{className:c["bar-chart__tooltip-value"],children:r.value})]})]}):null}),[w.tooltip]),C=(e=>e?.length?e.some((e=>e.data.some((e=>null===e.value||void 0===e.value||isNaN(e.value)||!e.label&&(!e.date||isNaN(e.date.getTime()))))))?"Invalid data":null:"No data available")(n);if(C)return e.jsx("div",{className:r("bar-chart",c["bar-chart"]),children:C});const k=n.map(((e,a)=>({label:e.label,value:"",color:e.options?.stroke||q.colors[a%q.colors.length],shapeStyle:e?.options?.legendShapeStyle}))),z=v??w.gridVisibility;return e.jsxs("div",{className:r("bar-chart",c["bar-chart"],p),"data-testid":"bar-chart",role:"img","aria-label":"bar chart",style:{width:d,height:u},children:[e.jsxs(a.XYChart,{theme:q,width:d,height:u-D,margin:{...S,...m},xScale:w.xScale,yScale:w.yScale,horizontal:_,pointerEventsDataKey:"nearest",children:[e.jsx(a.Grid,{columns:z.includes("y"),rows:z.includes("x"),numTicks:4}),e.jsx(a.BarGroup,{padding:w.barGroup.padding,children:n.map((r=>e.jsx(a.BarSeries,{dataKey:r?.label,data:r.data,yAccessor:w.accessors.yAccessor,xAccessor:w.accessors.xAccessor},r?.label)))}),e.jsx(a.Axis,{...w.axis.x}),e.jsx(a.Axis,{...w.axis.y}),x&&e.jsx(a.Tooltip,{detectBounds:!0,snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,renderTooltip:y||B})]}),b&&e.jsx(i.BaseLegend,{items:k,orientation:g,className:c["bar-chart__legend"],shape:j,ref:A})]})}));module.exports=d;
|
|
2
2
|
//# sourceMappingURL=bar-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-chart.js","sources":["/@automattic/charts/../../../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":[null],"names":["withResponsive","data","width","height","className","margin","withTooltips","showLegend","legendOrientation","legendShape","gridVisibility","gridVisibilityProp","renderTooltip","options","orientation","horizontal","
|
|
1
|
+
{"version":3,"file":"bar-chart.js","sources":["/@automattic/charts/../../../../src/components/bar-chart/bar-chart.tsx"],"sourcesContent":[null],"names":["withResponsive","data","width","height","className","margin","withTooltips","showLegend","legendOrientation","legendShape","gridVisibility","gridVisibilityProp","renderTooltip","options","orientation","horizontal","theme","useXYChartTheme","chartOptions","useBarChartOptions","defaultMargin","useChartMargin","legendRef","legendHeight","useElementHeight","renderDefaultTooltip","useCallback","tooltipData","nearestDatum","datum","_jsxs","jsxs","styles","children","_jsx","key","tooltip","labelFormatter","label","date","getTime","value","error","length","some","series","d","undefined","isNaN","validateData","clsx","legendItems","map","group","index","color","stroke","colors","shapeStyle","legendShapeStyle","role","style","XYChart","xScale","yScale","pointerEventsDataKey","Grid","columns","includes","rows","numTicks","BarGroup","padding","barGroup","seriesData","jsx","BarSeries","dataKey","yAccessor","accessors","xAccessor","Axis","axis","x","y","Tooltip","detectBounds","snapTooltip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yC,IAACc,aAAM,CACNC,MAAQvC,EACRrC,YAAcN,EACdJ,UAAY4B,EAAQ,qBACpB2D,MAAQlF,EACRmF,IAAMtE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t=require("
|
|
1
|
+
"use strict";var t=require("@automattic/number-formatters"),r=require("react");const e=t=>new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"});exports.useBarChartOptions=function(a,i,o={}){const c=r.useMemo((()=>{const r={type:"band",padding:.2,paddingInner:.1},i={type:"linear",nice:!0,zero:!1},o=a?.[0]?.data?.[0]?.label?t=>t:e,c=t.formatNumberCompact,s=t=>t?.label||t?.date,n=t=>t?.value;return{vertical:{xTickFormat:o,yTickFormat:c,tooltipLabelFormatter:o,xAccessor:s,yAccessor:n,gridVisibility:"x",xScale:r,yScale:i},horizontal:{xTickFormat:c,yTickFormat:o,tooltipLabelFormatter:o,xAccessor:n,yAccessor:s,gridVisibility:"y",xScale:i,yScale:r}}}),[a]);return r.useMemo((()=>{const t=i?"horizontal":"vertical",{xTickFormat:r,yTickFormat:e,tooltipLabelFormatter:a,xAccessor:s,yAccessor:n,gridVisibility:l,xScale:m,yScale:y}=c[t],x={...m,...o.xScale||{}},d={...y,...o.yScale||{}},u=i?o.axis?.y?.tickFormat:o.axis?.x?.tickFormat;return{gridVisibility:l,xScale:x,yScale:d,accessors:{xAccessor:s,yAccessor:n},axis:{x:{orientation:"bottom",numTicks:4,tickFormat:r,...o.axis?.x||{}},y:{orientation:"left",numTicks:4,tickFormat:e,...o.axis?.y||{}}},barGroup:{padding:(b=i?d:x,"number"==typeof b.paddingInner?b.paddingInner:0)},tooltip:{labelFormatter:u||a}};var b}),[c,o,i])};
|
|
2
2
|
//# sourceMappingURL=use-bar-chart-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-bar-chart-options.js","sources":["/@automattic/charts/../../../../src/components/bar-chart/use-bar-chart-options.ts"],"sourcesContent":[null],"names":["formatDateTick","timestamp","Date","toLocaleDateString","undefined","month","day","data","horizontal","options","defaultOptions","useMemo","bandScale","type","padding","paddingInner","linearScale","nice","zero","labelFormatter","label","valueFormatter","formatNumberCompact","labelAccessor","d","date","valueAccessor","value","vertical","xTickFormat","yTickFormat","tooltipLabelFormatter","xAccessor","yAccessor","gridVisibility","xScale","yScale","orientationKey","defaultTooltipLabelFormatter","baseXScale","baseYScale","providedToolTipLabelFormatter","axis","y","tickFormat","x","accessors","orientation","numTicks","barGroup","scale","tooltip"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-bar-chart-options.js","sources":["/@automattic/charts/../../../../src/components/bar-chart/use-bar-chart-options.ts"],"sourcesContent":[null],"names":["formatDateTick","timestamp","Date","toLocaleDateString","undefined","month","day","data","horizontal","options","defaultOptions","useMemo","bandScale","type","padding","paddingInner","linearScale","nice","zero","labelFormatter","label","valueFormatter","formatNumberCompact","labelAccessor","d","date","valueAccessor","value","vertical","xTickFormat","yTickFormat","tooltipLabelFormatter","xAccessor","yAccessor","gridVisibility","xScale","yScale","orientationKey","defaultTooltipLabelFormatter","baseXScale","baseYScale","providedToolTipLabelFormatter","axis","y","tickFormat","x","accessors","orientation","numTicks","barGroup","scale","tooltip"],"mappings":"+EAKA,MAAMA,EAAmBC,GACX,IAAIC,KAAMD,GACXE,wBAAoBC,EAAW,CAC1CC,MAAO,QACPC,IAAK,uCAsBD,SACLC,EACAC,EACAC,EAAuC,CAAA,GAEvC,MAAMC,EAAiBC,EAAAA,SAAS,KAC/B,MAAMC,EAAY,CACjBC,KAAM,OACNC,QAAS,GACTC,aAAc,IAETC,EAAc,CACnBH,KAAM,SACNI,MAAM,EACNC,MAAM,GAGDC,EAAiBZ,IAAQ,IAAKA,OAAQ,IAAKa,MAC5CA,GAAmBA,EACrBpB,EACGqB,EAAiBC,EAAAA,oBAEjBC,EAAkBC,GAAsBA,GAAGJ,OAASI,GAAGC,KACvDC,EAAkBF,GAAsBA,GAAGG,MAEjD,MAAO,CACNC,SAAU,CACTC,YAAaV,EACbW,YAAaT,EACbU,sBAAuBZ,EACvBa,UAAWT,EACXU,UAAWP,EACXQ,eAAgB,IAChBC,OAAQvB,EACRwB,OAAQpB,GAETR,WAAY,CACXqB,YAAaR,EACbS,YAAaX,EACbY,sBAAuBZ,EACvBa,UAAWN,EACXO,UAAWV,EACXW,eAAgB,IAChBC,OAAQnB,EACRoB,OAAQxB,MAGR,CAAEL,IAEL,OAAOI,EAAOA,SAAE,KACf,MAAM0B,EAAiB7B,EAAa,aAAe,YAC7CqB,YACLA,EAAWC,YACXA,EACAC,sBAAuBO,EAA4BN,UACnDA,EAASC,UACTA,EAASC,eACTA,EACAC,OAAQI,EACRH,OAAQI,GACL9B,EAAgB2B,GAEdF,EAAS,IAAKI,KAAiB9B,EAAQ0B,QAAU,CAAE,GACnDC,EAAS,IAAKI,KAAiB/B,EAAQ2B,QAAU,CAAE,GACnDK,EAAgCjC,EACnCC,EAAQiC,MAAMC,GAAGC,WACjBnC,EAAQiC,MAAMG,GAAGD,WAEpB,MAAO,CACNV,iBACAC,SACAC,SACAU,UAAW,CACVd,YACAC,aAEDS,KAAM,CACLG,EAAG,CACFE,YAAa,SACbC,SAAU,EACVJ,WAAYf,KACPpB,EAAQiC,MAAMG,GAAK,IAEzBF,EAAG,CACFI,YAAa,OACbC,SAAU,EACVJ,WAAYd,KACPrB,EAAQiC,MAAMC,GAAK,KAG1BM,SAAU,CACTnC,SAvGsBoC,EAuGI1C,EAAa4B,EAASD,EAtGd,iBAAvBe,EAAMnC,aAA8BmC,EAAMnC,aAA2B,IAwGjFoC,QAAS,CACRhC,eAAgBsB,GAAiCH,IA1G7B,IAAEY,IA6GtB,CAAExC,EAAgBD,EAASD,GAC/B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("@automattic/number-formatters"),r=require("@visx/group"),a=require("@visx/scale"),o=require("@visx/text"),n=require("react"),i=require("../bar-chart/bar-chart.js"),l=require("../shared/with-responsive.js");const s=e=>{const t=e;return t&&"bandwidth"in t?t?.bandwidth()??0:0},u=({textProps:t,x:r,y:a,label:n,formatter:i})=>e.jsx(o.Text,{...t,textAnchor:"start",x:r,y:a,children:i(n)}),d=({textProps:t,x:r,y:a,value:n,formatter:i})=>e.jsx(o.Text,{...t,textAnchor:"end",x:r,y:a,fontWeight:500,children:i(n)}),c=({ticks:t,tickLabelProps:a,yOffset:o,labelPosition:n,valuePosition:i,data:l,labelFormatter:s,valueFormatter:c,LabelComponent:m=u,ValueComponent:x=d})=>{if(0===t.length)return null;const p=t.map((({value:e,index:r})=>"function"==typeof a?a(e,r,t):{}));return t.map((({from:t,formattedValue:a},u)=>{const d=p[u]??{};delete d.textAnchor,delete d.dx;const b=l.reduce(((e,{data:t})=>e+(t[u]?.value??0)),0),h=t.y+o;return e.jsxs(r.Group,{children:[e.jsx(m,{textProps:d,x:n,y:h,label:a,formatter:s}),e.jsx(x,{textProps:d,x:i,y:h,value:b,formatter:c,data:l,index:u})]},u)}))},m=(e,t,r,o)=>{if(!o)return 0;const n=e.map((({label:e})=>e)),i=a.createScale({type:"band",range:[0,r],domain:n,...t}),l=a.scaleBand({domain:n,range:[0,s(i)],padding:t.paddingInner});return-(s(l)+6)};var x=l.withResponsive((({data:r,width:a,height:o,options:l={},margin:s={left:0,right:20,bottom:0,top:0},...u})=>{const d=n.useMemo((()=>{const e=r.length>1,n={...{paddingInner:e?.3:.1,padding:e?.3:.1},...l.yScale??{}};return{yScale:n,xScale:{zero:!0,...l.xScale??{}},labelPosition:l.labelPosition??(e?0:10),valueFormatter:l.valueFormatter??(e=>t.formatNumberCompact(e)),labelFormatter:l.labelFormatter??(e=>String(e)),valuePosition:l.valuePosition??a,yOffset:l.yOffset??m(r,n,o,e)}}),[l,a,r,o]);return e.jsx(i,{orientation:"horizontal",gridVisibility:"none",data:r,width:a,height:o,margin:s,options:{axis:{y:{children:t=>e.jsx(c,{...t,data:r,yOffset:d.yOffset,labelPosition:d.labelPosition,valuePosition:d.valuePosition,labelFormatter:d.labelFormatter,valueFormatter:d.valueFormatter,LabelComponent:l.labelComponent,ValueComponent:l.valueComponent})},x:{children:()=>null}},xScale:d.xScale,yScale:d.yScale},...u})}));module.exports=x;
|
|
2
2
|
//# sourceMappingURL=bar-list-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-list-chart.js","sources":["/@automattic/charts/../../../../src/components/bar-list-chart/bar-list-chart.tsx"],"sourcesContent":[null],"names":["getScaleBandwidth","scale","s","bandwidth","DefaultLabelComponent","textProps","x","y","label","formatter","_jsx","Text","textAnchor","children","DefaultValueComponent","value","fontWeight","AxisRenderer","ticks","tickLabelProps","yOffset","labelPosition","valuePosition","data","labelFormatter","valueFormatter","LabelComponent","ValueComponent","length","allTickLabelProps","map","index","from","formattedValue","dx","sum","reduce","acc","seriesData","_jsxs","Group","getDefaultYOffset","yScaleConfig","height","isMultiSeries","dataKeys","yScale","createScale","type","range","domain","groupScale","scaleBand","padding","paddingInner","withResponsive","width","options","margin","left","right","bottom","top","rest","chartOptions","useMemo","xScale","zero","formatNumberCompact","String","BarChart","orientation","gridVisibility","axis","renderProps","labelComponent","valueComponent"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bar-list-chart.js","sources":["/@automattic/charts/../../../../src/components/bar-list-chart/bar-list-chart.tsx"],"sourcesContent":[null],"names":["getScaleBandwidth","scale","s","bandwidth","DefaultLabelComponent","textProps","x","y","label","formatter","_jsx","Text","textAnchor","children","DefaultValueComponent","value","fontWeight","AxisRenderer","ticks","tickLabelProps","yOffset","labelPosition","valuePosition","data","labelFormatter","valueFormatter","LabelComponent","ValueComponent","length","allTickLabelProps","map","index","from","formattedValue","dx","sum","reduce","acc","seriesData","_jsxs","Group","getDefaultYOffset","yScaleConfig","height","isMultiSeries","dataKeys","yScale","createScale","type","range","domain","groupScale","scaleBand","padding","paddingInner","withResponsive","width","options","margin","left","right","bottom","top","rest","chartOptions","useMemo","xScale","zero","formatNumberCompact","String","BarChart","orientation","gridVisibility","axis","renderProps","labelComponent","valueComponent"],"mappings":"yQAqFA,MAAMA,EAAiDC,IAEtD,MAAMC,EAAID,EACV,OAAOC,GAAK,cAAeA,EAAIA,GAAGC,aAAe,EAAI,GAGhDC,EAAwB,EAAIC,YAAWC,IAAGC,IAAGC,QAAOC,eAExDC,EAAAA,IAACC,EAAAA,KAAU,IAAAN,EAAYO,WAAW,QAAQN,EAAIA,EAAIC,EAAIA,EACnDM,SAAAJ,EAAWD,KAKVM,EAAwB,EAAIT,YAAWC,IAAGC,IAAGQ,QAAON,eAExDC,EAAAA,IAACC,EAAAA,KAAI,IAAMN,EAAYO,WAAW,MAAMN,EAAIA,EAAIC,EAAIA,EAAIS,WAAa,IAAGH,SACrEJ,EAAWM,KAKVE,EAAe,EACpBC,QACAC,iBACAC,UACAC,gBACAC,gBACAC,OACAC,iBACAC,iBACAC,iBAAiBtB,EACjBuB,iBAAiBb,MAWjB,GAAsB,IAAjBI,EAAMU,OACV,OAAO,KAIR,MAAMC,EAAoBX,EAAMY,KAAK,EAAIf,QAAOgB,WACrB,mBAAnBZ,EAAgCA,EAAgBJ,EAAOgB,EAAOb,GAAU,CAAA,IAGhF,OAAOA,EAAMY,KAAK,EAAIE,OAAMC,kBAAkBF,KAC7C,MAAM1B,EAAYwB,EAAmBE,IAAW,CAAA,SAEzC1B,EAAUO,kBACVP,EAAU6B,GAEjB,MAAMC,EAAMZ,EAAKa,QAChB,CAAEC,GAAOd,KAAMe,KAAkBD,GAAQC,EAAYP,IAAShB,OAAS,IACvE,GAEKR,EAAIyB,EAAKzB,EAAIa,EAEnB,OACCmB,EAAAA,KAACC,EAAAA,MAAK,CAAA3B,SAAA,CACLH,MAACgB,EACA,CAAArB,UAAYA,EACZC,EAAIe,EACJd,EAAIA,EACJC,MAAQyB,EACRxB,UAAYe,IAEbd,EAAAA,IAACiB,EAAc,CACdtB,UAAYA,E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e,OAASA,EACTD,QAAU,CACTgB,KAAM,CACLlE,EAAG,CACFM,SAAY6D,GACXhE,EAAAA,IAACO,EACK,IAAAyD,EACLnD,KAAOA,EACPH,QAAU4C,EAAa5C,QACvBC,cAAgB2C,EAAa3C,cAC7BC,cAAgB0C,EAAa1C,cAC7BE,eAAiBwC,EAAaxC,eAC9BC,eAAiBuC,EAAavC,eAC9BC,eAAiB+B,EAAQkB,eACzBhD,eAAiB8B,EAAQmB,kBAI5BtE,EAAG,CACFO,SAAU,IAAM,OAGlBqD,OAAQF,EAAaE,OACrBpB,OAAQkB,EAAalB,WAEjBiB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/legend"),a=require("@visx/scale"),
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),l=require("@visx/legend"),a=require("@visx/scale"),r=require("clsx"),t=require("react"),i=require("../../providers/theme/theme-provider.js"),n=require("./legend.module.scss.js"),s=require("./utils.js");const d={horizontal:"row",vertical:"column"},o=t.forwardRef((({items:o,className:m,orientation:g="horizontal",shape:c="rect",fill:h=s.valueOrIdentityString,size:x=s.valueOrIdentityString,labelFormat:u=s.valueOrIdentity,labelTransform:p=s.labelTransformFactory,shapeWidth:b=16,shapeHeight:f=16,shapeMargin:v="2px 4px 2px 0",labelAlign:y="left",labelFlex:j="1",labelMargin:S="0 4px",itemMargin:q="0",itemDirection:L="row",legendLabelProps:I,...O},w)=>{const z=i.useChartTheme(),C=a.scaleOrdinal({domain:o.map((e=>e.label)),range:o.map((e=>e.color))}),F=C.domain(),N=t.useCallback((({index:e})=>o[e]?.shapeStyle??z.legendShapeStyles?.[e]??{}),[o,z]);return e.jsx(l.LegendOrdinal,{scale:C,labelFormat:u,labelTransform:p,children:a=>e.jsx("div",{ref:w,role:"list","data-testid":`legend-${g}`,className:r(n.legend,n[`legend--${g}`],m),style:{flexDirection:d[g],...z.legendContainerStyles},children:a.map(((a,r)=>e.jsxs(l.LegendItem,{className:n["legend-item"],"data-testid":"legend-item",margin:q,flexDirection:L,...O,children:[e.jsx(l.LegendShape,{shape:c,height:f,width:b,margin:v,item:F[r],itemIndex:r,label:a,fill:h,size:x,shapeStyle:N}),e.jsxs(l.LegendLabel,{style:{justifyContent:y,flex:j,margin:S,...z.legendLabelStyles},...I,children:[a.text,o.find((e=>e.label===a.text))?.value&&e.jsx("span",{className:n["legend-item-value"],children:o.find((e=>e.label===a.text))?.value})]})]},`legend-${a.text}-${r}`)))})})}));exports.BaseLegend=o;
|
|
2
2
|
//# sourceMappingURL=base-legend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-legend.js","sources":["/@automattic/charts/../../../../src/components/legend/base-legend.tsx"],"sourcesContent":[null],"names":["orientationToFlexDirection","horizontal","vertical","items","className","orientation","shape","fill","valueOrIdentityString","size","labelFormat","valueOrIdentity","labelTransform","labelTransformFactory","shapeWidth","shapeHeight","shapeMargin","labelAlign","labelFlex","labelMargin","itemMargin","itemDirection","legendLabelProps","legendItemProps","legendScale","scaleOrdinal","domain","map","item","label","range","color","getShapeStyle","useCallback","index","shapeStyle","_jsx","LegendOrdinal","scale","children","labels","jsx","role","clsx","styles","legend","style","flexDirection","
|
|
1
|
+
{"version":3,"file":"base-legend.js","sources":["/@automattic/charts/../../../../src/components/legend/base-legend.tsx"],"sourcesContent":[null],"names":["orientationToFlexDirection","horizontal","vertical","BaseLegend","forwardRef","items","className","orientation","shape","fill","valueOrIdentityString","size","labelFormat","valueOrIdentity","labelTransform","labelTransformFactory","shapeWidth","shapeHeight","shapeMargin","labelAlign","labelFlex","labelMargin","itemMargin","itemDirection","legendLabelProps","legendItemProps","ref","theme","useChartTheme","legendScale","scaleOrdinal","domain","map","item","label","range","color","getShapeStyle","useCallback","index","shapeStyle","legendShapeStyles","_jsx","LegendOrdinal","scale","children","labels","jsx","role","clsx","styles","legend","style","flexDirection","legendContainerStyles","i","_jsxs","LegendItem","margin","LegendShape","height","width","itemIndex","LegendLabel","justifyContent","flex","legendLabelStyles","text","find","value"],"mappings":"0PASA,MAAMA,EAA6B,CAClCC,WAAY,MACZC,SAAU,UAOEC,EAAaC,EAAUA,YACnC,EAEEC,QACAC,YACAC,cAAc,aACdC,QAAQ,OACRC,OAAOC,EAAAA,sBACPC,OAAOD,EAAqBA,sBAC5BE,cAAcC,kBACdC,iBAAiBC,EAAAA,sBACjBC,aAAa,GACbC,cAAc,GACdC,cAAc,gBACdC,aAAa,OACbC,YAAY,IACZC,cAAc,QACdC,aAAa,IACbC,gBAAgB,MAChBC,sBACGC,GAEJC,KAEA,MAAMC,EAAQC,EAAAA,gBACRC,EAAcC,EAAAA,aAAc,CACjCC,OAAQ1B,EAAM2B,KAAKC,GAAQA,EAAKC,QAChCC,MAAO9B,EAAM2B,KAAKC,GAAQA,EAAKG,UAE1BL,EAASF,EAAYE,SAErBM,EAAgBC,EAAAA,aACrB,EAAIC,WACIlC,EAAOkC,IAASC,YAAcb,EAAMc,oBAAqBF,IAAW,IAE5E,CAAElC,EAAOsB,IAGV,OACCe,EAAAA,IAACC,EAAAA,cACA,CAAAC,MAAQf,EACRjB,YAAcA,EACdE,eAAiBA,EAEf+B,SAAAC,GACDJ,EAAAK,IAAA,MAAA,CACCrB,IAAMA,EACNsB,KAAK,OACS,cAAA,UAAWzC,IACzBD,UAAY2C,EAAMC,EAAOC,OAAQD,EAAQ,WAAY3C,KAAkBD,GACvE8C,MAAQ,CACPC,cAAerD,EAA4BO,MACxCoB,EAAM2B,uBACTT,SAECC,EAAOd,KAAK,CAAEE,EAAOqB,IACtBC,EAAAA,KAACC,EAAUA,YACVnD,UAAY4C,EAAQ,eAAe,cACvB,cAEZQ,OAASpC,EACT+B,cAAgB9B,KACXE,YAELiB,MAACiB,EAAAA,aACAnD,MAAQA,EACRoD,OAAS3C,EACT4C,MAAQ7C,EACR0C,OAASxC,EACTe,KAAOF,EAAQwB,GACfO,UAAYP,EACZrB,MAAQA,EACRzB,KAAOA,EACPE,KAAOA,EACP6B,WAAaH,IAEdmB,EAAAA,KAACO,EAAWA,YAAA,CACXX,MAAQ,CACPY,eAAgB7C,EAChB8C,KAAM7C,EACNsC,OAAQrC,KACLM,EAAMuC,sBAEL1C,EAAgBqB,SAAA,CAEnBX,EAAMiC,KACN9D,EAAM+D,MAAMnC,GAAQA,EAAKC,QAAUA,EAAMiC,QAAQE,OAClD3B,MAAA,OAAA,CAAMpC,UAAY4C,EAAQ,qBACvBL,SAAAxC,EAAM+D,MAAMnC,GAAQA,EAAKC,QAAUA,EAAMiC,QAAQE,aA7BhD,UAAWnC,EAAMiC,QAAUZ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"value"in t&&void 0!==t.value?t.value:t}exports.labelTransformFactory=function({scale:t,labelFormat:e}){return(r,n)=>({datum:r,index:n,text:`${e(r,n)}`,value:t(r)})},exports.valueOrIdentity=t,exports.valueOrIdentityString=function(e){return String(t(e))};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["/@automattic/charts/../../../../src/components/legend/utils.ts"],"sourcesContent":[null],"names":["valueOrIdentity","_","value","scale","labelFormat","d","i","datum","index","text","String"],"mappings":"aAUM,SAAUA,EAAsBC,GACrC,OAAKA,GAAkB,iBAANA,GAAkB,UAAWA,QAAwB,IAAZA,EAAEC,MACpDD,EAAEC,MACHD,CACR,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["/@automattic/charts/../../../../src/components/legend/utils.ts"],"sourcesContent":[null],"names":["valueOrIdentity","_","value","scale","labelFormat","d","i","datum","index","text","String"],"mappings":"aAUM,SAAUA,EAAsBC,GACrC,OAAKA,GAAkB,iBAANA,GAAkB,UAAWA,QAAwB,IAAZA,EAAEC,MACpDD,EAAEC,MACHD,CACR,yCAkBmEE,MAClEA,EAAKC,YACLA,IAKA,MAAO,CAAEC,EAAGC,KAAS,CACpBC,MAAOF,EACPG,MAAOF,EACPG,KAAM,GAAIL,EAAaC,EAAGC,KAC1BJ,MAAOC,EAAOE,IAEhB,0DAxBM,SAAsCJ,GAC3C,OAAOS,OAAQV,EAAiBC,GACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react
|
|
1
|
+
"use strict";var e=require("react"),t=require("react/jsx-runtime"),a=require("@automattic/number-formatters"),r=require("@visx/curve"),i=require("@visx/gradient"),s=require("@visx/xychart"),n=require("clsx"),o=require("../../providers/theme/theme-provider.js"),l=require("../legend/base-legend.js"),c=require("../shared/date-parsing.js"),d=require("../shared/use-chart-margin.js"),u=require("../shared/use-element-height.js"),h=require("../shared/with-responsive.js"),m=require("./line-chart.module.scss.js");const p=a=>{const{theme:r}=e.useContext(s.DataContext)||{};return t.jsx("circle",{cx:a.x,cy:a.y,r:a.size,fill:a.color,stroke:r?.backgroundColor,strokeWidth:1.5,paintOrder:"fill","data-testid":`start-glyph-${a.index}`,...a.glyphStyle})},x=t=>e.createElement(p,{...t,key:t.key}),y=({data:t,index:a,color:r,glyphStyle:i,renderGlyph:n,accessors:o})=>{const{xScale:l,yScale:c}=e.useContext(s.DataContext)||{};if(!l||!c)return null;if(0===t.data.length)return null;const d=t.data[0],u=l(o.xAccessor(d)),h=c(o.yAccessor(d));if("number"!=typeof u||"number"!=typeof h)return null;const m=Number(i?.radius)||4;return n({key:`start-glyph-${t.label}`,index:a,datum:d,color:r,size:m,x:u,y:h,glyphStyle:i})},g=(e,t)=>{if(!e)return t?r.curveCatmullRom:r.curveLinear;switch(e){case"smooth":return r.curveCatmullRom;case"monotone":return r.curveMonotoneX;default:return r.curveLinear}},v=({tooltipData:e})=>{const a=e?.nearestDatum?.datum;if(!a)return null;const r=Object.entries(e?.datumByKey||{}).map((([e,{datum:t}])=>({key:e,value:t.value}))).sort(((e,t)=>t.value-e.value));return t.jsxs("div",{className:m["line-chart__tooltip"],children:[t.jsx("div",{className:m["line-chart__tooltip-date"],children:a.date?.toLocaleDateString()}),r.map((e=>t.jsxs("div",{className:m["line-chart__tooltip-row"],children:[t.jsxs("span",{className:m["line-chart__tooltip-label"],children:[e.key,":"]}),t.jsx("span",{className:m["line-chart__tooltip-value"],children:e.value})]},e.key)))]})},j=e=>new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"});var S=h.withResponsive((({data:r,width:h,height:p,className:S,margin:b,withTooltips:f=!0,showLegend:k=!1,legendOrientation:T="horizontal",legendShape:N="line",withGradientFill:w=!1,smoothing:q=!0,curveType:C,renderTooltip:D=v,withStartGlyphs:L=!1,options:_={},onPointerDown:P,onPointerUp:A,onPointerMove:M,onPointerOut:G})=>{const O=o.useChartTheme(),$=o.useXYChartTheme(r),z=e.useId(),[X,B]=u.useElementHeight(),E=e.useMemo((()=>r.map((e=>({...e,data:e.data.map((e=>({...e,date:e.date?e.date:c.parseAsLocalDate(e.dateString)}))).sort(((e,t)=>e.date.getTime()-t.date.getTime()))})))),[r]),F=e.useMemo((()=>({axis:{x:{orientation:"bottom",numTicks:Math.min(E[0]?.data.length,Math.ceil(h/100)),tickFormat:j,..._?.axis?.x},y:{orientation:"left",numTicks:4,tickFormat:a.formatNumberCompact,..._?.axis?.y}},xScale:{type:"time",..._?.xScale},yScale:{type:"linear",nice:!0,zero:!1,..._?.yScale}})),[_,E,h]),K=d.useChartMargin(p,F,E,$),R=(e=>e?.length?e.some((e=>e.data.some((e=>isNaN(e.value)||null===e.value||void 0===e.value||isNaN(e.date.getTime())))))?"Invalid data":null:"No data available")(E);if(R)return t.jsx("div",{className:n("line-chart",m["line-chart"]),children:R});const Y=E.map(((e,t)=>({label:e.label,value:"",color:e?.options?.stroke??O.colors[t%O.colors.length],shapeStyle:e?.options?.legendShapeStyle}))),I={xAccessor:e=>e?.date,yAccessor:e=>e?.value};return t.jsxs("div",{className:n("line-chart",m["line-chart"],S),"data-testid":"line-chart",role:"img","aria-label":"line chart",style:{width:h,height:p},children:[t.jsxs(s.XYChart,{theme:$,width:h,height:p-B,margin:{...K,...b},xScale:F.xScale,yScale:F.yScale,onPointerDown:P,onPointerUp:A,onPointerMove:M,onPointerOut:G,pointerEventsDataKey:"nearest",children:[t.jsx(s.Grid,{columns:!1,numTicks:4}),t.jsx(s.Axis,{...F.axis.x}),t.jsx(s.Axis,{...F.axis.y}),E.map(((e,a)=>{const r=e.options?.stroke??$.colors[a%$.colors.length],n=e.options?.seriesLineStyle??O?.seriesLineStyles?.[a%O.seriesLineStyles.length]??{};return t.jsxs("g",{children:[L&&t.jsx(y,{index:a,data:e,color:r,renderGlyph:x,accessors:I}),w&&t.jsx(i.LinearGradient,{id:`area-gradient-${z}-${a+1}`,from:r,fromOpacity:.4,toOpacity:.1,to:$.backgroundColor,...e.options?.gradient,"data-testid":"line-gradient"}),t.jsx(s.AreaSeries,{dataKey:e?.label,data:e.data,...I,fill:w?`url(#area-gradient-${z}-${a+1})`:"transparent",renderLine:!0,curve:g(C,q),lineProps:n},e?.label)]},e?.label||a)})),f&&t.jsx(s.Tooltip,{detectBounds:!0,snapTooltipToDatumX:!0,snapTooltipToDatumY:!0,showSeriesGlyphs:!0,renderTooltip:D})]}),k&&t.jsx(l.BaseLegend,{items:Y,orientation:T,className:m["line-chart-legend"],shape:N,ref:X})]})}));module.exports=S;
|
|
2
2
|
//# sourceMappingURL=line-chart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-chart.js","sources":["/@automattic/charts/../../../../src/components/line-chart/line-chart.tsx"],"sourcesContent":[null],"names":["getCurveType","type","smoothing","curveCatmullRom","curveLinear","curveMonotoneX","renderDefaultTooltip","tooltipData","nearestDatum","
|
|
1
|
+
{"version":3,"file":"line-chart.js","sources":["/@automattic/charts/../../../../src/components/line-chart/line-chart.tsx"],"sourcesContent":[null],"names":["DefaultGlyph","props","theme","useContext","DataContext","_jsx","cx","x","cy","y","r","size","fill","color","stroke","backgroundColor","strokeWidth","paintOrder","index","glyphStyle","defaultRenderGlyph","_createElement","createElement","key","StartGlyph","data","renderGlyph","accessors","xScale","yScale","length","firstPoint","xAccessor","yAccessor","Number","radius","label","datum","getCurveType","type","smoothing","curveCatmullRom","curveLinear","curveMonotoneX","renderDefaultTooltip","tooltipData","nearestDatum","tooltipPoints","Object","entries","datumByKey","map","value","sort","a","b","_jsxs","jsxs","className","styles","children","date","toLocaleDateString","point","formatDateTick","timestamp","Date","undefined","month","day","withResponsive","width","height","margin","withTooltips","showLegend","legendOrientation","legendShape","withGradientFill","curveType","renderTooltip","withStartGlyphs","options","onPointerDown","onPointerUp","onPointerMove","onPointerOut","providerTheme","useChartTheme","useXYChartTheme","chartId","useId","legendRef","legendHeight","useElementHeight","dataSorted","useMemo","series","parseAsLocalDate","dateString","getTime","chartOptions","axis","orientation","numTicks","Math","min","ceil","tickFormat","formatNumberCompact","nice","zero","defaultMargin","useChartMargin","error","some","isNaN","validateData","clsx","legendItems","group","colors","shapeStyle","legendShapeStyle","d","role","style","XYChart","pointerEventsDataKey","jsx","Grid","columns","Axis","seriesData","lineProps","seriesLineStyle","seriesLineStyles","LinearGradient","id","from","fromOpacity","toOpacity","to","gradient","AreaSeries","dataKey","renderLine","curve","Tooltip","detectBounds","snapTooltipToDatumX","snapTooltipToDatumY","showSeriesGlyphs","Legend","BaseLegend","items","shape","ref"],"mappings":"6fAqBA,MAMMA,EAAyCC,IAC9C,MAAMC,MAAEA,GAAUC,EAAUA,WAAEC,EAAWA,cAAM,CAAA,EAE/C,OACCC,EAAAA,cACCC,GAAKL,EAAMM,EACXC,GAAKP,EAAMQ,EACXC,EAAIT,EAAMU,KACVC,KAAOX,EAAMY,MACbC,OAASZ,GAAOa,gBAChBC,YAAc,IACdC,WAAW,qBACG,eAAgBhB,EAAMiB,WAC/BjB,EAAMkB,cAKRC,EACLnB,GAEOoB,EAAAC,cAACtB,EAAY,IAAMC,EAAQsB,IAAMtB,EAAMsB,MAGzCC,EAUA,EAAIC,OAAMP,QAAOL,QAAOM,aAAYO,cAAa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F,IAE3BsF,EAAW5C,KAAK,CAAEkF,EAAYnH,KAC/B,MAAMJ,EAASuH,EAAWnD,SAASpE,QAAUZ,EAAMuH,OAAQvG,EAAQhB,EAAMuH,OAAO3F,QAC1EwG,EACLD,EAAWnD,SAASqD,iBACpBhD,GAAeiD,mBAAoBtH,EAAQqE,EAAciD,iBAAiB1G,SAC1E,GACD,OACC0B,sBACGyB,GACD5E,EAAAA,IAACmB,GACAN,MAAQA,EACRO,KAAO4G,EACPxH,MAAQC,EACRY,YAAcN,EACdO,UAAYA,IAIZmD,GACDzE,EAAAA,IAACoI,EAAcA,eACd,CAAAC,GAAK,iBAAkBhD,KAAaxE,EAAQ,IAC5CyH,KAAO7H,EACP8H,YAAc,GACdC,UAAY,GACZC,GAAK5I,EAAMa,mBACNsH,EAAWnD,SAAS6D,SAAQ,cACrB,kBAGd1I,EAAAA,IAAC2I,EAAAA,YAEAC,QAAUZ,GAAYjG,MACtBX,KAAO4G,EAAW5G,QACbE,EACLf,KACCkE,EACG,sBAAuBY,KAAaxE,EAAQ,KAC5C,cAEJgI,YAAa,EACbC,MAAQ7G,EAAcyC,EAAWvC,GACjC8F,UAAYA,GAXND,GAAYjG,SAvBXiG,GAAYjG,OAASlB,MAwC9BwD,GACDrE,MAAC+I,EAAAA,QAAO,CACPC,cAAY,EACZC,qBAAmB,EACnBC,qBACA,EAAAC,kBACA,EAAAxE,cAAgBA,OAKjBL,GACDtE,EAAA4H,IAACwB,EAAMC,WACN,CAAAC,MAAQpC,EACRhB,YAAc3B,EACdlB,UAAYC,EAAQ,qBACpBiG,MAAQ/E,EACRgF,IAAMjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-chart/pie-chart.tsx"],"sourcesContent":[null],"names":["PieChart","data","withTooltips","className","showLegend","legendOrientation","legendShape","size","thickness","padding","gapScale","cornerScale","children","providerTheme","useChartTheme","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","useChartMouseHandler","isValid","message","length","some","item","percentage","value","totalPercentage","reduce","sum","Math","abs","validateData","_jsx","jsx","clsx","styles","width","height","radius","min","centerX","centerY","padAngle","PI","outerRadius","innerRadius","maxCornerRadius","cornerRadius","dataWithIndex","map","d","index","accessors","fill","color","colors","legendItems","label","toString","_jsxs","viewBox","preserveAspectRatio","Group","top","left","Pie","pieValue","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","event","pathProps","jsxs","x","y","dy","labelBackgroundColor","defaultTheme","fontSize","textAnchor","pointerEvents","Legend","items","orientation","shape","BaseTooltip","style","transform","displayName","withResponsive"],"mappings":"0aAuDA,MA2BMA,EAAW,EAChBC,OACAC,gBAAe,EACfC,YACAC,aACAC,oBACAC,cAAc,SACdC,OACAC,YAAY,EACZC,UAAU,GACVC,WAAW,EACXC,cAAc,EACdC,WAAW,SAEX,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,aAAEA,EAAYC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,GACzEC,EAAsB,CACrBnB,kBAGIoB,QAAEA,EAAOC,QAAEA,GA/CG,CAAEtB,IACtB,IAAOA,EAAKuB,OACX,MAAO,CAAEF,SAAS,EAAOC,QAAS,qBAKnC,GAD0BtB,EAAKwB,MAAMC,GAAQA,EAAKC,WAAa,GAAKD,EAAKE,MAAQ,IAEhF,MAAO,CAAEN,SAAS,EAAOC,QAAS,iDAInC,MAAMM,EAAkB5B,EAAK6B,QAAQ,CAAEC,EAAKL,IAAUK,EAAML,EAAKC,YAAY,GAC7E,OAAKK,KAAKC,IAAKJ,EAAkB,KAAQ,IAEjC,CAAEP,SAAS,EAAOC,QAAS,4CAG5B,CAAED,SAAS,EAAMC,QAAS,
|
|
1
|
+
{"version":3,"file":"pie-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-chart/pie-chart.tsx"],"sourcesContent":[null],"names":["PieChart","data","withTooltips","className","showLegend","legendOrientation","legendShape","size","thickness","padding","gapScale","cornerScale","children","providerTheme","useChartTheme","onMouseMove","onMouseLeave","tooltipOpen","tooltipData","tooltipLeft","tooltipTop","useChartMouseHandler","isValid","message","length","some","item","percentage","value","totalPercentage","reduce","sum","Math","abs","validateData","_jsx","jsx","clsx","styles","width","height","radius","min","centerX","centerY","padAngle","PI","outerRadius","innerRadius","maxCornerRadius","cornerRadius","dataWithIndex","map","d","index","accessors","fill","color","colors","legendItems","label","toString","_jsxs","viewBox","preserveAspectRatio","Group","top","left","Pie","pieValue","pie","arcs","arc","centroidX","centroidY","path","centroid","hasSpaceForLabel","endAngle","startAngle","handleMouseMove","event","pathProps","jsxs","x","y","dy","labelBackgroundColor","defaultTheme","fontSize","textAnchor","pointerEvents","Legend","items","orientation","shape","BaseTooltip","style","transform","displayName","withResponsive"],"mappings":"0aAuDA,MA2BMA,EAAW,EAChBC,OACAC,gBAAe,EACfC,YACAC,aACAC,oBACAC,cAAc,SACdC,OACAC,YAAY,EACZC,UAAU,GACVC,WAAW,EACXC,cAAc,EACdC,WAAW,SAEX,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,aAAEA,EAAYC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,GACzEC,EAAsB,CACrBnB,kBAGIoB,QAAEA,EAAOC,QAAEA,GA/CG,CAAEtB,IACtB,IAAOA,EAAKuB,OACX,MAAO,CAAEF,SAAS,EAAOC,QAAS,qBAKnC,GAD0BtB,EAAKwB,MAAMC,GAAQA,EAAKC,WAAa,GAAKD,EAAKE,MAAQ,IAEhF,MAAO,CAAEN,SAAS,EAAOC,QAAS,iDAInC,MAAMM,EAAkB5B,EAAK6B,QAAQ,CAAEC,EAAKL,IAAUK,EAAML,EAAKC,YAAY,GAC7E,OAAKK,KAAKC,IAAKJ,EAAkB,KAAQ,IAEjC,CAAEP,SAAS,EAAOC,QAAS,4CAG5B,CAAED,SAAS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,EACXK,aAAeA,EAEbtC,SAAA0D,GACMA,EAAIC,KAAKnB,KAAK,CAAEoB,EAAKlB,KAC3B,MAAQmB,EAAWC,GAAcJ,EAAIK,KAAKC,SAAUJ,GAC9CK,EAAmBL,EAAIM,SAAWN,EAAIO,YAAc,IACpDC,EAAoBC,GACzBlE,EAAakE,EAAOT,EAAIvE,MAEnBiF,EAAwC,CAC7C7B,EAAGiB,EAAIK,KAAMH,IAAS,GACtBhB,KAAMD,EAAUC,KAAMgB,EAAIvE,OAQ3B,OALKC,IACJgF,EAAUnE,YAAciE,EACxBE,EAAUlE,aAAeA,GAIzB8C,EACCqB,KAAA,IAAA,CAAAvE,SAAA,CAAAuB,EAAAA,IAAA,OAAA,IAAW+C,IACTL,GACD1C,MACC,OAAA,CAAAiD,EAAIX,EACJY,EAAIX,EACJY,GAAG,QACH9B,KACC3C,EAAc0E,sBAAwBC,EAAAA,aAAaD,qBAEpDE,SAAW,GACXC,WAAW,SACXC,cAAc,OAEZ/E,SAAA4D,EAAIvE,KAAK2D,UAdL,OAAQN,UAuBnB1C,OAIFR,GACD+B,MAACyD,EAAAA,WAAM,CACNC,MAAQlC,EACRmC,YAAczF,EACdF,UAAYmC,EAAQ,oBACpByD,MAAQzF,IAIRJ,GAAgBe,GAAeC,GAChCiB,EAAAA,IAAC6D,EAAAA,YACA,CAAA/F,KAAOiB,EACPgD,IAAM9C,GAAc,EACpB+C,KAAOhD,GAAe,EACtB8E,MAAQ,CACPC,UAAW,gCAQjBlG,EAASmG,YAAc,WACvB,IAAeC,EAAAA,EAAAA,eAAiCpG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-semi-circle-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx"],"sourcesContent":[null],"names":["PieSemiCircleChart","data","width","thickness","clockwise","withTooltips","showLegend","legendOrientation","legendShape","label","note","className","providerTheme","useChartTheme","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","isValid","message","length","some","item","percentage","value","reduce","sum","validateData","_jsx","styles","children","height","jsx","textAnchor","error","pad","chartWidth","chartHeight","radius","Math","min","innerRadius","dataWithIndex","map","d","index","startAngle","PI","endAngle","accessors","sort","a","b","fill","color","colors","legendItems","valueDisplay","toString","_jsxs","clsx","viewBox","Group","top","left","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","verticalAnchor","BaseTooltip","Legend","items","orientation","shape","displayName","withResponsive"],"mappings":"obAmDA,MAoBMA,EAAoD,EACzDC,OACAC,QAAQ,IACRC,YAAY,GACZC,aAAY,EACZC,gBAAe,EACfC,cAAa,EACbC,oBAAoB,aACpBC,cAAc,SACdC,QACAC,OACAC,gBAEA,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GACvEC,EAAAA,aAEKC,EAAkBC,EAAAA,aACvB,CAAEC,EAAyBC,KAC1B,MAAMC,EAASC,aAAYH,GACpBE,GAEPN,EAAa,CACZF,YAAaO,EAAIvB,KACjBc,YAAaU,EAAOE,EACpBX,WAAYS,EAAOG,EAAI,
|
|
1
|
+
{"version":3,"file":"pie-semi-circle-chart.js","sources":["/@automattic/charts/../../../../src/components/pie-semi-circle-chart/pie-semi-circle-chart.tsx"],"sourcesContent":[null],"names":["PieSemiCircleChart","data","width","thickness","clockwise","withTooltips","showLegend","legendOrientation","legendShape","label","note","className","providerTheme","useChartTheme","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","handleMouseMove","useCallback","event","arc","coords","localPoint","x","y","handleMouseLeave","handleArcMouseMove","isValid","message","length","some","item","percentage","value","reduce","sum","validateData","_jsx","styles","children","height","jsx","textAnchor","error","pad","chartWidth","chartHeight","radius","Math","min","innerRadius","dataWithIndex","map","d","index","startAngle","PI","endAngle","accessors","sort","a","b","fill","color","colors","legendItems","valueDisplay","toString","_jsxs","clsx","viewBox","Group","top","left","Pie","pieValue","outerRadius","cornerRadius","padAngle","pieSort","pie","arcs","onMouseMove","onMouseLeave","path","Text","verticalAnchor","BaseTooltip","Legend","items","orientation","shape","displayName","withResponsive"],"mappings":"obAmDA,MAoBMA,EAAoD,EACzDC,OACAC,QAAQ,IACRC,YAAY,GACZC,aAAY,EACZC,gBAAe,EACfC,cAAa,EACbC,oBAAoB,aACpBC,cAAc,SACdC,QACAC,OACAC,gBAEA,MAAMC,EAAgBC,EAAAA,iBAChBC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GACvEC,EAAAA,aAEKC,EAAkBC,EAAAA,aACvB,CAAEC,EAAyBC,KAC1B,MAAMC,EAASC,aAAYH,GACpBE,GAEPN,EAAa,CACZF,YAAaO,EAAIvB,KACjBc,YAAaU,EAAOE,EACpBX,WAAYS,EAAOG,EAAI,OAGzB,CAAET,IAGGU,EAAmBP,EAAAA,aAAa,KACrCJ,MACE,CAAEA,IAECY,EAAqBR,EAAWA,aACnCE,GAAoBD,IACrBF,EAAiBE,EAAOC,KAEzB,CAAEH,KAIGU,QAAEA,EAAOC,QAAEA,GA/DG,CAAE/B,GACfA,EAAKgC,OAKchC,EAAKiC,MAAMC,GAAQA,EAAKC,WAAa,GAAKD,EAAKE,MAAQ,IAEzE,CAAEN,SAAS,EAAOC,QAAS,iDAIX/B,EAAKqC,QAAQ,CAAEC,EAAKJ,IAAUI,EAAMJ,EAAKC,YAAY,IACrD,EAChB,CAAEL,SAAS,EAAOC,QAAS,oDAG5B,CAAED,SAAS,EAAMC,QAAS,IAfzB,CAAED,SAAS,EAAOC,QAAS,qBA6DNQ,CAAcvC,GAE3C,IAAO8B,EACN,OACCU,EAAAA,WAAK9B,UAAY+B,EAA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AAGA,IACH,CAAA7E,KAAOsD,EACPwB,SAAWjB,EAAUzB,MACrB2C,YAAc7B,EACdG,YAAcA,EACd2B,aAAe,EACfC,SAAWlC,EACXW,WAAaA,EACbE,SAAWA,EACXsB,QAAUrB,EAAUC,KAAIpB,SAEtByC,GACMA,EAAIC,KAAK7B,KAAKhC,GACpBiB,EAECI,IAAA,IAAA,CAAAyC,YAAcxD,EAAoBN,GAClC+D,aAAe1D,EAEfc,SAAAF,EAAAI,IAAA,OAAA,CACCY,EAAI2B,EAAII,KAAMhE,IAAS,GACvB0C,KAAOJ,EAAUI,KAAM1C,EAAIvB,MACf,cAAA,iBAPPuB,EAAIvB,KAAKQ,WAcnB+D,OAACG,EAAAA,iBACAlC,EAAAA,IAACgD,EAAIA,KACJ,CAAA3C,WAAW,SACX4C,eAAe,QACf9D,GAAK,GACLjB,UAAY+B,EAAOjC,MAAKkC,SAEtBlC,IAEHgC,EAAAA,IAACgD,EAAIA,KACJ,CAAA3C,WAAW,SACX4C,eAAe,QACf9D,GAAK,GACLjB,UAAY+B,EAAOhC,KAAIiC,SAErBjC,YAMJL,GAAgBS,GAAeG,GAChCwB,EAAAI,IAAC8C,cAAW,CACX1F,KAAO,CACNQ,MAAOQ,EAAYR,MACnB4B,MAAOpB,EAAYoB,MACnBiC,aAAcrD,EAAYqD,cAE3BM,IAAM5D,GAAc,EACpB6D,KAAO9D,GAAe,IAItBT,GACDmC,EAAAA,IAACmD,EAAAA,WACA,CAAAC,MAAQxB,EACRyB,YAAcvF,EACdI,UAAY+B,EAAQ,gCACpBqD,MAAQvF,QAObR,EAAmBgG,YAAc,qBACjC,IAAeC,EAAAA,EAAAA,eAA2CjG"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var y=require("date-fns");exports.parseAsLocalDate=s=>{const e=s.trim();if((y=>/T.*[Z]$|T.*[+-]\d{2}:?\d{2}$/.test(y))(e)){const s=y.parseISO(e);return y.isValid(s)?s:new Date(NaN)}const t=["yyyy-MM-dd","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd'T'HH:mm:ss.SSS","yyyy-MM-dd'T'HH:mm"];for(const s of t){const t=y.parse(e,s,new Date);if(y.isValid(t))return t}return new Date(NaN)};
|
|
2
|
+
//# sourceMappingURL=date-parsing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-parsing.js","sources":["/@automattic/charts/../../../../src/components/shared/date-parsing.ts"],"sourcesContent":[null],"names":["dateString","trimmedString","trim","test","hasTimezone","isoDate","parseISO","isValid","Date","NaN","formats","format","result","parse"],"mappings":"gEAoEkCA,IACjC,MAAMC,EAAgBD,EAAWE,OAGjC,GA3BmB,CAAEF,GACd,+BAA+BG,KAAMH,GA0BvCI,CAAaH,GAAkB,CACnC,MAAMI,EAAUC,WAAUL,GAE1B,OAAOM,EAAAA,QAASF,GAKTA,EAJC,IAAIG,KAAMC,IAKlB,CAGD,MAAMC,EAAU,CACf,aACA,sBACA,mBACA,wBACA,4BACA,sBAGD,IAAM,MAAMC,KAAUD,EAAU,CAC/B,MAAME,EAASC,EAAAA,MAAOZ,EAAeU,EAAQ,IAAIH,MACjD,GAAKD,EAAAA,QAASK,GACb,OAAOA,CAER,CAGD,OAAO,IAAIJ,KAAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chart-margin.js","sources":["/@automattic/charts/../../../../src/components/shared/use-chart-margin.tsx"],"sourcesContent":[null],"names":["height","options","data","theme","horizontal","yTicks","useMemo","allDataPoints","flatMap","series","map","d","label","axis","y","tickFormat","date","getTime","minY","Math","min","value","maxY","max","yScale","createScale","domain","range","getTicks","numTicks","defaultMargin","top","right","bottom","left","yAxisOrientation","orientation","yAxisStyles","axisStyles","yMarginValue","getLongestTickWidth","axisLabel","tickLength","x"],"mappings":"4GAM8B,CAC7BA,EACAC,EACAC,EACAC,EACAC,GAAsB,KAEtB,MAAMC,EAASC,EAAAA,SAAS,KACvB,MAAMC,EAAgBL,EAAKM,SAASC,GAAUA,EAAOP,OAErD,GAAKE,EAEJ,OAAOG,EAAcG,KACpBC,GAAKA,EAAEC,OAASX,EAAQY,MAAMC,GAAGC,WAAYJ,EAAEK,KAAKC,UAAW,EAAG,MAIpE,MAAMC,EAAOC,KAAKC,OAAQb,EAAcG,KAAKC,GAAKA,EAAEU,SAC9CC,EAAOH,KAAKI,OAAQhB,EAAcG,KAAKC,GAAKA,EAAEU,SAC9CG,EAASC,EAAAA,YAAa,IACxBxB,EAAQuB,OACXE,OAAQ,CAAER,EAAMI,GAChBK,MAAO,CAAE3B,EAAQ,KAGlB,OAAO4B,EAAAA,SAAUJ,EAAQvB,EAAQY,MAAMC,GAAGe,
|
|
1
|
+
{"version":3,"file":"use-chart-margin.js","sources":["/@automattic/charts/../../../../src/components/shared/use-chart-margin.tsx"],"sourcesContent":[null],"names":["height","options","data","theme","horizontal","yTicks","useMemo","allDataPoints","flatMap","series","map","d","label","axis","y","tickFormat","date","getTime","minY","Math","min","value","maxY","max","yScale","createScale","domain","range","getTicks","numTicks","defaultMargin","top","right","bottom","left","yAxisOrientation","orientation","yAxisStyles","axisStyles","yMarginValue","getLongestTickWidth","axisLabel","tickLength","x"],"mappings":"4GAM8B,CAC7BA,EACAC,EACAC,EACAC,EACAC,GAAsB,KAEtB,MAAMC,EAASC,EAAAA,SAAS,KACvB,MAAMC,EAAgBL,EAAKM,SAASC,GAAUA,EAAOP,OAErD,GAAKE,EAEJ,OAAOG,EAAcG,KACpBC,GAAKA,EAAEC,OAASX,EAAQY,MAAMC,GAAGC,WAAYJ,EAAEK,KAAKC,UAAW,EAAG,MAIpE,MAAMC,EAAOC,KAAKC,OAAQb,EAAcG,KAAKC,GAAKA,EAAEU,SAC9CC,EAAOH,KAAKI,OAAQhB,EAAcG,KAAKC,GAAKA,EAAEU,SAC9CG,EAASC,EAAAA,YAAa,IACxBxB,EAAQuB,OACXE,OAAQ,CAAER,EAAMI,GAChBK,MAAO,CAAE3B,EAAQ,KAGlB,OAAO4B,EAAAA,SAAUJ,EAAQvB,EAAQY,MAAMC,GAAGe,YACxC,CAAE5B,EAASC,EAAMF,EAAQI,IAE5B,OAAOE,EAAOA,SAAE,KAEf,MAAMwB,EAAgB,CAAEC,IAAK,GAAIC,MAAO,GAAIC,OAAQ,GAAIC,KAAM,IAIxDC,EAAmBlC,EAAQY,MAAMC,GAAGsB,YACpCC,EACgB,UAArBF,EAA+BhC,EAAMmC,WAAWxB,EAAEkB,MAAQ7B,EAAMmC,WAAWxB,EAAEoB,KAMxEK,GALaC,sBAClBnC,EACAJ,EAAQY,MAAMC,GAAGC,WACjBsB,EAAYI,YATY,KAWmCJ,GAAaK,YAAc,GAavF,MAX0B,UAArBP,EACJL,EAAcE,MAAQO,EAEtBT,EAAcI,KAAOK,EAGgB,QAAjCtC,EAAQY,MAAM8B,GAAGP,cACrBN,EAAcC,IAAM,GACpBD,EAAcG,OAAS,IAGjBH,IACL,CAAE7B,EAASE,EAAOE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react");exports.useElementHeight=function({initialHeight:t=0}={}){const n=e.useRef(null),[r,u]=e.useState(t);return e.useLayoutEffect((()=>{if(!n.current)return;const e=()=>{u(n.current?.getBoundingClientRect().height||0)};e();const t=new window.ResizeObserver(e);return t.observe(n.current),()=>{t.disconnect()}}),[]),[n,r]};
|
|
2
|
+
//# sourceMappingURL=use-element-height.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-element-height.js","sources":["/@automattic/charts/../../../../src/components/shared/use-element-height.ts"],"sourcesContent":[null],"names":["initialHeight","ref","useRef","height","setHeight","useState","useLayoutEffect","current","handleResize","getBoundingClientRect","resizeObserver","window","ResizeObserver","observe","disconnect"],"mappings":"6DAWM,UAAsEA,cAC3EA,EAAgB,GAGb,CAAA,GACH,MAAMC,EAAMC,SAAa,OACjBC,EAAQC,GAAcC,EAAQA,SAAEL,GAmBxC,OAjBAM,EAAAA,iBAAiB,KAChB,IAAOL,EAAIM,QAAU,OAErB,MAAMC,EAAe,KACpBJ,EAAWH,EAAIM,SAASE,wBAAwBN,QAAU,IAG3DK,IAEA,MAAME,EAAiB,IAAIC,OAAOC,eAAgBJ,GAGlD,OAFAE,EAAeG,QAASZ,EAAIM,SAErB,KACNG,EAAeI,gBAEd,IAEI,CAAEb,EAAKE,EACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["/@automattic/charts/../../../../src/components/shared/utils.ts"],"sourcesContent":[null],"names":["ticks","formatTick","labelStyle","formattedTicks","map","tick","longestTick","reduce","longest","current","length","getStringWidth"],"mappings":"qEAYmC,CAClCA,EACAC,EACAC,KAEA,MAAMC,EAAiBH,EAAMI,KAAKC,GAAQJ,EAAYI,EAAM,EAAG,MACzDC,EAAcH,EAAeI,QAClC,CAAEC,EAASC,IAAeD,EAAQE,QAAUD,EAAQC,OAASF,EAAUC,GACvEN,EAAgB,IAGjB,OAAOQ,EAAcA,eAAEL,EAAaJ
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["/@automattic/charts/../../../../src/components/shared/utils.ts"],"sourcesContent":[null],"names":["ticks","formatTick","labelStyle","formattedTicks","map","tick","longestTick","reduce","longest","current","length","getStringWidth"],"mappings":"qEAYmC,CAClCA,EACAC,EACAC,KAEA,MAAMC,EAAiBH,EAAMI,KAAKC,GAAQJ,EAAYI,EAAM,EAAG,MACzDC,EAAcH,EAAeI,QAClC,CAAEC,EAASC,IAAeD,EAAQE,QAAUD,EAAQC,OAASF,EAAUC,GACvEN,EAAgB,IAGjB,OAAOQ,EAAcA,eAAEL,EAAaJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("@visx/responsive");exports.withResponsive=function(
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("@visx/responsive");const t={width:600,height:400};exports.withResponsive=function(n){return function({resizeDebounceTime:r=300,maxWidth:s=1200,aspectRatio:h=.5,...a}){const{parentRef:c,width:o,height:u}=(({resizeDebounceTime:e=300,maxWidth:n=1200,aspectRatio:r=.5})=>{const{parentRef:s,width:h}=i.useParentSize({debounceTime:e,enableDebounceLeadingCall:!0,initialSize:t}),a=h?Math.min(h,n):t.width;return{parentRef:s,width:a,height:a*r}})({resizeDebounceTime:r,maxWidth:s,aspectRatio:h});return e.jsx("div",{ref:c,style:{width:"100%"},children:e.jsx(n,{width:o,height:u,size:o,...a})})}};
|
|
2
2
|
//# sourceMappingURL=with-responsive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-responsive.js","sources":["/@automattic/charts/../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null],"names":["WrappedComponent","
|
|
1
|
+
{"version":3,"file":"with-responsive.js","sources":["/@automattic/charts/../../../../src/components/shared/with-responsive.tsx"],"sourcesContent":[null],"names":["DEFAULT_INITIAL_SIZE","width","height","WrappedComponent","resizeDebounceTime","maxWidth","aspectRatio","chartProps","parentRef","containerWidth","containerHeight","parentWidth","useParentSize","debounceTime","enableDebounceLeadingCall","initialSize","Math","min","useResponsiveDimensions","_jsx","jsx","ref","style","children","size"],"mappings":"8EAmBA,MAAMA,EAAuB,CAAEC,MAAO,IAAKC,OAAQ,4BA6B7C,SACLC,GAEA,OAAO,UAA0BC,mBAChCA,EAAqB,IAAGC,SACxBA,EAAW,KAAIC,YACfA,EAAc,MACXC,IAEH,MAAMC,UACLA,EACAP,MAAOQ,EACPP,OAAQQ,GAvCqB,GAC/BN,qBAAqB,IACrBC,WAAW,KACXC,cAAc,OAEd,MAAME,UAAEA,EAAWP,MAAOU,GAAgBC,EAAAA,cAAe,CACxDC,aAAcT,EACdU,2BAA2B,EAC3BC,YAAaf,IAIRS,EAAiBE,EACpBK,KAAKC,IAAKN,EAAaN,GACvBL,EAAqBC,MAGxB,MAAO,CAAEO,YAAWP,MAAOQ,EAAgBP,OAFnBO,EAAiBH,IAyBpCY,CAAyB,CAC5Bd,qBACAC,WACAC,gBAGD,OACCa,EACCC,IAAA,MAAA,CAAAC,IAAMb,EACNc,MAAQ,CACPrB,MAAO,QACPsB,SAEDJ,MAAChB,EAAgB,CAChBF,MAAQQ,EACRP,OAASQ,EACTc,KAAOf,KACAF,KAIX,CACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chart-mouse-handler.js","sources":["/@automattic/charts/../../../src/hooks/use-chart-mouse-handler.ts"],"sourcesContent":[null],"names":["withTooltips","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","onMouseMove","useCallback","event","data","coords","localPoint","x","y","onMouseLeave"],"mappings":"uGA6C6B,EAC5BA,mBAEA,MAAMC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GACvEC,EAAAA,aA8BD,MAAO,CACNC,YA5BmBC,EAAAA,aACnB,CAAEC,EAAiCC,KAClC,IAAOX,EACN,OAGD,MAAMY,EAASC,aAAYH,GACpBE,GAIPN,EAAa,CACZF,YAAaO,EACbT,YAAaU,EAAOE,EACpBX,WAAYS,EAAOG,EAAI,
|
|
1
|
+
{"version":3,"file":"use-chart-mouse-handler.js","sources":["/@automattic/charts/../../../src/hooks/use-chart-mouse-handler.ts"],"sourcesContent":[null],"names":["withTooltips","tooltipOpen","tooltipLeft","tooltipTop","tooltipData","hideTooltip","showTooltip","useTooltip","onMouseMove","useCallback","event","data","coords","localPoint","x","y","onMouseLeave"],"mappings":"uGA6C6B,EAC5BA,mBAEA,MAAMC,YAAEA,EAAWC,YAAEA,EAAWC,WAAEA,EAAUC,YAAEA,EAAWC,YAAEA,EAAWC,YAAEA,GACvEC,EAAAA,aA8BD,MAAO,CACNC,YA5BmBC,EAAAA,aACnB,CAAEC,EAAiCC,KAClC,IAAOX,EACN,OAGD,MAAMY,EAASC,aAAYH,GACpBE,GAIPN,EAAa,CACZF,YAAaO,EACbT,YAAaU,EAAOE,EACpBX,WAAYS,EAAOG,EAAI,OAGzB,CAAEf,EAAcM,IAYhBU,aAToBP,EAAAA,aAAa,KAC1BT,GAGPK,MACE,CAAEL,EAAcK,IAKlBJ,cACAG,YAAaA,GAAe,KAC5BF,cACAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-provider.js","sources":["/@automattic/charts/../../../../src/providers/theme/theme-provider.tsx"],"sourcesContent":[null],"names":["ThemeContext","createContext","defaultTheme","useChartTheme","useContext","theme","children","mergedTheme","_jsx","jsx","Provider","value","data","providerTheme","useMemo","seriesColors","map","series","options","stroke","filter","color","Boolean","buildChartTheme","colors"],"mappings":"uHASA,MAAMA,EAAeC,EAAAA,cAA6BC,EAAAA,cAM5CC,EAAgB,IACPC,aAAYJ,yBA+BqB,EAAIK,QAAQ,CAAE,EAAEC,eAC/D,MAAMC,EAAc,IAAKL,kBAAiBG,GAC1C,OAAOG,EAAAC,IAACT,EAAaU,SAAQ,CAACC,MAAQJ,EAAWD,SAAKA,
|
|
1
|
+
{"version":3,"file":"theme-provider.js","sources":["/@automattic/charts/../../../../src/providers/theme/theme-provider.tsx"],"sourcesContent":[null],"names":["ThemeContext","createContext","defaultTheme","useChartTheme","useContext","theme","children","mergedTheme","_jsx","jsx","Provider","value","data","providerTheme","useMemo","seriesColors","map","series","options","stroke","filter","color","Boolean","buildChartTheme","colors"],"mappings":"uHASA,MAAMA,EAAeC,EAAAA,cAA6BC,EAAAA,cAM5CC,EAAgB,IACPC,aAAYJ,yBA+BqB,EAAIK,QAAQ,CAAE,EAAEC,eAC/D,MAAMC,EAAc,IAAKL,kBAAiBG,GAC1C,OAAOG,EAAAC,IAACT,EAAaU,SAAQ,CAACC,MAAQJ,EAAWD,SAAKA,qDA7B7BM,IACzB,MAAMC,EAAgBV,IAEtB,OAAOW,EAAOA,SAAE,KACf,MAAMC,GAAiBH,GAAQ,IAC7BI,KAAKC,GAAUA,EAAOC,SAASC,SAC/BC,QAAUC,GAA4BC,QAASD,KAEjD,OAAOE,kBAAiB,IACpBV,EACHW,OAAQ,IAAKT,KAAmBF,EAAcW,QAAU,QAEvD,CAAEX,EAAeD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";exports.defaultTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#DCDCDE",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1}},exports.jetpackTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#DCDCDE",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1}},exports.wooTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#80C8FF","#B999FF","#3858E9"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1}};
|
|
1
|
+
"use strict";exports.defaultTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#DCDCDE",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1},legendLabelStyles:{color:"var(--jp-gray-80, #2c3338)"}},exports.jetpackTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#98C8DF","#006DAB","#A6DC80","#1F9828","#FF8C8F"],gridStyles:{stroke:"#DCDCDE",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1},legendLabelStyles:{color:"var(--jp-gray-80, #2c3338)"}},exports.wooTheme={backgroundColor:"#FFFFFF",labelBackgroundColor:"#FFFFFF",colors:["#80C8FF","#B999FF","#3858E9"],gridStyles:{stroke:"#787C82",strokeWidth:1},tickLength:4,gridColor:"",gridColorDark:"",xTickLineStyles:{stroke:"black"},xAxisLineStyles:{stroke:"#DCDCDE",strokeWidth:1},legendLabelStyles:{fontSize:"12px",fontWeight:400,color:"#757575"},legendContainerStyles:{gap:"8px"}};
|
|
2
2
|
//# sourceMappingURL=themes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sources":["/@automattic/charts/../../../../src/providers/theme/themes.ts"],"sourcesContent":[null],"names":["backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","xTickLineStyles","xAxisLineStyles"],"mappings":"kCAKiC,CAChCA,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,GACfC,gBAAiB,CAAEL,OAAQ,SAC3BM,gBAAiB,CAAEN,OAAQ,UAAWC,YAAa,
|
|
1
|
+
{"version":3,"file":"themes.js","sources":["/@automattic/charts/../../../../src/providers/theme/themes.ts"],"sourcesContent":[null],"names":["backgroundColor","labelBackgroundColor","colors","gridStyles","stroke","strokeWidth","tickLength","gridColor","gridColorDark","xTickLineStyles","xAxisLineStyles","legendLabelStyles","color","fontSize","fontWeight","legendContainerStyles","gap"],"mappings":"kCAKiC,CAChCA,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,GACfC,gBAAiB,CAAEL,OAAQ,SAC3BM,gBAAiB,CAAEN,OAAQ,UAAWC,YAAa,GACnDM,kBAAmB,CAClBC,MAAO,oDAOwB,CAChCZ,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,UAAW,UAAW,WACtDC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,GACfC,gBAAiB,CAAEL,OAAQ,SAC3BM,gBAAiB,CAAEN,OAAQ,UAAWC,YAAa,GACnDM,kBAAmB,CAClBC,MAAO,gDAOoB,CAC5BZ,gBAAiB,UACjBC,qBAAsB,UACtBC,OAAQ,CAAE,UAAW,UAAW,WAChCC,WAAY,CACXC,OAAQ,UACRC,YAAa,GAEdC,WAAY,EACZC,UAAW,GACXC,cAAe,GACfC,gBAAiB,CAAEL,OAAQ,SAC3BM,gBAAiB,CAAEN,OAAQ,UAAWC,YAAa,GACnDM,kBAAmB,CAClBE,SAAU,OACVC,WAAY,IACZF,MAAO,WAERG,sBAAuB,CACtBC,IAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.legend-module_legend--horizontal__IUN13{display:flex;flex-direction:row;flex-wrap:wrap;gap:16px}.legend-module_legend--vertical__Scfzo{display:flex;flex-direction:column;gap:8px}.legend-module_legend-item__feemn{align-items:center;display:flex;font-size:.875rem}.legend-module_legend-item-label__ksx6I{align-items:center;display:flex;gap:.5rem}.legend-module_legend-item-value__d9x1j{font-weight:500}.bar-chart-module_bar-chart__lmYNi{position:relative}.bar-chart-module_bar-chart__lmYNi svg{overflow:visible}.bar-chart-module_bar-chart-legend__vgKKq{margin-top:1rem}.line-chart-module_line-chart__ITM3d{position:relative}.line-chart-module_line-chart__ITM3d svg{overflow:visible}.line-chart-module_line-chart__tooltip__aqcme{background:#fff;padding:.5rem}.line-chart-module_line-chart__tooltip-date__4Dzab{font-weight:700;padding-bottom:10px}.line-chart-module_line-chart__tooltip-row__6A37G{align-items:center;display:flex;justify-content:space-between;padding:4px 0}.line-chart-module_line-chart__tooltip-label__IvnFF{font-weight:500;padding-right:1rem}.visx-tooltip-glyph svg{height:10px;width:10px}.base-tooltip-module_tooltip__OfX6n{background-color:rgba(0,0,0,.85);border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1);color:#fff;font-size:14px;padding:.5rem;pointer-events:none;position:absolute;transform:translate(-50%,-100%)}.pie-chart-module_pie-chart__R12Vh{position:relative}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9{position:relative;text-align:center}.pie-semi-circle-chart-module_pie-semi-circle-chart-legend__c8W1Y{margin-top:1rem}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module_label__nPqOg{font-size:16px;font-weight:600;margin-bottom:0}.pie-semi-circle-chart-module_pie-semi-circle-chart__r5jk9 .pie-semi-circle-chart-module_note__LpBZQ{font-size:14px;margin-top:0}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { Orientation, TickFormatter, AxisScale, AxisRendererProps } from '@visx/axis';
|
|
3
3
|
import { LegendShape } from '@visx/legend/lib/types';
|
|
4
4
|
import { ScaleInput, ScaleType } from '@visx/scale';
|
|
5
|
-
import { LineStyles, GridStyles, EventHandlerParams } from '@visx/xychart';
|
|
5
|
+
import { LineStyles, GridStyles, EventHandlerParams, GlyphProps } from '@visx/xychart';
|
|
6
6
|
export { GridStyles, LineStyles } from '@visx/xychart';
|
|
7
|
-
import
|
|
7
|
+
import * as react from 'react';
|
|
8
|
+
import { CSSProperties, PointerEvent, ReactNode, ComponentType, RefObject, ComponentProps, FC } from 'react';
|
|
8
9
|
import { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
|
|
9
10
|
import { TextProps } from '@visx/text';
|
|
10
11
|
import { LegendOrdinal } from '@visx/legend';
|
|
@@ -17,7 +18,19 @@ type DataPoint = {
|
|
|
17
18
|
value: number;
|
|
18
19
|
};
|
|
19
20
|
type DataPointDate = {
|
|
20
|
-
date
|
|
21
|
+
date?: Date;
|
|
22
|
+
/**
|
|
23
|
+
* Supported Formats:
|
|
24
|
+
* - YYYY-MM-DD (local)
|
|
25
|
+
* - YYYY-MM-DD HH:mm:ss (local)
|
|
26
|
+
* - YYYY-MM-DD HH:mm (local)
|
|
27
|
+
* - YYYY-MM-DDTHH:mm:ss (local)
|
|
28
|
+
* - YYYY-MM-DDTHH:mm:ss.SSS (local)
|
|
29
|
+
* - YYYY-MM-DDTHH:mm (local)
|
|
30
|
+
* - YYYY-MM-DDTHH:mm:ssZ (UTC → local)
|
|
31
|
+
* - YYYY-MM-DDTHH:mm:ss±HH:mm (offset → local)
|
|
32
|
+
*/
|
|
33
|
+
dateString?: string;
|
|
21
34
|
value: number | null;
|
|
22
35
|
label?: string;
|
|
23
36
|
};
|
|
@@ -89,6 +102,10 @@ type ChartTheme = {
|
|
|
89
102
|
seriesLineStyles?: LineStyles[];
|
|
90
103
|
/** Styles for legend shapes */
|
|
91
104
|
legendShapeStyles?: CSSProperties[];
|
|
105
|
+
/** Styles for legend labels */
|
|
106
|
+
legendLabelStyles?: CSSProperties;
|
|
107
|
+
/** Styles for legend container */
|
|
108
|
+
legendContainerStyles?: CSSProperties;
|
|
92
109
|
};
|
|
93
110
|
declare type AxisOptions = {
|
|
94
111
|
orientation?: OrientationType;
|
|
@@ -245,16 +262,28 @@ interface BarChartProps extends BaseChartProps<SeriesData[]> {
|
|
|
245
262
|
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
246
263
|
orientation?: 'horizontal' | 'vertical';
|
|
247
264
|
}
|
|
248
|
-
declare const _default$4: (
|
|
265
|
+
declare const _default$4: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<BarChartProps>, "height" | "width" | "size"> & Omit<BarChartProps, "height" | "width" | "size"> & {
|
|
266
|
+
maxWidth?: number;
|
|
267
|
+
aspectRatio?: number;
|
|
268
|
+
resizeDebounceTime?: number;
|
|
269
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
249
270
|
|
|
250
271
|
type CurveType = 'smooth' | 'linear' | 'monotone';
|
|
272
|
+
type RenderLineStartGlyphProps<Datum extends object> = GlyphProps<Datum> & {
|
|
273
|
+
glyphStyle?: React.SVGProps<SVGCircleElement>;
|
|
274
|
+
};
|
|
251
275
|
interface LineChartProps extends BaseChartProps<SeriesData[]> {
|
|
252
276
|
withGradientFill: boolean;
|
|
253
277
|
smoothing?: boolean;
|
|
254
278
|
curveType?: CurveType;
|
|
255
279
|
renderTooltip?: (params: RenderTooltipParams<DataPointDate>) => ReactNode;
|
|
280
|
+
withStartGlyphs?: boolean;
|
|
256
281
|
}
|
|
257
|
-
declare const _default$3: (
|
|
282
|
+
declare const _default$3: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<LineChartProps>, "height" | "width" | "size"> & Omit<LineChartProps, "height" | "width" | "size"> & {
|
|
283
|
+
maxWidth?: number;
|
|
284
|
+
aspectRatio?: number;
|
|
285
|
+
resizeDebounceTime?: number;
|
|
286
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
258
287
|
|
|
259
288
|
type OmitBaseChartProps = Omit<BaseChartProps<DataPointPercentage[]>, 'width' | 'height'>;
|
|
260
289
|
interface PieChartProps extends OmitBaseChartProps {
|
|
@@ -287,7 +316,11 @@ interface PieChartProps extends OmitBaseChartProps {
|
|
|
287
316
|
*/
|
|
288
317
|
children?: React.ReactNode;
|
|
289
318
|
}
|
|
290
|
-
declare const _default$2: (
|
|
319
|
+
declare const _default$2: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<PieChartProps>, "height" | "width" | "size"> & Omit<PieChartProps, "height" | "width" | "size"> & {
|
|
320
|
+
maxWidth?: number;
|
|
321
|
+
aspectRatio?: number;
|
|
322
|
+
resizeDebounceTime?: number;
|
|
323
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
291
324
|
|
|
292
325
|
interface PieSemiCircleChartProps extends BaseChartProps<DataPointPercentage[]> {
|
|
293
326
|
/**
|
|
@@ -312,7 +345,11 @@ interface PieSemiCircleChartProps extends BaseChartProps<DataPointPercentage[]>
|
|
|
312
345
|
*/
|
|
313
346
|
note?: string;
|
|
314
347
|
}
|
|
315
|
-
declare const _default$1: (
|
|
348
|
+
declare const _default$1: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<PieSemiCircleChartProps>, "height" | "width" | "size"> & Omit<PieSemiCircleChartProps, "height" | "width" | "size"> & {
|
|
349
|
+
maxWidth?: number;
|
|
350
|
+
aspectRatio?: number;
|
|
351
|
+
resizeDebounceTime?: number;
|
|
352
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
316
353
|
|
|
317
354
|
interface BarListChartProps extends Exclude<BarChartProps, 'orientation' | 'size' | 'gridVisibility'> {
|
|
318
355
|
options?: {
|
|
@@ -376,7 +413,11 @@ interface RenderValueProps {
|
|
|
376
413
|
index: number;
|
|
377
414
|
formatter: (value: number) => string;
|
|
378
415
|
}
|
|
379
|
-
declare const _default: (
|
|
416
|
+
declare const _default: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<BarListChartProps>, "height" | "width" | "size"> & Omit<BarListChartProps, "height" | "width" | "size"> & {
|
|
417
|
+
maxWidth?: number;
|
|
418
|
+
aspectRatio?: number;
|
|
419
|
+
resizeDebounceTime?: number;
|
|
420
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
380
421
|
|
|
381
422
|
type TooltipData = {
|
|
382
423
|
label: string;
|
|
@@ -416,9 +457,10 @@ type LegendItem = {
|
|
|
416
457
|
type LegendProps = Omit<LegendOrdinalProps, 'shapeStyle'> & {
|
|
417
458
|
items: LegendItem[];
|
|
418
459
|
orientation?: 'horizontal' | 'vertical';
|
|
460
|
+
ref?: RefObject<HTMLDivElement>;
|
|
419
461
|
};
|
|
420
462
|
|
|
421
|
-
declare const BaseLegend:
|
|
463
|
+
declare const BaseLegend: react.ForwardRefExoticComponent<Omit<LegendProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
422
464
|
|
|
423
465
|
/**
|
|
424
466
|
* Props for the ThemeProvider component
|
|
@@ -484,4 +526,4 @@ type UseChartMouseHandlerReturn = {
|
|
|
484
526
|
*/
|
|
485
527
|
declare const useChartMouseHandler: ({ withTooltips, }: UseChartMouseHandlerProps) => UseChartMouseHandlerReturn;
|
|
486
528
|
|
|
487
|
-
export { _default$4 as BarChart, _default as BarListChart, type BaseChartProps, BaseTooltip, type ChartTheme, type DataPoint, type DataPointDate, type DataPointPercentage, type GridProps, BaseLegend as Legend, _default$3 as LineChart, type MultipleDataPointsDate, type Optional, type OrientationType, _default$2 as PieChart, _default$1 as PieSemiCircleChart, type SeriesData, ThemeProvider, defaultTheme, jetpackTheme, useChartMouseHandler, wooTheme };
|
|
529
|
+
export { _default$4 as BarChart, _default as BarListChart, type BaseChartProps, BaseTooltip, type ChartTheme, type DataPoint, type DataPointDate, type DataPointPercentage, type GridProps, BaseLegend as Legend, _default$3 as LineChart, type MultipleDataPointsDate, type Optional, type OrientationType, _default$2 as PieChart, _default$1 as PieSemiCircleChart, type RenderLineStartGlyphProps, type SeriesData, ThemeProvider, defaultTheme, jetpackTheme, useChartMouseHandler, wooTheme };
|