From 4966302304f06d5258882aafbb30a1bba763f1bd Mon Sep 17 00:00:00 2001 From: envex Date: Fri, 12 Apr 2024 21:17:36 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=2013700?= =?UTF-8?q?355d97db460ec47dd2fb4183c18b0fd62ae=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/main-f96afbd37e92f566e754.js | 2 +- docs/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/main-f96afbd37e92f566e754.js b/docs/main-f96afbd37e92f566e754.js index d88dbf7b2..9c26c0288 100644 --- a/docs/main-f96afbd37e92f566e754.js +++ b/docs/main-f96afbd37e92f566e754.js @@ -11,4 +11,4 @@ > - `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_5__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_4__.x]:{arc:{cornerRadius:0,thickness:10}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_10__.b,{mdxType:"SampleDonutChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/arc",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/bar.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_components__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n ",center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_7__.a,{showLegend:!1,mdxType:"SampleBarChart"})),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/bar",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/chartConainer.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{chartContainer:{borderRadius:"0",padding:"0",backgroundColor:"black"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.h,{mdxType:"SampleSparkLineChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_7__.a,{codeSample:`\n \n \n \n `,theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{chartContainer:{borderRadius:"8px",padding:"20px",backgroundColor:"#dde2e9"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.h,{mdxType:"SampleSparkLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Global Properties/chartContainer",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Banner}));var _Banner_scss__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.scss"),_Banner_scss__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_Banner_scss__WEBPACK_IMPORTED_MODULE_0__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");function Banner(_ref){var _ref$type=_ref.type,type=void 0===_ref$type?"Alert":_ref$type,children=_ref.children;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div",{className:_Banner_scss__WEBPACK_IMPORTED_MODULE_0___default.a.Banner+" "+_Banner_scss__WEBPACK_IMPORTED_MODULE_0___default.a[type],children:children})}try{Banner.displayName="Banner",Banner.__docgenInfo={description:"",displayName:"Banner",props:{type:{defaultValue:{value:"Alert"},description:"",name:"type",required:!1,type:{name:'"Alert" | "Info"'}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.tsx#Banner"]={docgenInfo:Banner.__docgenInfo,name:"Banner",path:"packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.tsx#Banner"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ComponentContainer}));__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js");var react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_storybook_addon_links__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/@storybook/addon-links/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),_utilities__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/utilities/classnames.ts"),_hooks__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.scss"),_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/react/jsx-runtime.js");function ComponentContainer(_ref){var chart=_ref.chart,title=_ref.title,description=_ref.description,kind=_ref.kind,center=_ref.center,_ref$theme=_ref.theme,theme=void 0===_ref$theme?_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_5__.x:_ref$theme,codeSample=_ref.codeSample,selectedTheme=Object(_hooks__WEBPACK_IMPORTED_MODULE_7__.a)(theme),onlyHasCodeSample=!kind&&!title&&!description&&Boolean(codeSample),cardTopMarkup=Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(react__WEBPACK_IMPORTED_MODULE_2__.Fragment,{children:[title&&Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("h3",{className:Object(_utilities__WEBPACK_IMPORTED_MODULE_6__.a)(_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.Heading,kind&&_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.Link),children:title}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.Paragraph,children:[description,codeSample&&Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span",{className:Object(_utilities__WEBPACK_IMPORTED_MODULE_6__.a)(onlyHasCodeSample?_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.CodeSampleOnly:_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.CodeSample),children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_3__.g,{dark:!0,language:"jsx",code:codeSample})})]})]});return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div",{className:_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.Container,style:{background:selectedTheme.chartContainer.backgroundColor},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:Object(_utilities__WEBPACK_IMPORTED_MODULE_6__.a)(_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.CardTop,kind?_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.HasLink:""),style:{padding:onlyHasCodeSample?"0px":"undefined"},children:kind?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("button",{onClick:Object(_storybook_addon_links__WEBPACK_IMPORTED_MODULE_4__.a)(kind+" + "+title,"Default"),children:cardTopMarkup}):cardTopMarkup}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div",{className:center?_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.CenterChartContainer:_ComponentContainer_scss__WEBPACK_IMPORTED_MODULE_8___default.a.ChartContainer,children:chart})]})}try{ComponentContainer.displayName="ComponentContainer",ComponentContainer.__docgenInfo={description:"",displayName:"ComponentContainer",props:{chart:{defaultValue:null,description:"",name:"chart",required:!0,type:{name:"Element"}},title:{defaultValue:null,description:"",name:"title",required:!1,type:{name:"string"}},description:{defaultValue:null,description:"",name:"description",required:!0,type:{name:"string"}},kind:{defaultValue:null,description:"",name:"kind",required:!0,type:{name:"string"}},center:{defaultValue:null,description:"",name:"center",required:!1,type:{name:"boolean"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"string"}},codeSample:{defaultValue:null,description:"",name:"codeSample",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx#ComponentContainer"]={docgenInfo:ComponentContainer.__docgenInfo,name:"ComponentContainer",path:"packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx#ComponentContainer"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/Divider.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Divider}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js");function Divider(_ref){var noLine=_ref.noLine;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("hr",{style:{margin:"32px 0",borderBottom:"0px",border:noLine?"0":"undefined"}})})}try{Divider.displayName="Divider",Divider.__docgenInfo={description:"",displayName:"Divider",props:{noLine:{defaultValue:null,description:"",name:"noLine",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/Divider.tsx#Divider"]={docgenInfo:Divider.__docgenInfo,name:"Divider",path:"packages/polaris-viz/src/components/Docs/stories/components/Divider.tsx#Divider"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return ExamplesGrid}));var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/jsx-runtime.js");function ExamplesGrid(_ref){var children=_ref.children,_ref$cols=_ref.cols,cols=void 0===_ref$cols?2:_ref$cols;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div",{style:{display:"grid",gridGap:"20px",gridTemplateColumns:"repeat("+cols+", minmax(250px, 1fr))",gridTemplateRows:"1fr"},children:children})}try{ExamplesGrid.displayName="ExamplesGrid",ExamplesGrid.__docgenInfo={description:"",displayName:"ExamplesGrid",props:{cols:{defaultValue:{value:"2"},description:"",name:"cols",required:!1,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx#ExamplesGrid"]={docgenInfo:ExamplesGrid.__docgenInfo,name:"ExamplesGrid",path:"packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx#ExamplesGrid"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/MobileComponents/MobileComponents.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return MobileComponents}));var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),___WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.tsx"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/SparkBarChart/SparkBarChart.tsx"),___WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),___WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./node_modules/react/jsx-runtime.js"),KIND="polaris-viz/Charts/";function MobileComponents(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div",{style:{display:"grid",gridGap:"20px",gridTemplateColumns:"repeat(auto-fit, minmax(490px, 1fr))"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(___WEBPACK_IMPORTED_MODULE_2__.a,{themes:_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({},_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x,{chartContainer:{padding:"20px"}}),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(___WEBPACK_IMPORTED_MODULE_5__.a,{type:"h3",style:{gridColumn:"span 2"},children:"Spark Charts"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(___WEBPACK_IMPORTED_MODULE_6__.a,{title:"SparkLineChart",description:"Used in small sizes to show how a metric has performed over time. ",center:!0,kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div",{style:{width:"250px",height:"140px"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(___WEBPACK_IMPORTED_MODULE_3__.a,{isAnimated:!0,data:[{data:[{key:0,value:100},{key:1,value:200},{key:2,value:300},{key:3,value:400},{key:4,value:400},{key:5,value:1e3},{key:6,value:200},{key:7,value:800},{key:8,value:900},{key:9,value:200},{key:10,value:400}]},{isComparison:!0,data:[{key:0,value:200},{key:1,value:200},{key:2,value:200},{key:3,value:200},{key:4,value:200},{key:5,value:200},{key:6,value:200},{key:7,value:200},{key:8,value:200},{key:9,value:200},{key:10,value:200}]}]})})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(___WEBPACK_IMPORTED_MODULE_6__.a,{title:"SparkBarChart",description:"Used in small sizes to show how a metric has performed over time. ",center:!0,kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div",{style:{width:"250px",height:"140px"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(___WEBPACK_IMPORTED_MODULE_4__.a,{isAnimated:!0,data:[{data:[{key:0,value:100},{key:1,value:200},{key:2,value:300},{key:3,value:400},{key:4,value:400},{key:5,value:1e3},{key:6,value:200},{key:7,value:800},{key:8,value:900},{key:9,value:200},{key:10,value:400}]},{isComparison:!0,data:[{key:0,value:200},{key:1,value:200},{key:2,value:200},{key:3,value:200},{key:4,value:200},{key:5,value:200},{key:6,value:200},{key:7,value:200},{key:8,value:200},{key:9,value:200},{key:10,value:200}]}]})})})]})})}},"./packages/polaris-viz/src/components/Docs/stories/components/PageWithSizingInfo/PageWithSizingInfo.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return PageWithSizingInfo}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_Banner__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Banner/Banner.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/react/jsx-runtime.js");function PageWithSizingInfo(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.j,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.i,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.c,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_Banner__WEBPACK_IMPORTED_MODULE_2__.a,{type:"Info",children:["This component inherits its height and width from its container. If no parent height can be calculated, the chart will use the"," ",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("code",{children:"ChartContainer.minHeight"})," defined in the ",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("code",{children:"Theme"}),"."]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.f,{}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.b,{story:_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.e}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_1__.h,{})]})}},"./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return PropertyTable}));__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.description.js"),__webpack_require__("./node_modules/core-js/modules/es.array.is-array.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js");var react__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/react/index.js"),_PropertyTable_scss__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.scss"),_PropertyTable_scss__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_PropertyTable_scss__WEBPACK_IMPORTED_MODULE_5__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");function PropertyTable(_ref){var children=_ref.children,_ref$global=_ref.global,global=void 0!==_ref$global&&_ref$global;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("table",{className:_PropertyTable_scss__WEBPACK_IMPORTED_MODULE_5___default.a.PropertyTable,style:{width:"100%"},children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("colgroup",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("col",{span:1,style:{width:"1%"}}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("col",{span:1,style:{width:"1%"}}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("col",{span:1,style:{width:"50%"}}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("col",{span:1,style:{width:"1%"}})]}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("thead",{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("tr",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("th",{children:"property"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("th",{children:"type"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("th",{children:"description"}),!global&&Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("th",{children:"components affected"})]})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("tbody",{children:children})]})}PropertyTable.Row=function(_ref2){var property=_ref2.property,type=_ref2.type,description=_ref2.description,chartsAffected=_ref2.chartsAffected;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("tr",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("td",{children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("code",{children:property})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("td",{children:Array.isArray(type)?Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div",{className:_PropertyTable_scss__WEBPACK_IMPORTED_MODULE_5___default.a.typeArray,children:type.map((function(i,index){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("span",{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("code",{style:{whiteSpace:"pre"},children:i}),index===type.length-1?null:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(react__WEBPACK_IMPORTED_MODULE_4__.Fragment,{children:"|\n"})]},""+i+index)}))}):Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("code",{children:type})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("td",{children:description}),chartsAffected&&Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("td",{children:chartsAffected.map((function(chart,index){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("code",{style:{whiteSpace:"pre"},children:chart},""+chart+index)}))})]})};try{PropertyTable.displayName="PropertyTable",PropertyTable.__docgenInfo={description:"",displayName:"PropertyTable",props:{global:{defaultValue:{value:"false"},description:"",name:"global",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx#PropertyTable"]={docgenInfo:PropertyTable.__docgenInfo,name:"PropertyTable",path:"packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx#PropertyTable"})}catch(__react_docgen_typescript_loader_error){}try{PropertyTable.Row.displayName="PropertyTable.Row",PropertyTable.Row.__docgenInfo={description:"",displayName:"PropertyTable.Row",props:{property:{defaultValue:null,description:"",name:"property",required:!0,type:{name:"string"}},type:{defaultValue:null,description:"",name:"type",required:!0,type:{name:"string | string[]"}},description:{defaultValue:null,description:"",name:"description",required:!0,type:{name:"string"}},chartsAffected:{defaultValue:null,description:"",name:"chartsAffected",required:!1,type:{name:"string[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx#PropertyTable.Row"]={docgenInfo:PropertyTable.Row.__docgenInfo,name:"PropertyTable.Row",path:"packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx#PropertyTable.Row"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"h",(function(){return SampleComponents_SampleSparkLineChart})),__webpack_require__.d(__webpack_exports__,"f",(function(){return SampleComponents_SampleLineChart})),__webpack_require__.d(__webpack_exports__,"a",(function(){return SampleComponents_SampleBarChart})),__webpack_require__.d(__webpack_exports__,"i",(function(){return SampleComponents_SampleStackedAreaChart})),__webpack_require__.d(__webpack_exports__,"g",(function(){return SampleComponents_SampleSimpleNormalizedChart})),__webpack_require__.d(__webpack_exports__,"d",(function(){return SampleComponents_SampleLegendChart})),__webpack_require__.d(__webpack_exports__,"e",(function(){return SampleComponents_SampleLegendContainer})),__webpack_require__.d(__webpack_exports__,"c",(function(){return SampleComponents_SampleLabelsBarChart})),__webpack_require__.d(__webpack_exports__,"b",(function(){return SampleComponents_SampleDonutChart}));var useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),getSeriesColors=__webpack_require__("./packages/polaris-viz-core/src/utilities/getSeriesColors.ts"),useLegend=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/hooks/useLegend.ts"),LegendContainer=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx"),SparkLineChart=__webpack_require__("./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.tsx"),LineChart=__webpack_require__("./packages/polaris-viz/src/components/LineChart/LineChart.tsx"),BarChart=__webpack_require__("./packages/polaris-viz/src/components/BarChart/BarChart.tsx"),StackedAreaChart=__webpack_require__("./packages/polaris-viz/src/components/StackedAreaChart/StackedAreaChart.tsx"),SimpleNormalizedChart=__webpack_require__("./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.tsx"),DonutChart=__webpack_require__("./packages/polaris-viz/src/components/DonutChart/DonutChart.tsx"),utilities=__webpack_require__("./packages/polaris-viz/src/components/Docs/utilities/index.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js"),SimpleContainer_SimpleContainer=function SimpleContainer(_ref){var children=_ref.children,height=_ref.height,_ref$theme=_ref.theme,theme=void 0===_ref$theme?constants.x:_ref$theme,selectedTheme=Object(useTheme.a)(theme);return Object(jsx_runtime.jsx)("div",{style:{height:height,width:"calc(100% - 40px)",background:selectedTheme.chartContainer.backgroundColor,borderRadius:4,padding:"20px"},children:Object(jsx_runtime.jsx)("div",{style:{height:height},children:children})})};try{SimpleContainer_SimpleContainer.displayName="SimpleContainer",SimpleContainer_SimpleContainer.__docgenInfo={description:"",displayName:"SimpleContainer",props:{height:{defaultValue:null,description:"",name:"height",required:!1,type:{name:"number"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SimpleContainer/SimpleContainer.tsx#SimpleContainer"]={docgenInfo:SimpleContainer_SimpleContainer.__docgenInfo,name:"SimpleContainer",path:"packages/polaris-viz/src/components/Docs/stories/components/SimpleContainer/SimpleContainer.tsx#SimpleContainer"})}catch(__react_docgen_typescript_loader_error){}var SampleComponents_SampleSparkLineChart=function SampleSparkLineChart(){var _ref=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref.theme;return Object(jsx_runtime.jsx)(SparkLineChart.a,{theme:theme,data:[{data:[{key:0,value:100},{key:1,value:200},{key:2,value:300},{key:3,value:400},{key:4,value:400},{key:5,value:1e3},{key:6,value:200},{key:7,value:800},{key:8,value:900},{key:9,value:200},{key:10,value:400}]},{isComparison:!0,data:[{key:0,value:200},{key:1,value:200},{key:2,value:200},{key:3,value:200},{key:4,value:200},{key:5,value:200},{key:6,value:200},{key:7,value:200},{key:8,value:200},{key:9,value:200},{key:10,value:200}]}]})},SampleComponents_SampleLineChart=function SampleLineChart(){var _ref2=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref2.theme,_ref2$showLegend=_ref2.showLegend,showLegend=void 0===_ref2$showLegend||_ref2$showLegend;return Object(jsx_runtime.jsx)(LineChart.a,{theme:theme,isAnimated:!0,data:[{name:"Sales",data:[{value:324.19,key:"2020-01-01"},{value:613.29,key:"2020-01-02"},{value:-422.79,key:"2020-01-03"},{value:0,key:"2020-01-04"},{value:1,key:"2020-01-05"}]}],showLegend:showLegend})},SampleComponents_SampleBarChart=function SampleBarChart(){var _ref3=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref3.theme,_ref3$seriesLength=_ref3.seriesLength,seriesLength=void 0===_ref3$seriesLength?3:_ref3$seriesLength,_ref3$showLegend=_ref3.showLegend,showLegend=void 0===_ref3$showLegend||_ref3$showLegend;return Object(jsx_runtime.jsx)(BarChart.a,{data:Object(utilities.d)(seriesLength),theme:theme,showLegend:showLegend})},SampleComponents_SampleStackedAreaChart=function SampleStackedAreaChart(){var _ref4=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref4.theme,_ref4$seriesLength=_ref4.seriesLength,seriesLength=void 0===_ref4$seriesLength?3:_ref4$seriesLength,_ref4$showLegend=_ref4.showLegend,showLegend=void 0===_ref4$showLegend||_ref4$showLegend;return Object(jsx_runtime.jsx)(StackedAreaChart.a,{data:Object(utilities.d)(3,"categories",seriesLength),showLegend:showLegend,theme:theme})},SampleComponents_SampleSimpleNormalizedChart=function SampleSimpleNormalizedChart(){var _ref5=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref5.theme;return Object(jsx_runtime.jsx)(SimpleNormalizedChart.a,{direction:"vertical",theme:theme,data:[{name:"Direct",data:[{key:"April 2022",value:200}]},{name:"Facebook",data:[{key:"April 2022",value:100}]},{name:"Twitter",data:[{key:"April 2022",value:100}]},{name:"Google",data:[{key:"April 2022",value:20}]}],labelFormatter:function labelFormatter(value){return"$"+value}})},SampleComponents_SampleLegendChart=function SampleLegendChart(){var _ref6=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref6.theme,data=[{name:"Breakfast",data:[{key:"Monday",value:3},{key:"Tuesday",value:7},{key:"Wednesday",value:7},{key:"Thursday",value:8},{key:"Friday",value:20},{key:"Saturday",value:0},{key:"Sunday",value:.1}]},{name:"Lunch",data:[{key:"Monday",value:4},{key:"Tuesday",value:0},{key:"Wednesday",value:10},{key:"Thursday",value:15},{key:"Friday",value:8},{key:"Saturday",value:20},{key:"Sunday",value:2}]},{name:"Dinner",data:[{key:"Monday",value:7},{key:"Tuesday",value:0},{key:"Wednesday",value:15},{key:"Thursday",value:12},{key:"Friday",value:20},{key:"Saturday",value:5},{key:"Sunday",value:4}]}];return Object(jsx_runtime.jsx)(SimpleContainer_SimpleContainer,{height:300,children:Object(jsx_runtime.jsx)(BarChart.a,{data:data,theme:theme})})},SampleComponents_SampleLegendContainer=function SampleLegendContainer(){var _ref7=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref7.theme,selectedTheme=Object(useTheme.a)(theme),colors=Object(getSeriesColors.a)(6,selectedTheme),_useLegend=Object(useLegend.a)({data:[{shape:"Line",series:[{name:"Breakfast",data:[{key:"Monday",value:3}]},{name:"Lunch",data:[{key:"Monday",value:4}]},{name:"Dinner",data:[{key:"Monday",value:7}]}]},{shape:"Bar",series:[{name:"Sunday",data:[{key:"Monday",value:3}]},{name:"Monday",data:[{key:"Monday",value:4}]},{name:"Tuesday",data:[{key:"Monday",value:7}]}]}],showLegend:!0,dimensions:{height:0,width:0},colors:colors,seriesNameFormatter:function seriesNameFormatter(value){return""+value}}),legend=_useLegend.legend;return Object(jsx_runtime.jsx)(SimpleContainer_SimpleContainer,{children:Object(jsx_runtime.jsx)("div",{style:{marginTop:-16},children:Object(jsx_runtime.jsx)(LegendContainer.a,{colorVisionType:"",data:legend,onDimensionChange:function onDimensionChange(){}})})})},SampleComponents_SampleLabelsBarChart=function SampleLabelsBarChart(_ref8){var _ref8$width=_ref8.width,width=void 0===_ref8$width?760:_ref8$width;return Object(jsx_runtime.jsx)(SimpleContainer_SimpleContainer,{children:Object(jsx_runtime.jsx)("div",{style:{display:"flex",justifyContent:"center",height:"100%",width:"100%"},children:Object(jsx_runtime.jsx)("div",{style:{height:200,width:width},children:Object(jsx_runtime.jsx)(BarChart.a,{data:Object(utilities.d)(3),showLegend:!1})})})})},SampleComponents_SampleDonutChart=function SampleDonutChart(){var _ref9=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{theme:"Light"},theme=_ref9.theme;return Object(jsx_runtime.jsx)(DonutChart.a,{theme:theme,data:[{name:"Shopify Payments",data:[{key:"april - march",value:5e4}]},{name:"Paypal",data:[{key:"april - march",value:25e3}]},{name:"Other",data:[{key:"april - march",value:1e4}]},{name:"Amazon Pay",data:[{key:"april - march",value:4e3}]}]})};try{SampleComponents_SampleSparkLineChart.displayName="SampleSparkLineChart",SampleComponents_SampleSparkLineChart.__docgenInfo={description:"",displayName:"SampleSparkLineChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleSparkLineChart"]={docgenInfo:SampleComponents_SampleSparkLineChart.__docgenInfo,name:"SampleSparkLineChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleSparkLineChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleLineChart.displayName="SampleLineChart",SampleComponents_SampleLineChart.__docgenInfo={description:"",displayName:"SampleLineChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}},showLegend:{defaultValue:{value:"true"},description:"",name:"showLegend",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLineChart"]={docgenInfo:SampleComponents_SampleLineChart.__docgenInfo,name:"SampleLineChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLineChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleBarChart.displayName="SampleBarChart",SampleComponents_SampleBarChart.__docgenInfo={description:"",displayName:"SampleBarChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}},seriesLength:{defaultValue:{value:"3"},description:"",name:"seriesLength",required:!1,type:{name:"number"}},showLegend:{defaultValue:{value:"true"},description:"",name:"showLegend",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleBarChart"]={docgenInfo:SampleComponents_SampleBarChart.__docgenInfo,name:"SampleBarChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleBarChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleStackedAreaChart.displayName="SampleStackedAreaChart",SampleComponents_SampleStackedAreaChart.__docgenInfo={description:"",displayName:"SampleStackedAreaChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}},seriesLength:{defaultValue:{value:"3"},description:"",name:"seriesLength",required:!1,type:{name:"number"}},showLegend:{defaultValue:{value:"true"},description:"",name:"showLegend",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleStackedAreaChart"]={docgenInfo:SampleComponents_SampleStackedAreaChart.__docgenInfo,name:"SampleStackedAreaChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleStackedAreaChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleSimpleNormalizedChart.displayName="SampleSimpleNormalizedChart",SampleComponents_SampleSimpleNormalizedChart.__docgenInfo={description:"",displayName:"SampleSimpleNormalizedChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleSimpleNormalizedChart"]={docgenInfo:SampleComponents_SampleSimpleNormalizedChart.__docgenInfo,name:"SampleSimpleNormalizedChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleSimpleNormalizedChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleLegendChart.displayName="SampleLegendChart",SampleComponents_SampleLegendChart.__docgenInfo={description:"",displayName:"SampleLegendChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLegendChart"]={docgenInfo:SampleComponents_SampleLegendChart.__docgenInfo,name:"SampleLegendChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLegendChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleLegendContainer.displayName="SampleLegendContainer",SampleComponents_SampleLegendContainer.__docgenInfo={description:"",displayName:"SampleLegendContainer",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLegendContainer"]={docgenInfo:SampleComponents_SampleLegendContainer.__docgenInfo,name:"SampleLegendContainer",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLegendContainer"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleLabelsBarChart.displayName="SampleLabelsBarChart",SampleComponents_SampleLabelsBarChart.__docgenInfo={description:"",displayName:"SampleLabelsBarChart",props:{width:{defaultValue:{value:"760"},description:"",name:"width",required:!1,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLabelsBarChart"]={docgenInfo:SampleComponents_SampleLabelsBarChart.__docgenInfo,name:"SampleLabelsBarChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleLabelsBarChart"})}catch(__react_docgen_typescript_loader_error){}try{SampleComponents_SampleDonutChart.displayName="SampleDonutChart",SampleComponents_SampleDonutChart.__docgenInfo={description:"",displayName:"SampleDonutChart",props:{theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleDonutChart"]={docgenInfo:SampleComponents_SampleDonutChart.__docgenInfo,name:"SampleDonutChart",path:"packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx#SampleDonutChart"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return Title}));__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var react__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/utilities/uniqueId.ts"),_utilities__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/Docs/utilities/index.ts"),_Title_scss__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.scss"),_Title_scss__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_Title_scss__WEBPACK_IMPORTED_MODULE_5__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./node_modules/react/jsx-runtime.js");function Title(_ref){var _ref$type=_ref.type,type=void 0===_ref$type?"h1":_ref$type,_ref$children=_ref.children,children=void 0===_ref$children?"":_ref$children,_ref$style=_ref.style,style=void 0===_ref$style?{}:_ref$style,id=Object(react__WEBPACK_IMPORTED_MODULE_2__.useMemo)((function(){return Object(_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.a)("titleAnchor")}),[]),markup=Object(react__WEBPACK_IMPORTED_MODULE_2__.useMemo)((function(){switch(type){case"h1":return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h1",{className:_Title_scss__WEBPACK_IMPORTED_MODULE_5___default.a.h2,children:children});case"h2":return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h2",{className:_Title_scss__WEBPACK_IMPORTED_MODULE_5___default.a.h2,children:children});case"h3":return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h3",{className:_Title_scss__WEBPACK_IMPORTED_MODULE_5___default.a.h3,children:children});case"h4":return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("h4",{className:_Title_scss__WEBPACK_IMPORTED_MODULE_5___default.a.h4,children:children});default:return children}}),[children,type]);return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("a",{className:_Title_scss__WEBPACK_IMPORTED_MODULE_5___default.a.TitleAnchor,id:id,href:"#"+id,onClick:function handleInteraction(event){event.preventDefault();var url=(window.location.href+"#"+id).replace("iframe.html?id=","?path=/docs/");Object(_utilities__WEBPACK_IMPORTED_MODULE_4__.b)(url)},style:style,children:markup})}try{Title.displayName="Title",Title.__docgenInfo={description:"",displayName:"Title",props:{type:{defaultValue:{value:"h1"},description:"",name:"type",required:!1,type:{name:"string"}},style:{defaultValue:{value:"{}"},description:"",name:"style",required:!1,type:{name:"CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx#Title"]={docgenInfo:Title.__docgenInfo,name:"Title",path:"packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx#Title"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Docs/stories/components/UtilitiesHeader/UtilitiesHeader.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return UtilitiesHeader}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),_Title__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js");function UtilitiesHeader(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Title__WEBPACK_IMPORTED_MODULE_1__.a,{children:"🛠 Utilities"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("p",{children:["You can import utility functions from either",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("code",{children:"polaris-viz"})," or ",Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("code",{children:"polaris-viz-native"})]})]})}},"./packages/polaris-viz/src/components/Docs/stories/components/WebComponents/WebComponents.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return WebComponents}));var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),_PolarisVizProvider__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),___WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz/src/components/BarChart/BarChart.tsx"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/LineChart/LineChart.tsx"),___WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/StackedAreaChart/StackedAreaChart.tsx"),___WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/DonutChart/DonutChart.tsx"),___WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/FunnelChart/FunnelChart.tsx"),___WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/ComboChart/ComboChart.tsx"),___WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/SparkBarChart/SparkBarChart.tsx"),___WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.tsx"),___WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./packages/polaris-viz/src/components/SimpleBarChart/SimpleBarChart.tsx"),___WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.tsx"),___WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),___WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./node_modules/react/jsx-runtime.js"),KIND="polaris-viz/Charts/";function WebComponents(){return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div",{style:{display:"grid",gridGap:"20px",gridTemplateColumns:"repeat(auto-fit, minmax(490px, 1fr))"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(_PolarisVizProvider__WEBPACK_IMPORTED_MODULE_2__.a,{themes:_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({},_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x,{chartContainer:{padding:"20px"}}),children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_13__.a,{type:"h3",style:{gridColumn:"span 2"},children:"Default Charts"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"BarChart",description:"Used to show a grouped comparison of different types, across categories or time. ",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_3__.a,{isAnimated:!0,xAxisOptions:{},data:[{name:"Breakfast",data:[{key:"Monday",value:3},{key:"Tuesday",value:10},{key:"Wednesday",value:4}]},{name:"Lunch",data:[{key:"Monday",value:4},{key:"Tuesday",value:9},{key:"Wednesday",value:5}]},{name:"Dinner",data:[{key:"Monday",value:7},{key:"Tuesday",value:10},{key:"Wednesday",value:6}]}]})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"LineChart",description:"Used to show change over time. ",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_4__.a,{isAnimated:!0,data:[{name:"Sales",data:[{value:324.19,key:"2020-01-01"},{value:613.29,key:"2020-01-02"},{value:-422.79,key:"2020-01-03"},{value:0,key:"2020-01-04"},{value:1,key:"2020-01-05"}]}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"StackedAreaChart",description:"Used to compare multiple series of data and display the total value. ",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_5__.a,{isAnimated:!0,data:[{name:"First-time",data:[{key:"January",value:4237},{key:"February",value:5024},{key:"March",value:5730},{key:"April",value:5587},{key:"May",value:5303},{key:"June",value:5634},{key:"July",value:3238}]},{name:"Returning",data:[{key:"January",value:5663},{key:"February",value:7349},{key:"March",value:9795},{key:"April",value:7396},{key:"May",value:7028},{key:"June",value:12484},{key:"July",value:4878}]}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"DonutChart",description:"Circular statistical graphic, which is divided into slices to illustrate numerical proportion. ",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_6__.a,{isAnimated:!0,data:[{data:[{key:"april - march",value:5e4}],name:"Shopify Payments"},{color:"lime",data:[{key:"april - march",value:25e3}],name:"Paypal"},{data:[{key:"april - march",value:4e3}],name:"Amazon Pay"}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"FunnelChart",description:"Used to show conversion data.",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_7__.a,{data:[{data:[{key:"Opens",value:126},{key:"Visitors",value:48},{key:"Added to carts",value:12},{key:"Orders",value:0}],name:"Conversion"}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"ComboChart",description:"Combines BarChart and LineChart.",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_8__.a,{data:[{name:"Total Sales",series:[{data:[{key:"2020-07-07T12:00:00",value:3},{key:"2020-07-08T12:00:00",value:-7},{key:"2020-07-09T12:00:00",value:-7},{key:"2020-07-10T12:00:00",value:-8},{key:"2020-07-11T12:00:00",value:50}],name:"POS"},{color:"lime",data:[{key:"2020-07-07T12:00:00",value:4},{key:"2020-07-08T12:00:00",value:0},{key:"2020-07-09T12:00:00",value:-10},{key:"2020-07-10T12:00:00",value:15},{key:"2020-07-11T12:00:00",value:8}],name:"Online"},{data:[{key:"2020-07-07T12:00:00",value:7},{key:"2020-07-08T12:00:00",value:0},{key:"2020-07-09T12:00:00",value:-15},{key:"2020-07-10T12:00:00",value:8},{key:"2020-07-11T12:00:00",value:50}],name:"Mobile"}],shape:"Bar"},{name:"Total Sessions",series:[{data:[{key:"2020-07-07T12:00:00",value:333},{key:"2020-07-08T12:00:00",value:797},{key:"2020-07-09T12:00:00",value:234},{key:"2020-07-10T12:00:00",value:534},{key:"2020-07-11T12:00:00",value:132}],name:"Sessions from Google ads"},{data:[{key:"2020-07-07T12:00:00",value:709},{key:"2020-07-08T12:00:00",value:238},{key:"2020-07-09T12:00:00",value:190},{key:"2020-07-10T12:00:00",value:90},{key:"2020-07-11T12:00:00",value:399}],isComparison:!0,name:"Sessions from Facebooks ads"}],shape:"Line"}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x,showLegend:!1})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_13__.a,{type:"h3",style:{gridColumn:"span 2"},children:"Spark Charts"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"SparkBarChart",description:"Used in small sizes to show how a metric has performed over time. ",center:!0,kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div",{style:{width:"250px",height:"140px"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_9__.a,{isAnimated:!0,targetLine:{value:2e3},data:[{data:[{key:1,value:100},{key:2,value:200},{key:3,value:300},{key:4,value:400},{key:5,value:400},{key:6,value:100},{key:7,value:2e3},{key:8,value:800},{key:9,value:900},{key:10,value:200},{key:11,value:100},{key:12,value:200},{key:13,value:300},{key:14,value:400},{key:15,value:400},{key:16,value:100},{key:17,value:1e3},{key:18,value:800},{key:19,value:900},{key:20,value:200},{key:21,value:100},{key:22,value:200},{key:23,value:300},{key:24,value:400},{key:25,value:400},{key:26,value:100},{key:27,value:800},{key:28,value:800},{key:29,value:900}]}]})})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"SparkLineChart",description:"Used in small sizes to show how a metric has performed over time. ",center:!0,kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div",{style:{width:"250px",height:"140px"},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_10__.a,{isAnimated:!0,data:[{data:[{key:0,value:100},{key:1,value:200},{key:2,value:300},{key:3,value:400},{key:4,value:400},{key:5,value:1e3},{key:6,value:200},{key:7,value:800},{key:8,value:900},{key:9,value:200},{key:10,value:400}]},{isComparison:!0,data:[{key:0,value:200},{key:1,value:200},{key:2,value:200},{key:3,value:200},{key:4,value:200},{key:5,value:200},{key:6,value:200},{key:7,value:200},{key:8,value:200},{key:9,value:200},{key:10,value:200}]}]})})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_13__.a,{type:"h3",style:{gridColumn:"span 2"},children:"Simple Charts"}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"SimpleBarChart",description:"Used to show a grouped comparison of different types, across categories or time. ",kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_11__.a,{data:[{name:"BFCM 2020",data:[{value:4,key:"Shirt"},{value:7,key:"Shoes"}]},{name:"BFCM 2021",data:[{value:5,key:"Shirt"},{value:6,key:"Shoes"}]}],theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})}),Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_14__.a,{title:"SimpleNormalizedChart",description:"Used for positive datasets with two to four items. ",center:!0,kind:KIND,chart:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div",{style:{width:450},children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(___WEBPACK_IMPORTED_MODULE_12__.a,{direction:"horizontal",comparisonMetrics:[{dataIndex:0,metric:"5",trend:"positive",accessibilityLabel:"Increase of"},{dataIndex:1,metric:"5",trend:"negative",accessibilityLabel:"Decrease of"}],data:[{name:"Direct",data:[{key:"April 2022",value:200}]},{name:"Facebook",data:[{key:"April 2022",value:100}]},{name:"Twitter",data:[{key:"April 2022",value:100}]},{name:"Google",data:[{key:"April 2022",value:20}]}],labelFormatter:function labelFormatter(value){return"$"+value},theme:_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_1__.x})})})]})})}},"./packages/polaris-viz/src/components/Docs/stories/createThemeUtility.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i {\n //...This function creates a complete theme from the\n // partial theme provided. It will overwrite the base theme\n // with the properties of the partial theme\n};\n")),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("p",null,"If you call the function passing only a partial theme, it will use the",Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",null,"PolarisVizDefaultTheme")," as a base theme:"),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("p",null,Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",null,"myDefaultTheme")," has all the properties from"," ",Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",null,"PolarisVizDefaultTheme")," but has red background and square corners"),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("pre",null,Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",{parentName:"pre",className:"language-tsx"},"import {createTheme} from '@shopify/polaris-viz';\n\nconst myDefaultTheme = createTheme({\n barTheme: {\n borderRadius: 1,\n },\n chartContainer: {\n backgroundColor: 'red',\n },\n});\n")),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("p",null,"You can also pass your own theme as the base theme.",Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",null,"myOtherTheme")," will inherit all the properties of myDefaultTheme but will use green background"),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("pre",null,Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("code",{parentName:"pre",className:"language-tsx"},"import {createTheme} from '@shopify/polaris-viz';\n\nconst myOtherTheme = createTheme(\n {\n chartContainer: {\n backgroundColor: 'green',\n },\n },\n myDefaultTheme,\n);\n")))))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/createTheme Utility",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/crosshair.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Divider.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{crossHair:{color:"lime",width:10}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_10__.f,{mdxType:"SampleLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/crossHair",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/grid.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{grid:{showHorizontalLines:!1}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{grid:{}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.i,{showLegend:!1,mdxType:"SampleStackedAreaChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{grid:{showHorizontalLines:!0,horizontalOverflow:!1,verticalOverflow:!1,color:"lime",horizontalMargin:50}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.f,{showLegend:!1,mdxType:"SampleLineChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{grid:{showHorizontalLines:!0,horizontalOverflow:!0,verticalOverflow:!0,color:"lime",horizontalMargin:50}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.f,{showLegend:!1,mdxType:"SampleLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/grid",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/legend.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"320px",height:"250px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{chartContainer:{padding:"10px"},legend:{labelColor:"lime",valueColor:"yellow"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.g,{mdxType:"SampleSimpleNormalizedChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{crossHair:{color:"lime",width:10},legend:{backgroundColor:"purple"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.f,{mdxType:"SampleLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/legend",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/line.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{line:{hasSpline:!1,style:"dotted",width:5,pointStroke:"lime"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.f,{mdxType:"SampleLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/line",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/polaris-viz-core.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var esm=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),dist_esm=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),utilities=__webpack_require__("./packages/polaris-viz/src/components/Docs/utilities/index.ts");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n\n## 🧠 `polaris-viz-core`\n\n`packages/polaris-viz-core` contains platform agnostic utility functions, hooks, constants, types and UI components.\n\nIt gets published as the `@shopify/polaris-viz-core` library that is used by both `@shopify/polaris-viz` and `@shopify/polaris-viz-native`\n\n\n
\n
\n
\n\n## 👯‍♀️ Sharing code between React and React Native\n\n
\n
\n\n### Keeping the bundle size small\n\nTo keep the bundle size of the libraries small, `@shopify/polaris-viz-core` shouldn't depend on platform specific packages, like ` @react-native` or `@react-spring/web`, directly.\n\n
\n
\n\n### Sharing UI components\n\nTo render SVG tags in React Native, we use [the `react-native-svg` library](https://github.com/react-native-svg/react-native-svg). `@shopify/polaris-viz` doesn't need this package as a dependency though, since its targets are web browsers only. If we added `react-native-svg` as a depency of `@shopify/polaris-viz-core` we would also increase `@shopify/polaris-viz` bundle size for something that only `@shopify/polaris-viz-native` needs.\n\nTo solve this, we:\n\n- Store all regular SVG tags as React components in the `polaris-viz-context` used by `PolarisVizProvider`:\n\n```ts\n// packages/polaris-viz-core/polaris-viz-context.ts\n\nexport const PolarisVizContext = createContext({\n components: {\n Svg: ({children, ...props}) => createElement('svg', props, children),\n Circle: ({children, ...props}) => createElement('circle', props, children),\n Ellipse: ({children, ...props}) => createElement('ellipse', props, children),\n G: ({children, ...props}) => createElement('g', props, children),\n Text: ({children, ...props}) => createElement('text', props, children),\n // ... other SVG tags\n },\n});\n```\n\n- Re-export `PolarisVizProvider` from `polaris-viz-native` overwriting the regular SVG tags, with the equivalent tags from `react-native-svg`\n\n```ts\n// packages/polaris-viz-native/PolarisVizProvider.tsx\n\nimport {PolarisVizProvider as OriginalPolarisVizProvider} from '@shopify/polaris-viz-core';\n\nimport {\n Svg,\n Circle,\n // ...\n} from 'react-native-svg';\n\nexport const NativeComponents = {\n Svg,\n Circle,\n // ...\n}\n\nexport const PolarisVizProvider = ({themes, children}) => {\n return (\n \n {children}\n \n );\n};\n\n```\n\n\n\n\n- When building UI components in `polaris-viz-core`, instead of using `` directly, we get `` from the context:\n\n```ts\n// packages/polaris-viz-core/SomeSharedComponent.tsx\n\nexport function SomeSharedComponent() {\n const {\n components: {Svg, Rect},\n } = usePolarisVizContext();\n\n return (\n \n \n \n )\n}\n\n```\n\nWith these changes in place,\n- in `polaris-viz`:\n
\n `` and `` will fetch the `svg` and `rect` tags from the default values of `polaris-viz-context` and render correctly in web browsers\n
\n
\n- in `polaris-viz-native`:\n
\n `` and `` will fetch the `Svg` and `Rect` tags from the `react-native-svg` library that were used to overwrite the default tags in the `PolarisVizProvider`, thus rendering correctly in React Native\n\nTo summarize:\n\n![graph demontrating that core components fetching svg tags from PolarisVizProvider will use regular SVG tags in polaris-viz and native SVG tags in polaris-viz-native](../../public/PolarisVizProvider_graph.png)\n\n
\n
\n
\n### Animating shared UI components\n\nWe use [react-spring](https://react-spring.io/) to handle animations. This library also has platform specific exports to keep bundle size small: `@react-spring/web` and `@react-spring/native`\n\nTo animate components in core, we fetch the platform specific `animated` function from the ` PolarisVizContext`, similarly to how we get the correct SVG tags.\n\n```tsx\n\n// packages/polaris-viz-core/SomeSharedComponent.tsx\n\nimport { useSpring } from \"@react-spring/core\"\n\nexport function SomeSharedComponent() {\n const {\n components: {Svg, Circle},\n animated,\n } = usePolarisVizContext();\n\n const {animatedRadius} = useSpring({\n from: {\n animatedRadius: 0,\n },\n to: {\n animatedRadius: 100,\n },\n });\n\n const AnimatedCircle = animated(Circle);\n\n\n return (\n \n \n \n )\n}\n\n```\n","../../public/PolarisVizProvider_graph.png","PolarisVizProvider_graph.png"),mdxType:"Description"}))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Contributing/Polaris Viz Core",includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(esm.b)(dist_esm.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(esm.b)(MDXContent,null))};__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/seriesColors.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{seriesColors:{single:"lime"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.i,{seriesLength:1,mdxType:"SampleStackedAreaChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{seriesColors:{upToEight:["yellow","lime","aqua","Teal"]}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{seriesLength:4,showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{seriesColors:{all:["magenta","orange","DarkOrchid","yellow","lime","aqua","Teal"]}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{seriesLength:7,showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{seriesColors:{all:["GreenYellow","ForestGreen","LawnGreen","Lime","LimeGreen","PaleGreen","YellowGreen","MediumSpringGreen","SpringGreen","MediumSeaGreen","SeaGreen"]}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{seriesLength:11,showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{seriesColors:{comparison:"lime"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.h,{mdxType:"SampleSparkLineChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Global Properties/seriesColors",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/tooltip.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/react/index.js"),react__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__),_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{tooltip:{backgroundColor:"MidnightBlue",valueColor:"yellow",labelColor:"Fuchsia"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Global Properties/tooltip",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/xaxis.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{xAxis:{labelColor:"lime"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"}),Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_8__.a,{codeSample:`\n \n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{xAxis:{hide:!0}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_9__.a,{showLegend:!1,mdxType:"SampleBarChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/xAxis",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/stories/yaxis.stories.mdx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"__page",(function(){return __page}));__webpack_require__("./node_modules/react/index.js");var _mdx_js_react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@mdx-js/react/dist/esm.js"),_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./packages/polaris-viz/node_modules/@storybook/addon-docs/dist/esm/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),___WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Title/Title.tsx"),_components__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/Divider.tsx"),_components__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PropertyTable/PropertyTable.tsx"),_components__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ExamplesGrid/ExamplesGrid.tsx"),_components__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/ComponentContainer/ComponentContainer.tsx"),_components__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/SampleComponents.tsx");function _extends(){return _extends=Object.assign||function(target){for(var i=1;i\n \n \n `,center:!0,chart:Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)("div",{style:{width:"350px",height:"140px"}},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(___WEBPACK_IMPORTED_MODULE_4__.a,{themes:{[_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_3__.x]:{yAxis:{labelColor:"lime",backgroundColor:"black"}}},mdxType:"PolarisVizProvider"},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_components__WEBPACK_IMPORTED_MODULE_10__.i,{mdxType:"SampleStackedAreaChart"}))),mdxType:"ComponentContainer"})))}MDXContent.isMDXComponent=!0;const __page=()=>{throw new Error("Docs-only story")};__page.parameters={docsOnly:!0};const componentMeta={title:"Shared/Themes/Theme Definition/Chart Specific Properties/yAxis",parameters:{viewMode:"docs",docsOnly:!0},includeStories:["__page"]},mdxStoryNameToKey={};componentMeta.parameters=componentMeta.parameters||{},componentMeta.parameters.docs={...componentMeta.parameters.docs||{},page:()=>Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(_storybook_addon_docs__WEBPACK_IMPORTED_MODULE_2__.a,{mdxStoryNameToKey:mdxStoryNameToKey,mdxComponentAnnotations:componentMeta},Object(_mdx_js_react__WEBPACK_IMPORTED_MODULE_1__.b)(MDXContent,null))},__webpack_exports__.default=componentMeta},"./packages/polaris-viz/src/components/Docs/utilities/index.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"d",(function(){return generateMultipleSeries})),__webpack_require__.d(__webpack_exports__,"b",(function(){return copyTextToClipboard})),__webpack_require__.d(__webpack_exports__,"a",(function(){return SHARK_SPECIES_GROWTH})),__webpack_require__.d(__webpack_exports__,"c",(function(){return fixImagePath}));__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.fill.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js");var PRODUCT_NAMES=["Shirts","Pants","Shoes","Hat","Jacket","Parka","Toque","Wind-breaker","Sweat pants","Shorts","Hoodies","Scarfs","Beanies","Socks","Flip Flops","Glasses"];var generateDataSet=function generateDataSet(dataLength,typeOfData){var dates="dates"===typeOfData?function generateDayRange(numDays){for(var currentDate=new Date("April 1, 2020"),dayRange=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:"categories",dataSetLength=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return Array(quantity).fill(null).map((function(_,index){return{name:"Series "+(index+1),data:generateDataSet(dataSetLength,typeOfData)}}))};function copyTextToClipboard(text){var textArea=document.createElement("textarea");textArea.style.position="fixed",textArea.style.top="-1000px",textArea.style.left="-1000px",textArea.style.width="0",textArea.style.height="0",textArea.style.border="none",textArea.style.outline="none",textArea.style.boxShadow="none",textArea.style.background="transparent",textArea.value=text,document.body.appendChild(textArea),textArea.focus(),textArea.select();try{document.execCommand("copy")}catch(err){}document.body.removeChild(textArea)}var SHARK_SPECIES_GROWTH=[{name:"Mako",data:[{key:"0",value:80},{key:"5",value:170},{key:"10",value:210},{key:"15",value:240}]},{name:"Great White",data:[{key:"0",value:80},{key:"5",value:180},{key:"10",value:250},{key:"15",value:300}]}];function fixImagePath(rawMd){var originalPath=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"./public/polaris_viz_header.png",newPath=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"polaris_viz_header.png";return rawMd.replace(originalPath,newPath)}},"./packages/polaris-viz/src/components/DonutChart/DonutChart.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/DonutChart/DonutChart.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/DonutChart/DonutChart.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return DonutChart_DonutChart}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),usePolarisVizContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePolarisVizContext.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),ChartContainer=__webpack_require__("./packages/polaris-viz/src/components/ChartContainer/ChartContainer.tsx"),slicedToArray=(__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),slicedToArray_default=__webpack_require__.n(slicedToArray),react=__webpack_require__("./node_modules/react/index.js"),react_default=__webpack_require__.n(react),pie=__webpack_require__("./node_modules/d3-shape/src/pie.js"),useChartContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartContext.ts"),useUniqueId=__webpack_require__("./packages/polaris-viz-core/src/hooks/useUniqueId.ts"),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),clamp=__webpack_require__("./packages/polaris-viz-core/src/utilities/clamp.ts"),estimateStringWidth=__webpack_require__("./packages/polaris-viz-core/src/utilities/estimateStringWidth.ts"),types=__webpack_require__("./packages/polaris-viz-core/src/types.ts"),src_constants=__webpack_require__("./packages/polaris-viz/src/constants.ts");var getContainerAlignmentForLegend=__webpack_require__("./packages/polaris-viz/src/utilities/getContainerAlignmentForLegend.ts"),useLegend=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/hooks/useLegend.ts"),LegendContainer=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx"),getSeriesColors=__webpack_require__("./packages/polaris-viz-core/src/utilities/getSeriesColors.ts"),useColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useColorVisionEvents.ts"),useWatchColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useWatchColorVisionEvents.tsx"),Arc=__webpack_require__("./packages/polaris-viz/src/components/Arc/Arc.tsx"),ChartSkeleton=__webpack_require__("./packages/polaris-viz/src/components/ChartSkeleton/ChartSkeleton.tsx"),DonutChart=__webpack_require__("./packages/polaris-viz/src/components/DonutChart/DonutChart.scss"),DonutChart_default=__webpack_require__.n(DonutChart),useOverflowLegend=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/hooks/useOverflowLegend.ts"),getTrendIndicatorData=__webpack_require__("./packages/polaris-viz/src/utilities/getTrendIndicatorData.ts"),HiddenLegendTooltip=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.tsx"),LegendValues=__webpack_require__("./packages/polaris-viz/src/components/DonutChart/components/LegendValues/LegendValues.scss"),LegendValues_default=__webpack_require__.n(LegendValues),TrendIndicator=__webpack_require__("./packages/polaris-viz/src/components/TrendIndicator/TrendIndicator.tsx"),SquareColorPreview=__webpack_require__("./packages/polaris-viz/src/components/SquareColorPreview/SquareColorPreview.tsx"),LegendValueItem=__webpack_require__("./packages/polaris-viz/src/components/DonutChart/components/LegendValues/components/LegendValueItem/LegendValueItem.scss"),LegendValueItem_default=__webpack_require__.n(LegendValueItem),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i void"}},getColorVisionStyles:{defaultValue:null,description:"",name:"getColorVisionStyles",required:!0,type:{name:"ColorVisionInteractionMethods"}},getColorVisionEventAttrs:{defaultValue:null,description:"",name:"getColorVisionEventAttrs",required:!0,type:{name:"ColorVisionInteractionMethods"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/DonutChart/components/LegendValues/components/LegendValueItem/LegendValueItem.tsx#LegendValueItem"]={docgenInfo:LegendValueItem_LegendValueItem.__docgenInfo,name:"LegendValueItem",path:"packages/polaris-viz/src/components/DonutChart/components/LegendValues/components/LegendValueItem/LegendValueItem.tsx#LegendValueItem"})}catch(__react_docgen_typescript_loader_error){}function LegendValues_LegendValues(_ref){var allData=_ref.data,activeIndex=_ref.activeIndex,labelFormatter=_ref.labelFormatter,longestLegendValueWidth=_ref.longestLegendValueWidth,_ref$renderHiddenLege=_ref.renderHiddenLegendLabel,renderHiddenLegendLabel=void 0===_ref$renderHiddenLege?function(count){return"+"+count+" more"}:_ref$renderHiddenLege,getColorVisionStyles=_ref.getColorVisionStyles,getColorVisionEventAttrs=_ref.getColorVisionEventAttrs,dimensions=_ref.dimensions,seriesNameFormatter=_ref.seriesNameFormatter,selectedTheme=Object(useTheme.a)(),theme=Object(useChartContext.a)().theme,legendItemDimensions=Object(react.useRef)([{width:0,height:0}]),seriesCount=Object(clamp.a)({amount:allData.length,min:1,max:1/0}),seriesColors=Object(getSeriesColors.a)(seriesCount,selectedTheme),_useLegend=Object(useLegend.a)({showLegend:!0,data:[{series:allData,shape:"Bar"}],colors:seriesColors,dimensions:dimensions,seriesNameFormatter:seriesNameFormatter}),legendData=_useLegend.legend,height=_useLegend.height,_useOverflowLegend=Object(useOverflowLegend.a)({direction:"vertical",data:legendData,height:height,legendItemDimensions:legendItemDimensions,enableHideOverflow:!0}),displayedData=_useOverflowLegend.displayedData,hiddenData=_useOverflowLegend.hiddenData,hasHiddenData=displayedData.length `+${count} more`"},description:"",name:"renderHiddenLegendLabel",required:!1,type:{name:"RenderHiddenLegendLabel"}},getColorVisionStyles:{defaultValue:null,description:"",name:"getColorVisionStyles",required:!0,type:{name:"ColorVisionInteractionMethods"}},getColorVisionEventAttrs:{defaultValue:null,description:"",name:"getColorVisionEventAttrs",required:!0,type:{name:"ColorVisionInteractionMethods"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!0,type:{name:"LabelFormatter"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/DonutChart/components/LegendValues/LegendValues.tsx#LegendValues"]={docgenInfo:LegendValues_LegendValues.__docgenInfo,name:"LegendValues",path:"packages/polaris-viz/src/components/DonutChart/components/LegendValues/LegendValues.tsx#LegendValues"})}catch(__react_docgen_typescript_loader_error){}var react_spring_web_esm=__webpack_require__("./node_modules/@react-spring/web/dist/react-spring-web.esm.js"),classnames=__webpack_require__("./packages/polaris-viz/src/utilities/classnames.ts"),ComparisonMetric=__webpack_require__("./packages/polaris-viz/src/components/ComparisonMetric/ComparisonMetric.tsx");function InnerValue(_ref){var _renderInnerValueCont,activeValue=_ref.activeValue,activeIndex=_ref.activeIndex,comparisonMetric=_ref.comparisonMetric,labelFormatter=_ref.labelFormatter,isAnimated=_ref.isAnimated,renderInnerValueContent=_ref.renderInnerValueContent,totalValue=_ref.totalValue,selectedTheme=Object(useTheme.a)(),animatedValue=Object(react_spring_web_esm.useSpring)({animatedValue:totalValue,from:{animatedValue:0},config:react_spring_web_esm.config.stiff,default:{immediate:!isAnimated}}).animatedValue,animatedTotalValue=Object(jsx_runtime.jsx)(react_spring_web_esm.animated.span,{children:animatedValue.to((function(value){return animatedValue.isPaused?labelFormatter(value):labelFormatter(Math.abs(Math.floor(value)))}))}),activeValueExists=null!=activeValue,valueToDisplay=activeValueExists?labelFormatter(activeValue):animatedTotalValue,innerContent=null!=(_renderInnerValueCont=null==renderInnerValueContent?void 0:renderInnerValueContent({activeValue:activeValue,activeIndex:activeIndex,animatedTotalValue:animatedTotalValue,totalValue:totalValue}))?_renderInnerValueCont:Object(jsx_runtime.jsxs)(react.Fragment,{children:[Object(jsx_runtime.jsx)(react_spring_web_esm.animated.p,{className:Object(classnames.a)(DonutChart_default.a.ContentValue),style:{color:selectedTheme.xAxis.labelColor},children:valueToDisplay}),null!=comparisonMetric&&!activeValueExists&&Object(jsx_runtime.jsx)("div",{className:DonutChart_default.a.ComparisonMetric,children:Object(jsx_runtime.jsx)(ComparisonMetric.a,{metric:comparisonMetric.metric,trend:comparisonMetric.trend,accessibilityLabel:comparisonMetric.accessibilityLabel})})]});return Object(jsx_runtime.jsx)("div",{className:DonutChart_default.a.ContentWrapper,children:innerContent})}try{InnerValue.displayName="InnerValue",InnerValue.__docgenInfo={description:"",displayName:"InnerValue",props:{activeValue:{defaultValue:null,description:"",name:"activeValue",required:!0,type:{name:"number"}},activeIndex:{defaultValue:null,description:"",name:"activeIndex",required:!0,type:{name:"number"}},labelFormatter:{defaultValue:null,description:"",name:"labelFormatter",required:!0,type:{name:"LabelFormatter"}},isAnimated:{defaultValue:null,description:"",name:"isAnimated",required:!0,type:{name:"boolean"}},totalValue:{defaultValue:null,description:"",name:"totalValue",required:!0,type:{name:"number"}},comparisonMetric:{defaultValue:null,description:"",name:"comparisonMetric",required:!1,type:{name:"ComparisonMetricProps"}},renderInnerValueContent:{defaultValue:null,description:"",name:"renderInnerValueContent",required:!1,type:{name:"RenderInnerValueContent"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/DonutChart/components/InnerValue/InnerValue.tsx#InnerValue"]={docgenInfo:InnerValue.__docgenInfo,name:"InnerValue",path:"packages/polaris-viz/src/components/DonutChart/components/InnerValue/InnerValue.tsx#InnerValue"})}catch(__react_docgen_typescript_loader_error){}function Chart_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function Chart_objectSpread(target){for(var i=1;iprevious?estimatedLegendWidth:previous}),0),shouldUseColorVisionEvents=Boolean(width&&height&&isLegendMounted);if(Object(useColorVisionEvents.a)({enabled:shouldUseColorVisionEvents,dimensions:Chart_objectSpread(Chart_objectSpread({},dimensions),{},{x:0,y:0})}),Object(useWatchColorVisionEvents.a)({type:constants.q,onIndexChange:function onIndexChange(_ref2){var detail=_ref2.detail;setActiveIndex(detail.index)}}),!width||!height)return null;var diameter=Math.min(height,width),radius=diameter/2,points=data.reduce((function(prev,_ref3){var data=_ref3.data;return prev.concat(data)}),[]),pieChartData=Object(pie.a)().value((function(_ref4){return _ref4.value})).sort(null)(points),emptyState=0===pieChartData.length,totalValue=total||points.reduce((function(acc,_ref5){var value=_ref5.value;return(null!=value?value:0)+acc}),0),activeValue=null==(_points$activeIndex=points[activeIndex])?void 0:_points$activeIndex.value,viewBoxDimensions_height=diameter+20,viewBoxDimensions_width=diameter+20- -80,containerAlignmentStyle=Object(getContainerAlignmentForLegend.a)(legendPosition),shouldRenderLegendContentWithValues=!renderLegendContent&&showLegendValues&&("right"===legendPosition||"left"===legendPosition),isCornerPosition=legendPosition.includes("-");return Object(jsx_runtime.jsxs)("div",{className:DonutChart_default.a.DonutWrapper,style:containerAlignmentStyle,children:[Object(jsx_runtime.jsx)("div",{className:DonutChart_default.a.Donut,children:state===types.a.Success?Object(jsx_runtime.jsxs)(react.Fragment,{children:[Object(jsx_runtime.jsx)("span",{className:DonutChart_default.a.VisuallyHidden,children:accessibilityLabel}),Object(jsx_runtime.jsx)("svg",{viewBox:"-80 -40 "+viewBoxDimensions_width+" "+viewBoxDimensions_height,height:diameter,width:diameter,children:isLegendMounted&&Object(jsx_runtime.jsx)("g",{className:DonutChart_default.a.DonutChart,children:emptyState?Object(jsx_runtime.jsx)("g",{"aria-hidden":!0,children:Object(jsx_runtime.jsx)(Arc.a,{isAnimated:shouldAnimate,width:diameter,height:diameter,radius:radius,startAngle:0,endAngle:FULL_CIRCLE,color:selectedTheme.grid.color,cornerRadius:selectedTheme.arc.cornerRadius,thickness:selectedTheme.arc.thickness})}):pieChartData.map((function(_ref7,index){var _data$index$color,_data$index,count,scalingFactor,pieData=_ref7.data,startAngle=_ref7.startAngle,endAngle=_ref7.endAngle,color=null!=(_data$index$color=null==(_data$index=data[index])?void 0:_data$index.color)?_data$index$color:seriesColor[index],accessibilityLabel=data[index].name+": "+pieData.key+" - "+pieData.value;return Object(jsx_runtime.jsx)("g",{className:DonutChart_default.a.DonutChart,"aria-label":accessibilityLabel,role:"img",children:Object(jsx_runtime.jsx)(Arc.a,{isAnimated:shouldAnimate,animationDelay:(count=pieChartData.length,scalingFactor=.1*count,Math.min(src_constants.f/scalingFactor,src_constants.f)),index:index,activeIndex:activeIndex,width:diameter,height:diameter,radius:radius,startAngle:startAngle,endAngle:endAngle,color:color,cornerRadius:selectedTheme.arc.cornerRadius,thickness:selectedTheme.arc.thickness})},chartId+"-arc-"+index)}))})}),Object(jsx_runtime.jsx)(InnerValue,{activeValue:activeValue,activeIndex:activeIndex,isAnimated:shouldAnimate,totalValue:totalValue,comparisonMetric:comparisonMetric,labelFormatter:labelFormatter,renderInnerValueContent:renderInnerValueContent})]}):Object(jsx_runtime.jsx)(ChartSkeleton.a,{dimensions:{width:diameter,height:diameter},state:state,type:"Donut",errorText:errorText,theme:theme})}),showLegend&&Object(jsx_runtime.jsx)(LegendContainer.a,{fullWidth:legendFullWidth,onDimensionChange:setLegendDimensions,colorVisionType:constants.q,data:legend,direction:legendDirection,position:legendPosition,maxWidth:maxLegendWidth,enableHideOverflow:!isCornerPosition,dimensions:Chart_objectSpread(Chart_objectSpread({},dimensions),{},{x:0,y:0}),renderLegendContent:shouldRenderLegendContentWithValues?function renderLegendContentWithValues(_ref6){var getColorVisionStyles=_ref6.getColorVisionStyles,getColorVisionEventAttrs=_ref6.getColorVisionEventAttrs;return Object(jsx_runtime.jsx)(LegendValues_LegendValues,{data:data,activeIndex:activeIndex,labelFormatter:labelFormatter,longestLegendValueWidth:longestLegendValueWidth,getColorVisionStyles:getColorVisionStyles,getColorVisionEventAttrs:getColorVisionEventAttrs,dimensions:Chart_objectSpread(Chart_objectSpread({},dimensions),{},{x:0,y:0}),renderHiddenLegendLabel:renderHiddenLegendLabel,seriesNameFormatter:seriesNameFormatter})}:renderLegendContent})]})}try{Chart.displayName="Chart",Chart.__docgenInfo={description:"",displayName:"Chart",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"DataSeries[]"}},labelFormatter:{defaultValue:null,description:"",name:"labelFormatter",required:!0,type:{name:"LabelFormatter"}},legendPosition:{defaultValue:{value:"right"},description:"",name:"legendPosition",required:!1,type:{name:"LegendPosition"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!0,type:{name:"LabelFormatter"}},showLegend:{defaultValue:null,description:"",name:"showLegend",required:!0,type:{name:"boolean"}},showLegendValues:{defaultValue:null,description:"",name:"showLegendValues",required:!0,type:{name:"boolean"}},state:{defaultValue:null,description:"",name:"state",required:!0,type:{name:"ChartState"}},theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}},accessibilityLabel:{defaultValue:{value:""},description:"",name:"accessibilityLabel",required:!1,type:{name:"string"}},comparisonMetric:{defaultValue:null,description:"",name:"comparisonMetric",required:!1,type:{name:"ComparisonMetricProps"}},dimensions:{defaultValue:{value:"{height: 0, width: 0}"},description:"",name:"dimensions",required:!1,type:{name:"Dimensions"}},errorText:{defaultValue:null,description:"",name:"errorText",required:!1,type:{name:"string"}},legendFullWidth:{defaultValue:{value:"false"},description:"",name:"legendFullWidth",required:!1,type:{name:"boolean"}},renderInnerValueContent:{defaultValue:null,description:"",name:"renderInnerValueContent",required:!1,type:{name:"RenderInnerValueContent"}},renderLegendContent:{defaultValue:null,description:"",name:"renderLegendContent",required:!1,type:{name:"RenderLegendContent"}},renderHiddenLegendLabel:{defaultValue:null,description:"",name:"renderHiddenLegendLabel",required:!1,type:{name:"RenderHiddenLegendLabel"}},total:{defaultValue:null,description:"",name:"total",required:!1,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/DonutChart/Chart.tsx#Chart"]={docgenInfo:Chart.__docgenInfo,name:"Chart",path:"packages/polaris-viz/src/components/DonutChart/Chart.tsx#Chart"})}catch(__react_docgen_typescript_loader_error){}function DonutChart_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function DonutChart_objectSpread(target){for(var i=1;i"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/FunnelChart/components/Label.tsx#Label"]={docgenInfo:Label_Label.__docgenInfo,name:"Label",path:"packages/polaris-viz/src/components/FunnelChart/components/Label.tsx#Label"})}catch(__react_docgen_typescript_loader_error){}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function FunnelSegment(_ref){var barWidth=_ref.barWidth,barHeight=_ref.barHeight,drawableHeight=_ref.drawableHeight,x=_ref.x,ariaLabel=_ref.ariaLabel,_ref$index=_ref.index,index=void 0===_ref$index?0:_ref$index,color=_ref.color,connector=_ref.connector,isLast=_ref.isLast,portalTo=_ref.portalTo,percentLabel=_ref.percentLabel,formattedYValue=_ref.formattedYValue,labelHelper=_ref.labelHelper,selectedTheme=Object(useTheme.a)(),mounted=Object(react.useRef)(!1),borderRadius=selectedTheme.bar.borderRadius,_useTheme=Object(useTheme.a)(),axisLabelColor=_useTheme.xAxis.labelColor,backgroundColor=_useTheme.chartContainer.backgroundColor,springConfig=Object(useBarSpringConfig.a)({animationDelay:150*index}),_useSpring=Object(react_spring_web_esm.useSpring)(function _objectSpread(target){for(var i=1;i>"}},x:{defaultValue:null,description:"",name:"x",required:!0,type:{name:"number"}},index:{defaultValue:null,description:"",name:"index",required:!0,type:{name:"number"}},chartX:{defaultValue:null,description:"",name:"chartX",required:!0,type:{name:"number"}},chartY:{defaultValue:null,description:"",name:"chartY",required:!0,type:{name:"number"}},labelWidth:{defaultValue:null,description:"",name:"labelWidth",required:!0,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/FunnelChart/components/FunnelChartXAxisArrows.tsx#FunnelChartXAxisArrows"]={docgenInfo:FunnelChartXAxisArrows.__docgenInfo,name:"FunnelChartXAxisArrows",path:"packages/polaris-viz/src/components/FunnelChart/components/FunnelChartXAxisArrows.tsx#FunnelChartXAxisArrows"})}catch(__react_docgen_typescript_loader_error){}function FunnelChartXAxisLabels(_ref){var allowLineWrap=_ref.allowLineWrap,chartX=_ref.chartX,chartY=_ref.chartY,labels=_ref.labels,labelWidth=_ref.labelWidth,onHeightChange=_ref.onHeightChange,reducedLabelIndexes=_ref.reducedLabelIndexes,xScale=_ref.xScale,lines=Object(useLabels.a)({allowLineWrap:allowLineWrap,labels:labels,targetWidth:labelWidth,onHeightChange:onHeightChange}).lines;return Object(jsx_runtime.jsx)(react.Fragment,{children:lines.map((function(line,index){var _xScale;if(Object(shouldSkipLabel.a)(index,reducedLabelIndexes))return null;var x=null!=(_xScale=xScale(index.toString()))?_xScale:0;return Object(jsx_runtime.jsxs)("g",{children:[0===index?null:Object(jsx_runtime.jsx)(FunnelChartXAxisArrows,{onHeightChange:onHeightChange,x:x,index:index,chartX:chartX,chartY:chartY,labelWidth:labelWidth}),Object(jsx_runtime.jsx)("g",{transform:"translate("+(chartX+x)+","+chartY+")",children:Object(jsx_runtime.jsx)(TextLine.a,{line:line,index:index})},index)]},"label-group-"+index)}))})}try{FunnelChartXAxisLabels.displayName="FunnelChartXAxisLabels",FunnelChartXAxisLabels.__docgenInfo={description:"",displayName:"FunnelChartXAxisLabels",props:{allowLineWrap:{defaultValue:null,description:"",name:"allowLineWrap",required:!0,type:{name:"boolean"}},chartX:{defaultValue:null,description:"",name:"chartX",required:!0,type:{name:"number"}},chartY:{defaultValue:null,description:"",name:"chartY",required:!0,type:{name:"number"}},labels:{defaultValue:null,description:"",name:"labels",required:!0,type:{name:"string[]"}},labelWidth:{defaultValue:null,description:"",name:"labelWidth",required:!0,type:{name:"number"}},onHeightChange:{defaultValue:null,description:"",name:"onHeightChange",required:!0,type:{name:"Dispatch>"}},xScale:{defaultValue:null,description:"",name:"xScale",required:!0,type:{name:"ScaleBand"}},reducedLabelIndexes:{defaultValue:null,description:"",name:"reducedLabelIndexes",required:!1,type:{name:"number[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/FunnelChart/components/FunnelChartXAxisLabels.tsx#FunnelChartXAxisLabels"]={docgenInfo:FunnelChartXAxisLabels.__docgenInfo,name:"FunnelChartXAxisLabels",path:"packages/polaris-viz/src/components/FunnelChart/components/FunnelChartXAxisLabels.tsx#FunnelChartXAxisLabels"})}catch(__react_docgen_typescript_loader_error){}function Chart(_ref){var data=_ref.data,dimensions=_ref.dimensions,xAxisOptions=_ref.xAxisOptions,yAxisOptions=_ref.yAxisOptions,labelHelpers=_ref.labelHelpers,theme=Object(useChartContext.a)().theme,selectedTheme=Object(useTheme.a)(),_useState=Object(react.useState)(constants.X),_useState2=slicedToArray_default()(_useState,2),xAxisHeight=_useState2[0],setXAxisHeight=_useState2[1],dataSeries=data[0].data,colorOverride=data[0].color,_useState3=Object(react.useState)(null),_useState4=slicedToArray_default()(_useState3,2),maskRef=_useState4[0],setMaskRef=_useState4[1],xValues=dataSeries.map((function(_ref2){return _ref2.key})),yValues=dataSeries.map((function(_ref3){return _ref3.value})),_ref4=dimensions||{width:0,height:0},width=_ref4.width,height=_ref4.height,labels=Object(react.useMemo)((function(){return dataSeries.map((function(_ref5){var key=_ref5.key;return xAxisOptions.labelFormatter(key)}))}),[dataSeries,xAxisOptions]),xScale=Object(band.a)().domain(xValues).range([0,width]).paddingInner(.5),labelXScale=Object(band.a)().range([0,width]).paddingInner(.5).paddingOuter(0).domain(labels.map((function(_,index){return index.toString()}))),drawableHeight=height-xAxisHeight-16,yScale=Object(linear.a)().range([0,drawableHeight-src_constants.c]).domain([0,Math.max.apply(Math,toConsumableArray_default()(yValues))]),barWidth=xScale.bandwidth(),getBarHeight=Object(react.useCallback)((function(rawValue){var rawHeight=Math.abs(yScale(rawValue)-yScale(0));return rawHeight1?barsGradient[1].color:barsGradient[0].color),connectorGradientId=Object(react.useMemo)((function(){return Object(uniqueId.a)("connector-gradient")}),[]),connectorGradient=[{color:Object(changeColorOpacity.a)(averageColor,.2),offset:0},{color:Object(changeColorOpacity.a)(averageColor,0),offset:100}],gradientId=Object(react.useMemo)((function(){return Object(uniqueId.a)("gradient")}),[]),maskId=Object(react.useMemo)((function(){return Object(uniqueId.a)("mask")}),[]);return Object(jsx_runtime.jsxs)(ChartElements.a.Svg,{height:height,width:width,children:[Object(jsx_runtime.jsx)(LinearGradientWithStops.a,{gradient:connectorGradient,id:connectorGradientId,x1:"0%",x2:"0%",y1:"100%",y2:"0%"}),Object(jsx_runtime.jsx)(LinearGradientWithStops.a,{gradient:barsGradient,id:""+gradientId}),Object(jsx_runtime.jsx)("mask",{ref:setMaskRef,id:maskId+"-"+theme+"-grad"}),dataSeries.map((function(dataPoint,index){var nextPoint=dataSeries[index+1],xPosition=xScale(dataPoint.key),x=null==xPosition?0:xPosition,nextBarHeight=getBarHeight((null==nextPoint?void 0:nextPoint.value)||0),yAxisValue=dataPoint.value,percentCalculation=null!=nextPoint&&nextPoint.value&&yAxisValue?nextPoint.value/yAxisValue*100:0,barHeight=getBarHeight(dataPoint.value||0),percentLabel=function handlePercentLabelFormatter(percentCalculation){var percentRounded=Math.round(percentCalculation);return percentCalculation?yAxisOptions.labelFormatter(percentRounded)+"%":""}(percentCalculation),formattedYValue=yAxisOptions.labelFormatter(yAxisValue),labelHelper=null==labelHelpers?void 0:labelHelpers.find((function(helper){return helper.key===dataPoint.key}));return Object(jsx_runtime.jsx)(react.Fragment,{children:maskRef&&Object(jsx_runtime.jsx)("g",{role:"listitem",children:Object(jsx_runtime.jsx)(FunnelSegment,{percentLabel:percentLabel,labelHelper:labelHelper&&labelHelper.value,formattedYValue:formattedYValue,isLast:index===dataSeries.length-1,connector:{height:drawableHeight,startX:x+barWidth,startY:drawableHeight-barHeight,nextX:xScale(null==nextPoint?void 0:nextPoint.key),nextY:drawableHeight-nextBarHeight,nextPoint:nextPoint,fill:"url(#"+connectorGradientId+")"},ariaLabel:xAxisOptions.labelFormatter(dataPoint.key)+": "+yAxisOptions.labelFormatter(dataPoint.value),barWidth:barWidth,barHeight:barHeight,color:constants.Z,x:x,portalTo:maskRef,index:index,drawableHeight:drawableHeight})},dataPoint.key)},dataPoint.key)})),Object(jsx_runtime.jsx)("g",{"aria-hidden":"true",children:Object(jsx_runtime.jsx)(FunnelChartXAxisLabels,{allowLineWrap:xAxisOptions.allowLineWrap,chartX:barWidth/-4,chartY:drawableHeight+16,labels:labels,labelWidth:barWidth+barWidth/2,onHeightChange:setXAxisHeight,reducedLabelIndexes:reducedLabelIndexes,xScale:labelXScale})}),Object(jsx_runtime.jsx)("rect",{mask:"url(#"+maskId+"-"+theme+"-grad)",x:0,y:0,width:width,height:drawableHeight,fill:"url(#"+gradientId+")",style:{pointerEvents:"none"}})]})}try{Chart.displayName="Chart",Chart.__docgenInfo={description:"",displayName:"Chart",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"DataSeries[]"}},xAxisOptions:{defaultValue:null,description:"",name:"xAxisOptions",required:!0,type:{name:"XAxisOptions"}},yAxisOptions:{defaultValue:null,description:"",name:"yAxisOptions",required:!0,type:{name:"YAxisOptions"}},dimensions:{defaultValue:null,description:"",name:"dimensions",required:!1,type:{name:"Dimensions"}},labelHelpers:{defaultValue:null,description:"",name:"labelHelpers",required:!1,type:{name:"LabelHelpers[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/FunnelChart/Chart.tsx#Chart"]={docgenInfo:Chart.__docgenInfo,name:"Chart",path:"packages/polaris-viz/src/components/FunnelChart/Chart.tsx#Chart"})}catch(__react_docgen_typescript_loader_error){}function FunnelChart_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function FunnelChart_objectSpread(target){for(var i=1;i0}));skipEndWordTruncate?truncatedLabels[index].truncatedWords.push(truncatedLabels[index].text):words.forEach((function(word){var wordWidth=Object(estimateStringWidth.a)(word,characterWidths);truncatedLabels[index].words.push({word:word,wordWidth:wordWidth}),wordWidth>targetWidth?truncatedLabels[index].truncatedWords.push(endWordTruncate({word:word,targetWidth:targetWidth,characterWidths:characterWidths})):truncatedLabels[index].truncatedWords.push(word)})),truncatedLabels[index].truncatedName=truncatedLabels[index].truncatedWords.join(" "),truncatedLabels[index].truncatedName=Object(endLineTruncate.a)({label:truncatedLabels[index].truncatedName,targetWidth:targetWidth,targetHeight:targetHeight,characterWidths:characterWidths}),truncatedLabels[index].truncatedWidth=Object(estimateStringWidth.a)(truncatedLabels[index].truncatedName,characterWidths),truncatedLabels[index].truncatedWords=truncatedLabels[index].truncatedName.split(" ")})),truncatedLabels}function useLabels(_ref){var allowLineWrap=_ref.allowLineWrap,labels=_ref.labels,_ref$onHeightChange=_ref.onHeightChange,onHeightChange=void 0===_ref$onHeightChange?function(){}:_ref$onHeightChange,targetWidth=_ref.targetWidth,characterWidths=Object(useChartContext.a)().characterWidths,preparedLabels=Object(react.useMemo)((function(){return labels.map((function(label){return{text:label,words:[],truncatedWords:[],truncatedName:"",truncatedWidth:0}}))}),[labels]),longestLabelWidth=Object(react.useMemo)((function(){return labels.reduce((function(prev,string){var newWidth=Object(estimateStringWidth.a)(string,characterWidths);return newWidth>prev?newWidth:prev}),0)}),[labels,characterWidths]),_useMemo=Object(react.useMemo)((function(){var shouldDrawHorizontal=function checkIfShouldDrawHorizontal(_ref2){var allowLineWrap=_ref2.allowLineWrap,longestLabelWidth=_ref2.longestLabelWidth,targetWidth=_ref2.targetWidth,isLabelLongerThanTarget=targetWidth>longestLabelWidth;if(!1===allowLineWrap)return isLabelLongerThanTarget;return targetWidth>=constants.H||isLabelLongerThanTarget}({allowLineWrap:allowLineWrap,longestLabelWidth:longestLabelWidth,targetWidth:targetWidth}),shouldDrawDiagonal=targetWidth>constants.y,shouldDrawVertical=targetWidth>constants.kb;switch(!0){case shouldDrawHorizontal:return function getHorizontalLabels(_ref){var labels=_ref.labels,targetHeight=_ref.targetHeight,targetWidth=_ref.targetWidth,characterWidths=_ref.characterWidths,truncatedLabels=truncateLabels({labels:labels,targetWidth:targetWidth,targetHeight:targetHeight,characterWidths:characterWidths}),lines=[],longestLineCount=0;return truncatedLabels.forEach((function(label,index){lines[index]=[];for(var line="",lineNumber=0,words=label.truncatedWords,wordIndex=0;wordIndextargetWidth&&(words[wordIndex]=endWordTruncate({word:words[wordIndex],targetWidth:targetWidth,characterWidths:characterWidths})),line+=words[wordIndex];null!=words[wordIndex+1]&&Object(estimateStringWidth.a)(line+" "+words[wordIndex+1],characterWidths)longestLineCount&&(longestLineCount=lineNumber)}})),{lines:lines,containerHeight:longestLineCount*constants.X}}({labels:preparedLabels,targetWidth:targetWidth,targetHeight:constants.I,characterWidths:characterWidths});case shouldDrawDiagonal:return function getDiagonalLabels(_ref){for(var characterWidths=_ref.characterWidths,labels=_ref.labels,longestLabelWidth=_ref.longestLabelWidth,targetHeight=_ref.targetHeight,targetWidth=_ref.targetWidth,clampedTargetWidth=Object(clamp.a)({amount:longestLabelWidth,min:targetWidth,max:constants.ab}),truncatedLabels=truncateLabels({labels:labels,targetWidth:clampedTargetWidth,targetHeight:targetHeight,characterWidths:characterWidths,skipEndWordTruncate:!0}),lines=[],centerPoint=targetWidth/2-constants.X/2,i=0;ilongestWidth&&(longestIndex=index,longestWidth=truncatedWidth)})),labels[longestIndex]}(truncatedLabels),truncatedWidth=_getWidestLabel.truncatedWidth;return{lines:lines,containerHeight:Object(clamp.a)({amount:(width=truncatedWidth,angle=45,originalHeight=targetHeight,radians=Math.PI/180*angle,hypotenuse=width*Math.sin(radians),opp=originalHeight*Math.cos(radians),Math.round(hypotenuse+opp)),min:0,max:constants.bb})}}({characterWidths:characterWidths,labels:preparedLabels,longestLabelWidth:longestLabelWidth,targetHeight:constants.X,targetWidth:targetWidth});case shouldDrawVertical:return function getVerticalLabels(_ref){for(var labels=_ref.labels,characterWidths=_ref.characterWidths,longestLabelWidth=_ref.longestLabelWidth,targetWidth=_ref.targetWidth,clampedTargetWidth=Object(clamp.a)({amount:longestLabelWidth,min:targetWidth,max:constants.lb}),truncatedLabels=truncateLabels({labels:labels,targetWidth:clampedTargetWidth,targetHeight:constants.X,characterWidths:characterWidths,skipEndWordTruncate:!0}),lines=[],longestString=0,i=0;ilongestString&&(longestString=truncatedLabels[i].truncatedWidth);return{lines:lines,containerHeight:longestString}}({characterWidths:characterWidths,labels:preparedLabels,longestLabelWidth:longestLabelWidth,targetWidth:targetWidth});default:return{lines:[],containerHeight:0}}}),[allowLineWrap,targetWidth,characterWidths,preparedLabels,longestLabelWidth]),lines=_useMemo.lines,containerHeight=_useMemo.containerHeight;return Object(react.useEffect)((function(){onHeightChange(containerHeight)}),[containerHeight,onHeightChange]),{lines:lines,containerHeight:containerHeight}}try{useLabels.displayName="useLabels",useLabels.__docgenInfo={description:"",displayName:"useLabels",props:{allowLineWrap:{defaultValue:null,description:"",name:"allowLineWrap",required:!0,type:{name:"boolean"}},labels:{defaultValue:null,description:"",name:"labels",required:!0,type:{name:"string[]"}},targetWidth:{defaultValue:null,description:"",name:"targetWidth",required:!0,type:{name:"number"}},onHeightChange:{defaultValue:{value:"() => {}"},description:"",name:"onHeightChange",required:!1,type:{name:"Dispatch> | (() => void)"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Labels/hooks/useLabels.tsx#useLabels"]={docgenInfo:useLabels.__docgenInfo,name:"useLabels",path:"packages/polaris-viz/src/components/Labels/hooks/useLabels.tsx#useLabels"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Labels/utilities/endLineTruncate.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return endLineTruncate}));var constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),estimateStringWidth=(__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./packages/polaris-viz-core/src/utilities/estimateStringWidth.ts"));function estimateTextHeight(_ref){var characterWidths=_ref.characterWidths,targetWidth=_ref.targetWidth,words=_ref.label.split(" "),lines=0,lineWidth=0;return words.forEach((function(_,index){var wordParts=words[index].split("-");lines+=wordParts.length;var wordWidth=Object(estimateStringWidth.a)(words[index],characterWidths);(lineWidth+=wordWidth)>targetWidth&&(lines+=1,lineWidth=wordWidth)})),lines*constants.X}__webpack_require__("./node_modules/core-js/modules/es.string.trim-end.js"),__webpack_require__("./node_modules/core-js/modules/es.string.ends-with.js");function formatAndAddEllipsis(label){var newLabel=label.trimEnd();return newLabel.endsWith("-")&&(newLabel=newLabel.substring(0,newLabel.length-1)),""+newLabel+constants.z}function endLineTruncate(_ref){var label=_ref.label,targetWidth=_ref.targetWidth,targetHeight=_ref.targetHeight,characterWidths=_ref.characterWidths;return targetHeight<=constants.X?function truncateSingleLine(_ref){var characterWidths=_ref.characterWidths,label=_ref.label,targetWidth=_ref.targetWidth;if(Object(estimateStringWidth.a)(label,characterWidths)<=targetWidth)return label;for(var characters=label.split(""),width=0,newLabel="",index=0;width<=targetWidth-characterWidths[constants.z];)width+=characterWidths[characters[index]],newLabel+=characters[index],index++;return formatAndAddEllipsis(newLabel)}({label:label,targetWidth:targetWidth,characterWidths:characterWidths}):function truncateLastLine(_ref){var label=_ref.label,targetHeight=_ref.targetHeight,targetWidth=_ref.targetWidth,characterWidths=_ref.characterWidths,newLabel=label,lineStart=0,lineEnd=label.length,counter=0;if(lineEndtargetHeight&&(lineEnd=middle-1),newLabelHeight"}},backgroundColor:{defaultValue:null,description:"",name:"backgroundColor",required:!1,type:{name:"string"}},indexOffset:{defaultValue:{value:"0"},description:"",name:"indexOffset",required:!1,type:{name:"number"}},truncate:{defaultValue:{value:"false"},description:"",name:"truncate",required:!1,type:{name:"boolean"}},showLegendValues:{defaultValue:{value:"false"},description:"",name:"showLegendValues",required:!1,type:{name:"boolean"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!1,type:{name:"LabelFormatter"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Legend/Legend.tsx#Legend"]={docgenInfo:Legend.__docgenInfo,name:"Legend",path:"packages/polaris-viz/src/components/Legend/Legend.tsx#Legend"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return LegendItem_LegendItem}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js"),slicedToArray_default=__webpack_require__.n(slicedToArray),getColorVisionEventAttrs=__webpack_require__("./packages/polaris-viz-core/src/utilities/getColorVisionEventAttrs.ts"),getColorVisionStylesForActiveIndex=__webpack_require__("./packages/polaris-viz-core/src/utilities/getColorVisionStylesForActiveIndex.ts"),react=__webpack_require__("./node_modules/react/index.js"),constants=__webpack_require__("./packages/polaris-viz/src/constants.ts"),SeriesIcon=__webpack_require__("./packages/polaris-viz/src/components/shared/SeriesIcon/SeriesIcon.tsx"),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),LegendItem=__webpack_require__("./packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.scss"),LegendItem_default=__webpack_require__.n(LegendItem),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i ReactNode"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"string"}},onDimensionChange:{defaultValue:null,description:"",name:"onDimensionChange",required:!1,type:{name:"({ width, height }: LegendItemDimension) => void"}},backgroundColor:{defaultValue:null,description:"",name:"backgroundColor",required:!1,type:{name:"string"}},truncate:{defaultValue:{value:"false"},description:"",name:"truncate",required:!1,type:{name:"boolean"}},showLegendValues:{defaultValue:{value:"false"},description:"",name:"showLegendValues",required:!1,type:{name:"boolean"}},seriesNameFormatter:{defaultValue:{value:"(value) => `${value}`"},description:"",name:"seriesNameFormatter",required:!1,type:{name:"LabelFormatter"}},name:{defaultValue:null,description:"",name:"name",required:!0,type:{name:"string"}},color:{defaultValue:null,description:"",name:"color",required:!0,type:{name:"Color"}},isComparison:{defaultValue:null,description:"",name:"isComparison",required:!1,type:{name:"boolean"}},shape:{defaultValue:null,description:"",name:"shape",required:!1,type:{name:"Shape"}},value:{defaultValue:null,description:"",name:"value",required:!1,type:{name:"string"}},trend:{defaultValue:null,description:"",name:"trend",required:!1,type:{name:"MetaDataTrendIndicator"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.tsx#LegendItem"]={docgenInfo:LegendItem_LegendItem.__docgenInfo,name:"LegendItem",path:"packages/polaris-viz/src/components/Legend/components/LegendItem/LegendItem.tsx#LegendItem"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/Legend/stories sync ^\\.[\\\\/](?:Legend\\.stories\\.tsx)$":function(module,exports,__webpack_require__){var map={"./Legend.stories.tsx":"./packages/polaris-viz/src/components/Legend/stories/Legend.stories.tsx"};function webpackContext(req){var id=webpackContextResolve(req);return __webpack_require__(id)}function webpackContextResolve(req){if(!__webpack_require__.o(map,req)){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}return map[req]}webpackContext.keys=function webpackContextKeys(){return Object.keys(map)},webpackContext.resolve=webpackContextResolve,module.exports=webpackContext,webpackContext.id="./packages/polaris-viz/src/components/Legend/stories sync ^\\.[\\\\/](?:Legend\\.stories\\.tsx)$"},"./packages/polaris-viz/src/components/Legend/stories/Legend.stories.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"default",(function(){return META})),__webpack_require__.d(__webpack_exports__,"Default",(function(){return Default}));__webpack_require__("./node_modules/core-js/modules/es.function.bind.js");var constants=__webpack_require__("./packages/polaris-viz/src/storybook/constants.ts"),Legend=__webpack_require__("./packages/polaris-viz/src/components/Legend/Legend.tsx"),META={title:"polaris-viz/Subcomponents/Legend",component:Legend.a,parameters:{docs:{description:{component:"Used to indicate which color is associated with which series. The color preview will appear as a square unless a `shape` is passed to `LegendData`.

All charts except spark charts and `SimpleNormalizedChart` include a `Legend` by default."}},controls:constants.c},argTypes:{data:{description:"`name` and `color` props should be passed to each legend to display a title and a color icon. `isComparison`, `shape` and `value` props are optional."},colorVisionType:{table:{disable:!0}},theme:constants.r}},defineProperty=(__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js")),defineProperty_default=__webpack_require__.n(defineProperty),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i"}},direction:{defaultValue:{value:"horizontal"},description:"",name:"direction",required:!1,type:{name:"Direction"}},fullWidth:{defaultValue:{value:"false"},description:"",name:"fullWidth",required:!1,type:{name:"boolean"}},position:{defaultValue:{value:"bottom-right"},description:"",name:"position",required:!1,type:{name:"LegendPosition"}},maxWidth:{defaultValue:null,description:"",name:"maxWidth",required:!1,type:{name:"number"}},renderLegendContent:{defaultValue:null,description:"",name:"renderLegendContent",required:!1,type:{name:"RenderLegendContent"}},enableHideOverflow:{defaultValue:{value:"false"},description:"",name:"enableHideOverflow",required:!1,type:{name:"boolean"}},renderHiddenLegendLabel:{defaultValue:{value:"(count) => `+${count} more`"},description:"",name:"renderHiddenLegendLabel",required:!1,type:{name:"RenderHiddenLegendLabel"}},dimensions:{defaultValue:null,description:"",name:"dimensions",required:!1,type:{name:"BoundingRect"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx#LegendContainer"]={docgenInfo:LegendContainer.__docgenInfo,name:"LegendContainer",path:"packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx#LegendContainer"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return HiddenLegendTooltip}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_9__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js"),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_10__),react__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./node_modules/react/index.js"),react_dom__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./node_modules/react-dom/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartContext.ts"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./packages/polaris-viz-core/src/utilities/changeColorOpacity.ts"),_constants__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./packages/polaris-viz/src/constants.ts"),_hooks_useBrowserCheck__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./packages/polaris-viz/src/hooks/useBrowserCheck.ts"),_hooks_useRootContainer__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("./packages/polaris-viz/src/hooks/useRootContainer.ts"),_hooks_ColorVisionA11y__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useColorVisionEvents.ts"),_TooltipWrapper__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("./packages/polaris-viz/src/components/TooltipWrapper/utilities.ts"),_Legend__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("./packages/polaris-viz/src/components/Legend/Legend.tsx"),_HiddenLegendTooltip_scss__WEBPACK_IMPORTED_MODULE_22__=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.scss"),_HiddenLegendTooltip_scss__WEBPACK_IMPORTED_MODULE_22___default=__webpack_require__.n(_HiddenLegendTooltip_scss__WEBPACK_IMPORTED_MODULE_22__),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i=window.innerHeight+window.scrollY?yPosition-tooltip.height-activator.height:yPosition}(),left:function getXPosition(){return xPosition+tooltip.width+_TooltipWrapper__WEBPACK_IMPORTED_MODULE_20__.a>window.innerWidth?xPosition-tooltip.width+activator.width:xPosition}()})}}),[setPosition]),handleMouseLeave=Object(react__WEBPACK_IMPORTED_MODULE_11__.useCallback)((function(event){(null==event?void 0:event.relatedTarget.id)!==tooltipId&&(setActive(!1),setPosition(defaultPosition))}),[setActive,setPosition,defaultPosition,tooltipId]);return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)(react__WEBPACK_IMPORTED_MODULE_11__.Fragment,{children:[Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)("button",{className:_HiddenLegendTooltip_scss__WEBPACK_IMPORTED_MODULE_22___default.a.MoreText,ref:activatorRef,onMouseEnter:getTooltipPosition,onMouseLeave:handleMouseLeave,onFocus:getTooltipPosition,onBlur:handleMouseLeave,style:{color:selectedTheme.legend.labelColor},children:label}),Object(react_dom__WEBPACK_IMPORTED_MODULE_12__.createPortal)(Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)("div",{className:_HiddenLegendTooltip_scss__WEBPACK_IMPORTED_MODULE_22___default.a.Tooltip,ref:tooltipRef,onMouseLeave:handleMouseLeave,onBlur:handleMouseLeave,id:tooltipId,style:_objectSpread({visibility:active?"visible":"hidden",zIndex:active?520:-1e5,background:Object(_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_15__.a)(selectedTheme.tooltip.backgroundColor,isFirefox?1:_constants__WEBPACK_IMPORTED_MODULE_16__.l)},position),children:Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_Legend__WEBPACK_IMPORTED_MODULE_21__.a,{activeIndex:activeIndex,colorVisionType:colorVisionType,data:data,theme:theme,indexOffset:lastVisibleIndex,backgroundColor:"transparent",seriesNameFormatter:seriesNameFormatter})}),container)]})}try{HiddenLegendTooltip.displayName="HiddenLegendTooltip",HiddenLegendTooltip.__docgenInfo={description:"",displayName:"HiddenLegendTooltip",props:{activeIndex:{defaultValue:null,description:"",name:"activeIndex",required:!0,type:{name:"number"}},colorVisionType:{defaultValue:null,description:"",name:"colorVisionType",required:!0,type:{name:"string"}},data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"LegendData[]"}},label:{defaultValue:null,description:"",name:"label",required:!0,type:{name:"ReactNode"}},setActivatorWidth:{defaultValue:null,description:"",name:"setActivatorWidth",required:!0,type:{name:"(width: number) => void"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"string"}},lastVisibleIndex:{defaultValue:{value:"0"},description:"",name:"lastVisibleIndex",required:!1,type:{name:"number"}},dimensions:{defaultValue:null,description:"",name:"dimensions",required:!1,type:{name:"BoundingRect"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!1,type:{name:"LabelFormatter"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.tsx#HiddenLegendTooltip"]={docgenInfo:HiddenLegendTooltip.__docgenInfo,name:"HiddenLegendTooltip",path:"packages/polaris-viz/src/components/LegendContainer/components/HiddenLegendTooltip.tsx#HiddenLegendTooltip"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/LegendContainer/hooks/useLegend.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return useLegend}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.array.flat.js");var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_16___default=__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_16__),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_17___default=__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_17__),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_18__=__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js"),_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_18___default=__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_18__),react__WEBPACK_IMPORTED_MODULE_19__=__webpack_require__("./node_modules/react/index.js"),_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_20__=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),_constants__WEBPACK_IMPORTED_MODULE_21__=__webpack_require__("./packages/polaris-viz/src/constants.ts"),_excluded=["color"];function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;iheight))return totalHeight+card.height;_lastVisibleIndex=index}),_lastVisibleIndex),{displayedData:allData.slice(0,_lastVisibleIndex||1),hiddenData:allData.slice(_lastVisibleIndex||1,allData.length)}}var width=props.width,leftMargin=props.leftMargin,horizontalMargin=props.horizontalMargin,activatorWidth=props.activatorWidth,lastVisibleIndex=allData.length,containerWidth=width-leftMargin-horizontalMargin-activatorWidth;return legendItemDimensions.current.reduce((function(totalWidth,card,index){if(!(totalWidth+card.width+10*index>containerWidth))return totalWidth+card.width;lastVisibleIndex=index}),lastVisibleIndex),{displayedData:allData.slice(0,lastVisibleIndex||1),hiddenData:allData.slice(lastVisibleIndex||1,allData.length)}}),[enableHideOverflow,legendItemDimensions,direction,props,allData]);return{displayedData:_useMemo.displayedData,hiddenData:_useMemo.hiddenData}}},"./packages/polaris-viz/src/components/LineChart/LineChart.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return LineChart}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),react=__webpack_require__("./node_modules/react/index.js"),usePolarisVizContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePolarisVizContext.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),uniqueId=__webpack_require__("./packages/polaris-viz-core/src/utilities/uniqueId.ts"),types=__webpack_require__("./packages/polaris-viz-core/src/types.ts"),getTooltipContentRenderer=__webpack_require__("./packages/polaris-viz/src/utilities/getTooltipContentRenderer.tsx"),fillMissingDataPoints=__webpack_require__("./packages/polaris-viz/src/utilities/fillMissingDataPoints.ts"),getLineChartDataWithDefaults=__webpack_require__("./packages/polaris-viz/src/utilities/getLineChartDataWithDefaults.ts"),ChartContainer=__webpack_require__("./packages/polaris-viz/src/components/ChartContainer/ChartContainer.tsx"),ChartSkeleton=__webpack_require__("./packages/polaris-viz/src/components/ChartSkeleton/ChartSkeleton.tsx"),useThemeSeriesColors=__webpack_require__("./packages/polaris-viz/src/hooks/useThemeSeriesColors.ts"),getAxisOptions=__webpack_require__("./packages/polaris-viz/src/utilities/getAxisOptions.ts"),normalizeData=__webpack_require__("./packages/polaris-viz/src/utilities/normalizeData.ts"),SkipLink=__webpack_require__("./packages/polaris-viz/src/components/SkipLink/SkipLink.tsx"),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),slicedToArray=(__webpack_require__("./node_modules/core-js/modules/es.array.every.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),slicedToArray_default=__webpack_require__.n(slicedToArray),useChartContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartContext.ts"),useYScale=__webpack_require__("./packages/polaris-viz-core/src/hooks/useYScale.ts"),useChartPositions=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartPositions.ts"),clamp=__webpack_require__("./packages/polaris-viz-core/src/utilities/clamp.ts"),LineSeries=__webpack_require__("./packages/polaris-viz-core/src/components/LineSeries/LineSeries.tsx"),useExternalHideEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ExternalEvents/useExternalHideEvents.ts"),useIndexForLabels=__webpack_require__("./packages/polaris-viz/src/hooks/useIndexForLabels.ts"),checkAvailableAnnotations=__webpack_require__("./packages/polaris-viz/src/components/Annotations/utilities/checkAvailableAnnotations.ts"),Annotations=__webpack_require__("./packages/polaris-viz/src/components/Annotations/Annotations.tsx"),YAxisAnnotations=__webpack_require__("./packages/polaris-viz/src/components/Annotations/YAxisAnnotations.tsx"),useFormattedLabels=__webpack_require__("./packages/polaris-viz/src/hooks/useFormattedLabels.ts"),XAxis=__webpack_require__("./packages/polaris-viz/src/components/XAxis/XAxis.tsx"),useLegend=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/hooks/useLegend.ts"),LegendContainer=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx"),TooltipWrapper_constants=__webpack_require__("./packages/polaris-viz/src/components/TooltipWrapper/constants.ts"),TooltipWrapper=__webpack_require__("./packages/polaris-viz/src/components/TooltipWrapper/TooltipWrapper.tsx"),eventPoint=__webpack_require__("./packages/polaris-viz/src/utilities/eventPoint.ts"),useColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useColorVisionEvents.ts"),useWatchColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useWatchColorVisionEvents.tsx"),useLinearLabelsAndDimensions=__webpack_require__("./packages/polaris-viz/src/hooks/useLinearLabelsAndDimensions.ts"),src_constants=__webpack_require__("./packages/polaris-viz/src/constants.ts"),VisuallyHiddenRows=__webpack_require__("./packages/polaris-viz/src/components/VisuallyHiddenRows/VisuallyHiddenRows.tsx"),YAxis=__webpack_require__("./packages/polaris-viz/src/components/YAxis/YAxis.tsx"),HorizontalGridLines=__webpack_require__("./packages/polaris-viz/src/components/HorizontalGridLines/HorizontalGridLines.tsx"),ChartElements=__webpack_require__("./packages/polaris-viz/src/components/ChartElements/index.ts");__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js");var PointsAndCrosshair=__webpack_require__("./packages/polaris-viz/src/components/LineChart/components/PointsAndCrosshair/PointsAndCrosshair.tsx"),useFormatData=__webpack_require__("./packages/polaris-viz/src/components/LineChart/hooks/useFormatData.ts"),yAxisMinMax=__webpack_require__("./packages/polaris-viz/src/components/LineChart/utilities/yAxisMinMax.ts");function getAlteredLineChartPosition(props){var _chartBounds$y,currentX=props.currentX,currentY=props.currentY,chartBounds=props.chartBounds,x=currentX,y=currentY;props.isPerformanceImpacted&&(y=null!=(_chartBounds$y=chartBounds.y)?_chartBounds$y:0);var right=function getRightPosition(){for(var _len2=arguments.length,args=new Array(_len2),_key2=0;_key2<_len2;_key2++)args[_key2]=arguments[_key2];var value=args[0],props=args[1],x=value+props.bandwidth,wasOutsideBounds=isOutsideBounds({current:x,alteredPosition:props});wasOutsideBounds.right?x-=props.tooltipDimensions.width+props.bandwidth+20:x+=20;return{value:x,wasOutsideBounds:wasOutsideBounds.right}}(x,props);if(x=right.value,right.wasOutsideBounds){var left=function getLeftPosition(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return{value:args[0]-20,wasOutsideBounds:!1}}(x,props);x=left.value}return{x:Object(clamp.a)({amount:x,min:20,max:window.innerWidth-props.tooltipDimensions.width-20-20}),y:Object(clamp.a)({amount:y,min:window.scrollY+20,max:window.scrollY+window.innerHeight-props.tooltipDimensions.height-20})}}function isOutsideBounds(data){var current=data.current,alteredPosition=data.alteredPosition,max=window.innerWidth-20-20;return{left:current<20,right:current+alteredPosition.tooltipDimensions.width>max}}var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1,dimensions:dimensions});var selectedTheme=Object(useTheme.a)(theme),isPerformanceImpacted=Object(useChartContext.a)().isPerformanceImpacted,_useState=Object(react.useState)(null),_useState2=slicedToArray_default()(_useState,2),activeIndex=_useState2[0],setActiveIndex=_useState2[1],_useState3=Object(react.useState)(-1),_useState4=slicedToArray_default()(_useState3,2),activeLineIndex=_useState4[0],setActiveLineIndex=_useState4[1],_useState5=Object(react.useState)(constants.X),_useState6=slicedToArray_default()(_useState5,2),xAxisHeight=_useState6[0],setXAxisHeight=_useState6[1],_useState7=Object(react.useState)(0),_useState8=slicedToArray_default()(_useState7,2),annotationsHeight=_useState8[0],setAnnotationsHeight=_useState8[1],_useLegend=Object(useLegend.a)({data:[{shape:"Line",series:data}],dimensions:dimensions,showLegend:showLegend,seriesNameFormatter:seriesNameFormatter}),legend=_useLegend.legend,setLegendDimensions=_useLegend.setLegendDimensions,height=_useLegend.height,width=_useLegend.width;Object(useWatchColorVisionEvents.a)({type:constants.q,onIndexChange:function onIndexChange(_ref2){var detail=_ref2.detail;return setActiveLineIndex(detail.index)}});var hiddenLineIndexes=Object(useExternalHideEvents.a)().hiddenIndexes,indexForLabels=Object(useIndexForLabels.a)(data),_useFormattedLabels=Object(useFormattedLabels.a)({data:[data[indexForLabels]],labelFormatter:xAxisOptions.labelFormatter}),formattedLabels=_useFormattedLabels.formattedLabels,unformattedLabels=_useFormattedLabels.unformattedLabels,tooltipId=Object(react.useRef)(Object(uniqueId.a)("lineChart")),_useState9=Object(react.useState)(null),_useState10=slicedToArray_default()(_useState9,2),svgRef=_useState10[0],setSvgRef=_useState10[1],emptyState=0===data.length||data.every((function(series){return 0===series.data.length})),_yAxisMinMax=Object(yAxisMinMax.a)(data),minY=_yAxisMinMax.minY,maxY=_yAxisMinMax.maxY,yScaleOptions={formatYAxisLabel:yAxisOptions.labelFormatter,integersOnly:yAxisOptions.integersOnly,fixedWidth:yAxisOptions.fixedWidth,max:maxY,min:minY},yAxisLabelWidth=Object(useYScale.a)(_objectSpread(_objectSpread({},yScaleOptions),{},{drawableHeight:height,verticalOverflow:selectedTheme.grid.verticalOverflow})).yAxisLabelWidth,_useFormatData=Object(useFormatData.a)(data),longestSeriesLength=_useFormatData.longestSeriesLength,longestSeriesIndex=_useFormatData.longestSeriesIndex,_useChartPositions=Object(useChartPositions.a)({annotationsHeight:annotationsHeight,height:height,width:width,xAxisHeight:xAxisHeight,yAxisWidth:yAxisLabelWidth}),drawableWidth=_useChartPositions.drawableWidth,drawableHeight=_useChartPositions.drawableHeight,chartXPosition=_useChartPositions.chartXPosition,chartYPosition=_useChartPositions.chartYPosition,xAxisBounds=_useChartPositions.xAxisBounds,yAxisBounds=_useChartPositions.yAxisBounds,hideXAxis=xAxisOptions.hide||selectedTheme.xAxis.hide,_useLinearLabelsAndDi=Object(useLinearLabelsAndDimensions.a)({data:data,drawableWidth:drawableWidth,hideXAxis:hideXAxis,labels:formattedLabels,longestSeriesLength:longestSeriesLength}),xAxisDetails=_useLinearLabelsAndDi.xAxisDetails,xScale=_useLinearLabelsAndDi.xScale,labels=_useLinearLabelsAndDi.labels,_useYScale2=Object(useYScale.a)(_objectSpread(_objectSpread({},yScaleOptions),{},{drawableHeight:drawableHeight,verticalOverflow:selectedTheme.grid.verticalOverflow})),ticks=_useYScale2.ticks,yScale=_useYScale2.yScale,annotationsDrawableHeight=chartYPosition+drawableHeight+src_constants.a,getTooltipMarkup=function useLineChartTooltipContent(_ref){var data=_ref.data,_ref$hiddenIndexes=_ref.hiddenIndexes,hiddenIndexes=void 0===_ref$hiddenIndexes?[]:_ref$hiddenIndexes,indexForLabels=_ref.indexForLabels,renderTooltipContent=_ref.renderTooltipContent,seriesNameFormatter=_ref.seriesNameFormatter,theme=Object(useChartContext.a)().theme;return Object(react.useCallback)((function(activeIndex){if(-1===activeIndex)return null;var tooltipData=[{shape:"Line",data:[]}],key=data[indexForLabels].data[activeIndex]?data[indexForLabels].data[activeIndex].key:"";return data.forEach((function(_ref2,index){var name=_ref2.name,seriesData=_ref2.data,color=_ref2.color,isComparison=_ref2.isComparison;if(seriesData[activeIndex]){var value=seriesData[activeIndex].value;tooltipData[0].data.push({key:""+seriesNameFormatter(null!=name?name:""),value:value,color:color,isComparison:isComparison,isHidden:hiddenIndexes.includes(index)})}})),renderTooltipContent({data:tooltipData,activeIndex:activeIndex,title:""+key,dataSeries:data,theme:theme})}),[data,renderTooltipContent,theme,hiddenIndexes,indexForLabels,seriesNameFormatter])}({data:data,renderTooltipContent:renderTooltipContent,indexForLabels:indexForLabels,hiddenIndexes:hiddenLineIndexes,seriesNameFormatter:seriesNameFormatter});if(null==xScale||null==drawableWidth||null==yAxisLabelWidth)return null;var chartBounds={width:width,height:height,x:null!=(_dimensions$x2=null==dimensions?void 0:dimensions.x)?_dimensions$x2:chartXPosition,y:null!=(_dimensions$y2=null==dimensions?void 0:dimensions.y)?_dimensions$y2:chartYPosition},_checkAvailableAnnota=Object(checkAvailableAnnotations.a)(annotationsLookupTable),hasXAxisAnnotations=_checkAvailableAnnota.hasXAxisAnnotations,hasYAxisAnnotations=_checkAvailableAnnota.hasYAxisAnnotations,halfXAxisLabelWidth=xAxisDetails.labelWidth/2;return Object(jsx_runtime.jsxs)(react.Fragment,{children:[Object(jsx_runtime.jsxs)(ChartElements.a.Svg,{emptyState:emptyState,emptyStateText:emptyStateText,height:height,role:"table",setRef:setSvgRef,width:width,children:[hideXAxis?null:Object(jsx_runtime.jsx)(XAxis.a,{allowLineWrap:xAxisOptions.allowLineWrap,ariaHidden:!0,isLinearChart:!0,labels:labels,labelWidth:xAxisDetails.labelWidth,onHeightChange:setXAxisHeight,reducedLabelIndexes:xAxisDetails.reducedLabelIndexes,x:xAxisBounds.x-halfXAxisLabelWidth,xScale:xScale,y:xAxisBounds.y}),selectedTheme.grid.showHorizontalLines?Object(jsx_runtime.jsx)(HorizontalGridLines.a,{ticks:ticks,transform:{x:selectedTheme.grid.horizontalOverflow?0:chartXPosition,y:chartYPosition},width:selectedTheme.grid.horizontalOverflow?width:drawableWidth}):null,Object(jsx_runtime.jsx)(YAxis.a,{ticks:ticks,width:yAxisLabelWidth+src_constants.n,textAlign:"right",ariaHidden:!0,x:yAxisBounds.x,y:yAxisBounds.y}),emptyState?null:Object(jsx_runtime.jsx)(VisuallyHiddenRows.a,{data:data,formatYAxisLabel:yAxisOptions.labelFormatter,xAxisLabels:labels}),Object(jsx_runtime.jsxs)("g",{transform:"translate("+chartXPosition+","+chartYPosition+")",children:[null==slots||null==slots.chart?void 0:slots.chart({yScale:yScale,xScale:xScale,drawableWidth:drawableWidth,drawableHeight:drawableHeight,theme:theme}),data.map((function(singleSeries,index){var _singleSeries$metadat;return!0===(null==(_singleSeries$metadat=singleSeries.metadata)?void 0:_singleSeries$metadat.isVisuallyHidden)?null:Object(jsx_runtime.jsx)(LineSeries.a,{activeLineIndex:activeLineIndex,data:singleSeries,hiddenIndexes:hiddenLineIndexes,index:index,svgDimensions:{height:drawableHeight,width:drawableWidth},theme:theme,xScale:xScale,yScale:yScale,type:"default"},name+"-"+index)})),Object(jsx_runtime.jsx)(PointsAndCrosshair.a,{activeIndex:activeIndex,data:data,drawableHeight:drawableHeight,emptyState:emptyState,hiddenIndexes:hiddenLineIndexes,longestSeriesIndex:longestSeriesIndex,theme:theme,tooltipId:tooltipId.current,xScale:xScale,yScale:yScale})]}),hasXAxisAnnotations&&Object(jsx_runtime.jsx)("g",{transform:"translate("+chartXPosition+",0)",tabIndex:-1,children:Object(jsx_runtime.jsx)(Annotations.a,{annotationsLookupTable:annotationsLookupTable,axisLabelWidth:xAxisDetails.labelWidth,drawableHeight:annotationsDrawableHeight,drawableWidth:drawableWidth,labels:unformattedLabels,onHeightChange:setAnnotationsHeight,xScale:xScale})}),hasYAxisAnnotations&&Object(jsx_runtime.jsx)("g",{transform:"translate("+chartXPosition+","+chartYPosition+")",tabIndex:-1,children:Object(jsx_runtime.jsx)(YAxisAnnotations.a,{annotationsLookupTable:annotationsLookupTable,drawableHeight:annotationsDrawableHeight,drawableWidth:drawableWidth,ticks:ticks,yScale:yScale})})]}),-1!==longestSeriesLength&&Object(jsx_runtime.jsx)(TooltipWrapper.a,{alwaysUpdatePosition:!0,chartBounds:chartBounds,focusElementDataType:types.b.Point,getAlteredPosition:getAlteredLineChartPosition,getMarkup:getTooltipMarkup,getPosition:function getTooltipPosition(_ref3){var event=_ref3.event,index=_ref3.index;if("mouse"===_ref3.eventType){var point=Object(eventPoint.a)(event);if(null==point||null==xScale||null==data[longestSeriesIndex])return TooltipWrapper_constants.b;var svgX=point.svgX,closestIndex=Math.round(xScale.invert(svgX-chartXPosition)),_activeIndex=Object(clamp.a)({amount:closestIndex,min:0,max:data[longestSeriesIndex].data.length-1});return{x:event.pageX,y:event.pageY,activeIndex:_activeIndex}}var _xScale,_dimensions$x,_dimensions$y,_activeIndex2=null!=index?index:0;return{x:(null!=(_xScale=null==xScale?void 0:xScale(_activeIndex2))?_xScale:0)+(null!=(_dimensions$x=null==dimensions?void 0:dimensions.x)?_dimensions$x:0),y:null!=(_dimensions$y=null==dimensions?void 0:dimensions.y)?_dimensions$y:0,activeIndex:_activeIndex2}},id:tooltipId.current,margin:constants.r,onIndexChange:function onIndexChange(index){null!=index&&isPerformanceImpacted?function moveCrosshair(index){if(setActiveIndex(0),null!=index){var crosshair=document.getElementById(tooltipId.current+"-"+src_constants.e);null!=crosshair&&crosshair.setAttribute("x",""+(xScale(index)-selectedTheme.crossHair.width/2))}}(index):setActiveIndex(index)},parentRef:svgRef,usePortal:!0}),showLegend&&Object(jsx_runtime.jsx)(LegendContainer.a,{colorVisionType:constants.q,data:legend,onDimensionChange:setLegendDimensions,renderLegendContent:renderLegendContent,renderHiddenLegendLabel:renderHiddenLegendLabel,dimensions:dimensions,enableHideOverflow:!0})]})}try{Chart.displayName="Chart",Chart.__docgenInfo={description:"",displayName:"Chart",props:{renderTooltipContent:{defaultValue:null,description:"",name:"renderTooltipContent",required:!0,type:{name:"(data: RenderTooltipContentData) => ReactNode"}},annotationsLookupTable:{defaultValue:null,description:"",name:"annotationsLookupTable",required:!0,type:{name:"AnnotationLookupTable"}},data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"LineChartDataSeriesWithDefaults[]"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!0,type:{name:"LabelFormatter"}},showLegend:{defaultValue:{value:"true"},description:"",name:"showLegend",required:!1,type:{name:"boolean"}},xAxisOptions:{defaultValue:null,description:"",name:"xAxisOptions",required:!0,type:{name:"XAxisOptions"}},yAxisOptions:{defaultValue:null,description:"",name:"yAxisOptions",required:!0,type:{name:"YAxisOptions"}},dimensions:{defaultValue:null,description:"",name:"dimensions",required:!1,type:{name:"BoundingRect"}},emptyStateText:{defaultValue:null,description:"",name:"emptyStateText",required:!1,type:{name:"string"}},renderLegendContent:{defaultValue:null,description:"",name:"renderLegendContent",required:!1,type:{name:"RenderLegendContent"}},renderHiddenLegendLabel:{defaultValue:null,description:"",name:"renderHiddenLegendLabel",required:!1,type:{name:"RenderHiddenLegendLabel"}},slots:{defaultValue:null,description:"",name:"slots",required:!1,type:{name:"{ chart?: (props: LineChartSlotProps) => Element; }"}},theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"string"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChart/Chart.tsx#Chart"]={docgenInfo:Chart.__docgenInfo,name:"Chart",path:"packages/polaris-viz/src/components/LineChart/Chart.tsx#Chart"})}catch(__react_docgen_typescript_loader_error){}function LineChart_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function LineChart_objectSpread(target){for(var i=1;i number | Interpolation"}},xScale:{defaultValue:null,description:"",name:"xScale",required:!0,type:{name:"ScaleLinear"}},yScale:{defaultValue:null,description:"",name:"yScale",required:!0,type:{name:"ScaleLinear"}},hiddenIndexes:{defaultValue:{value:"[]"},description:"",name:"hiddenIndexes",required:!1,type:{name:"number[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChart/components/Points/Points.tsx#Points"]={docgenInfo:Points.__docgenInfo,name:"Points",path:"packages/polaris-viz/src/components/LineChart/components/Points/Points.tsx#Points"})}catch(__react_docgen_typescript_loader_error){}function PointsAndCrosshair(_ref){var activeIndex=_ref.activeIndex,data=_ref.data,drawableHeight=_ref.drawableHeight,emptyState=_ref.emptyState,_ref$hiddenIndexes=_ref.hiddenIndexes,hiddenIndexes=void 0===_ref$hiddenIndexes?[]:_ref$hiddenIndexes,longestSeriesIndex=_ref.longestSeriesIndex,theme=_ref.theme,tooltipId=_ref.tooltipId,xScale=_ref.xScale,yScale=_ref.yScale,selectedTheme=Object(useTheme.a)(theme),_useChartContext=Object(useChartContext.a)(),shouldAnimate=_useChartContext.shouldAnimate,isPerformanceImpacted=_useChartContext.isPerformanceImpacted,gradientId=Object(react.useRef)(Object(uniqueId.a)("lineChartGradient")),lineGenerator=Object(react.useMemo)((function(){var generator=Object(line.a)().x((function(_,index){return null==xScale?0:xScale(index)})).y((function(_ref2){var value=_ref2.value;return yScale(null!=value?value:0)}));return selectedTheme.line.hasSpline&&generator.curve(curveStepRounded.a),generator}),[selectedTheme.line.hasSpline,xScale,yScale]),animatedCoordinates=Object(useLinearChartAnimations.a)({data:data,lineGenerator:lineGenerator,activeIndex:activeIndex}).animatedCoordinates,getXPosition=function getXPosition(){var _ref3=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isCrosshair:!1},isCrosshair=_ref3.isCrosshair;if(null==xScale)return 0;var offset=isCrosshair?selectedTheme.crossHair.width/2:0;return null!=animatedCoordinates&&null!=animatedCoordinates[longestSeriesIndex]&&shouldAnimate?animatedCoordinates[longestSeriesIndex].to((function(coord){return coord.x-offset})):xScale(null==activeIndex?0:activeIndex)-offset};return Object(jsx_runtime.jsxs)(react.Fragment,{children:[emptyState?null:Object(jsx_runtime.jsx)(Crosshair.a,{height:drawableHeight,id:tooltipId+"-"+constants.e,opacity:null==activeIndex?0:1,theme:theme,x:getXPosition({isCrosshair:!0})}),isPerformanceImpacted?null:Object(jsx_runtime.jsx)(Points,{activeIndex:emptyState?null:activeIndex,animatedCoordinates:animatedCoordinates,data:data,getXPosition:getXPosition,gradientId:gradientId.current,hiddenIndexes:hiddenIndexes,longestSeriesIndex:longestSeriesIndex,tooltipId:tooltipId,xScale:xScale,yScale:yScale})]})}try{PointsAndCrosshair.displayName="PointsAndCrosshair",PointsAndCrosshair.__docgenInfo={description:"",displayName:"PointsAndCrosshair",props:{activeIndex:{defaultValue:null,description:"",name:"activeIndex",required:!0,type:{name:"number"}},data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"LineChartDataSeriesWithDefaults[]"}},drawableHeight:{defaultValue:null,description:"",name:"drawableHeight",required:!0,type:{name:"number"}},emptyState:{defaultValue:null,description:"",name:"emptyState",required:!0,type:{name:"boolean"}},hiddenIndexes:{defaultValue:{value:"[]"},description:"",name:"hiddenIndexes",required:!1,type:{name:"number[]"}},longestSeriesIndex:{defaultValue:null,description:"",name:"longestSeriesIndex",required:!0,type:{name:"number"}},theme:{defaultValue:null,description:"",name:"theme",required:!0,type:{name:"string"}},tooltipId:{defaultValue:null,description:"",name:"tooltipId",required:!0,type:{name:"string"}},xScale:{defaultValue:null,description:"",name:"xScale",required:!0,type:{name:"ScaleLinear"}},yScale:{defaultValue:null,description:"",name:"yScale",required:!0,type:{name:"ScaleLinear"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChart/components/PointsAndCrosshair/PointsAndCrosshair.tsx#PointsAndCrosshair"]={docgenInfo:PointsAndCrosshair.__docgenInfo,name:"PointsAndCrosshair",path:"packages/polaris-viz/src/components/LineChart/components/PointsAndCrosshair/PointsAndCrosshair.tsx#PointsAndCrosshair"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/LineChart/hooks/useFormatData.ts":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return useFormatData}));__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js");var react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/index.js");function useFormatData(data){var longestSeriesIndex=Object(react__WEBPACK_IMPORTED_MODULE_1__.useMemo)((function(){return data.reduce((function(maxIndex,currentSeries,currentIndex){return data[maxIndex].data.length HTMLAttributes"}},getColorVisionStyles:{defaultValue:null,description:"",name:"getColorVisionStyles",required:!0,type:{name:"(index: number) => CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/CustomLegend.tsx#CustomLegend"]={docgenInfo:CustomLegend_CustomLegend.__docgenInfo,name:"CustomLegend",path:"packages/polaris-viz/src/components/LineChartPredictive/components/CustomLegend/CustomLegend.tsx#CustomLegend"})}catch(__react_docgen_typescript_loader_error){}var polaris_viz_src_constants=__webpack_require__("./packages/polaris-viz/src/constants.ts"),LinePreview=__webpack_require__("./packages/polaris-viz/src/components/LinePreview/LinePreview.tsx"),TooltipRow=__webpack_require__("./packages/polaris-viz/src/components/TooltipContent/components/TooltipRow/TooltipRow.tsx"),TooltipContentContainer=__webpack_require__("./packages/polaris-viz/src/components/TooltipContent/components/TooltipContentContainer/TooltipContentContainer.tsx"),TooltipTitle=__webpack_require__("./packages/polaris-viz/src/components/TooltipContent/components/TooltipTitle/TooltipTitle.tsx"),Styles=__webpack_require__("./packages/polaris-viz/src/components/LineChartPredictive/utilities/Styles.scss"),Styles_default=__webpack_require__.n(Styles);function renderLinearPredictiveTooltipContent_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function renderLinearPredictiveTooltipContent(tooltipData){var theme=tooltipData.theme,formatters=function renderLinearPredictiveTooltipContent_objectSpread(target){for(var i=1;i=o.length?{done:!0}:{done:!1,value:o[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(arr,len){(null==len||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i HTMLAttributes"}},getColorVisionStyles:{defaultValue:null,description:"",name:"getColorVisionStyles",required:!0,type:{name:"(index: number) => CSSProperties"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/CustomLegend.tsx#CustomLegend"]={docgenInfo:CustomLegend_CustomLegend.__docgenInfo,name:"CustomLegend",path:"packages/polaris-viz/src/components/LineChartRelational/components/CustomLegend/CustomLegend.tsx#CustomLegend"})}catch(__react_docgen_typescript_loader_error){}__webpack_require__("./node_modules/core-js/modules/es.set.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.sort.js");var toConsumableArray=__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js"),toConsumableArray_default=__webpack_require__.n(toConsumableArray),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),uniqueId=__webpack_require__("./packages/polaris-viz-core/src/utilities/uniqueId.ts");var MissingDataArea=Object(react.memo)((function MissingDataAreaRaw(_ref){var data=_ref.data,drawableHeight=_ref.drawableHeight,xScale=_ref.xScale,selectedTheme=Object(useTheme.a)(),patternID=Object(react.useRef)(Object(uniqueId.a)("missingDataPattern")),nullIndexes=new Set([]);if(data.forEach((function(series){series.data.forEach((function(_ref2,index){var value=_ref2.value;null==value&&nullIndexes.add(index);var nextSeries=series.data[index+1],previousSeries=series.data[index-1];null==value&&nextSeries&&null!=nextSeries.value&&nullIndexes.add(index+1),null==value&&previousSeries&&null!=previousSeries.value&&nullIndexes.add(index-1)}))})),0===nullIndexes.size)return null;var groups=function groupNumbersIntoRuns(indexes){var runs=[],current=[];return indexes.forEach((function(value,index){0===index||value-indexes[index-1]==1?current.push(value):(runs.push(current),current=[value])})),runs.push(current),runs}(toConsumableArray_default()(nullIndexes).sort((function(current,next){return current-next})));return Object(jsx_runtime.jsxs)(react.Fragment,{children:[Object(jsx_runtime.jsx)("defs",{children:Object(jsx_runtime.jsx)("pattern",{id:patternID.current,patternUnits:"userSpaceOnUse",width:"12",height:"12",patternTransform:"rotate(135)",children:Object(jsx_runtime.jsx)("line",{x1:"0",y:"0",x2:"0",y2:"12",stroke:selectedTheme.missingData.lineColor,strokeWidth:"12",opacity:"0.2"})})}),groups.map((function(indexes,index){var startIndex=Math.min.apply(Math,toConsumableArray_default()(indexes)),endIndex=Math.max.apply(Math,toConsumableArray_default()(indexes)),width=xScale(endIndex-startIndex);return Object(jsx_runtime.jsx)("rect",{x:xScale(startIndex),y:0,height:drawableHeight,width:width,fill:"url(#"+patternID.current+")"},index)}))]})}));try{MissingDataArea.displayName="MissingDataArea",MissingDataArea.__docgenInfo={description:"",displayName:"MissingDataArea",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"LineChartRelationalDataSeries[]"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChartRelational/components/MissingDataArea/MissingDataArea.tsx#MissingDataArea"]={docgenInfo:MissingDataArea.__docgenInfo,name:"MissingDataArea",path:"packages/polaris-viz/src/components/LineChartRelational/components/MissingDataArea/MissingDataArea.tsx#MissingDataArea"})}catch(__react_docgen_typescript_loader_error){}var slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js"),slicedToArray_default=__webpack_require__.n(slicedToArray),useChartContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartContext.ts"),useSpringConfig=__webpack_require__("./packages/polaris-viz-core/src/hooks/useSpringConfig.ts"),curveStepRounded=__webpack_require__("./packages/polaris-viz-core/src/utilities/curveStepRounded.ts"),src_area=__webpack_require__("./node_modules/d3-shape/src/area.js"),react_spring_web_esm=__webpack_require__("./node_modules/@react-spring/web/dist/react-spring-web.esm.js"),useExternalHideEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ExternalEvents/useExternalHideEvents.ts"),utilities=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/utilities.ts"),useCallbackRef=__webpack_require__("./packages/polaris-viz/src/hooks/useCallbackRef.tsx");function useWatchActiveSeries(id,onIndexChange){var onIndexChangeCallback=Object(useCallbackRef.a)(onIndexChange);Object(react.useEffect)((function(){var clearActiveSeriesListener=function setActiveSeriesListener(id,onIndexChange){var eventName=Object(utilities.b)(id,src_constants.q);return window.addEventListener(eventName,onIndexChange),function(){window.removeEventListener(eventName,onIndexChange)}}(id,onIndexChangeCallback);return function(){return clearActiveSeriesListener()}}),[id,onIndexChangeCallback])}__webpack_require__("./node_modules/core-js/modules/es.array.fill.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js");var usePrevious=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePrevious.ts"),getColorVisionStylesForActiveIndex=__webpack_require__("./packages/polaris-viz-core/src/utilities/getColorVisionStylesForActiveIndex.ts");function Area_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function Area_objectSpread(target){for(var i=1;i string"}},index:{defaultValue:null,description:"",name:"index",required:!0,type:{name:"number"}},series:{defaultValue:null,description:"",name:"series",required:!0,type:{name:"LineChartRelationalDataSeries"}},hiddenIndexes:{defaultValue:{value:"[]"},description:"",name:"hiddenIndexes",required:!1,type:{name:"number[]"}},shouldAnimate:{defaultValue:{value:"false"},description:"",name:"shouldAnimate",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/LineChartRelational/components/Area/Area.tsx#Area"]={docgenInfo:Area.__docgenInfo,name:"Area",path:"packages/polaris-viz/src/components/LineChartRelational/components/Area/Area.tsx#Area"})}catch(__react_docgen_typescript_loader_error){}function RelatedAreas_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function RelatedAreas(_ref){var yScale=_ref.yScale,xScale=_ref.xScale,data=_ref.data,_useState=Object(react.useState)(-1),_useState2=slicedToArray_default()(_useState,2),activeIndex=_useState2[0],setActiveIndex=_useState2[1],percentileIndex=data.filter((function(series){var _series$metadata;return null==(null==series||null==(_series$metadata=series.metadata)?void 0:_series$metadata.relatedIndex)})).length+1,hiddenIndexes=Object(useExternalHideEvents.a)().hiddenIndexes,_useChartContext=Object(useChartContext.a)(),shouldAnimate=_useChartContext.shouldAnimate,id=_useChartContext.id,springConfig=Object(useSpringConfig.a)({animationDelay:shouldAnimate?src_constants.j*(data.length+1):0}),_useSpring=Object(react_spring_web_esm.useSpring)(function RelatedAreas_objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:{},title=options.title,_options$groups=options.groups,groups=void 0===_options$groups?[{title:tooltipData.dataSeries[0].data[tooltipData.activeIndex].key,indexes:tooltipData.dataSeries.map((function(_,index){return index}))}]:_options$groups,theme=tooltipData.theme,formatters=renderLinearTooltipContent_objectSpread({keyFormatter:function keyFormatter(key){return""+key},valueFormatter:function valueFormatter(value){return""+value},titleFormatter:function titleFormatter(title){return""+title}},tooltipData.formatters);function _renderSeriesIcon(color,styleOverride){var _styleOverride$line$w,_styleOverride$line,_styleOverride$line2;return null==(null==styleOverride?void 0:styleOverride.line)?null:Object(jsx_runtime.jsx)(LinePreview.a,{color:color,lineStyle:"solid",width:null!=(_styleOverride$line$w=null==styleOverride||null==(_styleOverride$line=styleOverride.line)?void 0:_styleOverride$line.width)?_styleOverride$line$w:2,strokeDasharray:null==styleOverride||null==(_styleOverride$line2=styleOverride.line)?void 0:_styleOverride$line2.strokeDasharray})}function renderContent(_ref){var activeColorVisionIndex=_ref.activeColorVisionIndex;return groups.map((function(_ref2){var seriesName=_ref2.title,dataSeries=_ref2.indexes.map((function(groupIndex){if(null!=tooltipData.data[0].data[groupIndex]){var rawDataSeries=tooltipData.data[0].data[groupIndex];return renderLinearTooltipContent_objectSpread(renderLinearTooltipContent_objectSpread({},tooltipData.dataSeries[groupIndex]),{},{color:rawDataSeries.color,groupIndex:groupIndex,isHidden:null==rawDataSeries.value||rawDataSeries.isHidden})}})).filter((function(series){return Boolean(series)})),hasTitle=dataSeries.some((function(_ref3){return!0!==_ref3.isHidden}));return Object(jsx_runtime.jsxs)(TooltipSeries.a,{isEmpty:!hasTitle,children:[hasTitle&&Object(jsx_runtime.jsx)(TooltipSeriesName.a,{theme:theme,children:seriesName}),dataSeries.map((function(_ref4){var _styleOverride$toolti,_styleOverride$toolti2,_item$value,name=_ref4.name,data=_ref4.data,color=_ref4.color,groupIndex=_ref4.groupIndex,styleOverride=_ref4.styleOverride,isHidden=_ref4.isHidden,item=data[tooltipData.activeIndex];return Object(jsx_runtime.jsx)(TooltipRow.a,{activeIndex:activeColorVisionIndex,color:color,index:groupIndex,isHidden:isHidden,label:name,renderSeriesIcon:function renderSeriesIcon(){return _renderSeriesIcon(color,styleOverride)},shape:null!=(_styleOverride$toolti=null==styleOverride||null==(_styleOverride$toolti2=styleOverride.tooltip)?void 0:_styleOverride$toolti2.shape)?_styleOverride$toolti:"Line",value:formatters.valueFormatter(null!=(_item$value=item.value)?_item$value:0)},"row-"+groupIndex)}))]},seriesName)}))}return Object(jsx_runtime.jsx)(TooltipContentContainer.a,{maxWidth:300,theme:theme,children:function children(_ref5){var activeColorVisionIndex=_ref5.activeColorVisionIndex;return Object(jsx_runtime.jsxs)(react.Fragment,{children:[null!=title&&Object(jsx_runtime.jsx)(TooltipTitle.a,{theme:theme,children:formatters.titleFormatter(title)}),renderContent({activeColorVisionIndex:activeColorVisionIndex})]})}})}(tooltipData,{title:tooltipData.title,groups:[{title:"Your store",indexes:[0]},{title:"Similar stores",indexes:[1,2,3]}]})}},showLegend:!1},DEFAULT_DATA=[{name:"Average",data:[{value:333,key:"2020-03-01T12:00:00"},{value:797,key:"2020-03-02T12:00:00"},{value:234,key:"2020-03-03T12:00:00"},{value:534,key:"2020-03-04T12:00:00"},{value:132,key:"2020-03-05T12:00:00"},{value:159,key:"2020-03-06T12:00:00"},{value:239,key:"2020-03-07T12:00:00"},{value:708,key:"2020-03-08T12:00:00"},{value:234,key:"2020-03-09T12:00:00"},{value:645,key:"2020-03-10T12:00:00"},{value:543,key:"2020-03-11T12:00:00"},{value:89,key:"2020-03-12T12:00:00"},{value:849,key:"2020-03-13T12:00:00"},{value:129,key:"2020-03-14T12:00:00"}],color:src_constants.P.seriesColors.upToEight[0]},{name:"75th Percentile",data:[{value:388,key:"2020-03-01T12:00:00"},{value:859,key:"2020-03-02T12:00:00"},{value:340,key:"2020-03-03T12:00:00"},{value:240,key:"2020-03-04T12:00:00"},{value:387,key:"2020-03-05T12:00:00"},{value:122,key:"2020-03-06T12:00:00"},{value:760,key:"2020-03-07T12:00:00"},{value:162,key:"2020-03-08T12:00:00"},{value:540,key:"2020-03-09T12:00:00"},{value:193,key:"2020-03-10T12:00:00"},{value:860,key:"2020-03-11T12:00:00"},{value:941,key:"2020-03-12T12:00:00"},{value:773,key:"2020-03-13T12:00:00"},{value:171,key:"2020-03-14T12:00:00"}],color:"rgba(218, 182, 242, 1)",metadata:{relatedIndex:2,areaColor:"rgba(218, 182, 242, 0.2)",legendLabel:"75th - 25th percentile"},styleOverride:{tooltip:{shape:"Bar"}}},{name:"Median",data:[{value:238,key:"2020-03-01T12:00:00"},{value:759,key:"2020-03-02T12:00:00"},{value:190,key:"2020-03-03T12:00:00"},{value:90,key:"2020-03-04T12:00:00"},{value:237,key:"2020-03-05T12:00:00"},{value:172,key:"2020-03-06T12:00:00"},{value:580,key:"2020-03-07T12:00:00"},{value:12,key:"2020-03-08T12:00:00"},{value:390,key:"2020-03-09T12:00:00"},{value:43,key:"2020-03-10T12:00:00"},{value:710,key:"2020-03-11T12:00:00"},{value:791,key:"2020-03-12T12:00:00"},{value:623,key:"2020-03-13T12:00:00"},{value:21,key:"2020-03-14T12:00:00"}],color:src_constants.P.seriesColors.upToEight[5],styleOverride:{line:{hasArea:!1,strokeDasharray:"3 6"}}},{name:"25th percentile",data:[{value:88,key:"2020-03-01T12:00:00"},{value:559,key:"2020-03-02T12:00:00"},{value:40,key:"2020-03-03T12:00:00"},{value:0,key:"2020-03-04T12:00:00"},{value:87,key:"2020-03-05T12:00:00"},{value:22,key:"2020-03-06T12:00:00"},{value:430,key:"2020-03-07T12:00:00"},{value:0,key:"2020-03-08T12:00:00"},{value:240,key:"2020-03-09T12:00:00"},{value:0,key:"2020-03-10T12:00:00"},{value:540,key:"2020-03-11T12:00:00"},{value:641,key:"2020-03-12T12:00:00"},{value:473,key:"2020-03-13T12:00:00"},{value:0,key:"2020-03-14T12:00:00"}],color:"rgba(218, 182, 242, 1)",metadata:{relatedIndex:2,areaColor:"rgba(218, 182, 242, 0.2)",legendLabel:"75th - 25th percentile"},styleOverride:{tooltip:{shape:"Bar"}}}],META={title:"polaris-viz/Charts/LineChartRelational",component:LineChartRelational,decorators:[function(Story){return Object(jsx_runtime.jsx)("div",{style:{height:400},children:Story()})}],parameters:{controls:constants.c,docs:{page:PageWithSizingInfo.a,description:{component:"Used to show change over time, comparisons, and trends."}}},argTypes:{annotations:constants.a,data:constants.e,xAxisOptions:constants.t,emptyStateText:constants.g,isAnimated:constants.h,renderLegendContent:constants.m,renderTooltipContent:{options:Object.keys(TOOLTIP_CONTENT),mapping:TOOLTIP_CONTENT,description:constants.n},skipLinkText:constants.q,yAxisOptions:constants.u,theme:constants.r,state:constants.b,showLegend:constants.i}};function Default_stories_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function Default_stories_objectSpread(target){for(var i=1;i"}},cy:{defaultValue:null,description:"",name:"cy",required:!0,type:{name:"number | Interpolation"}},color:{defaultValue:null,description:"",name:"color",required:!0,type:{name:"string"}},index:{defaultValue:null,description:"",name:"index",required:!0,type:{name:"number"}},isAnimated:{defaultValue:null,description:"",name:"isAnimated",required:!0,type:{name:"boolean"}},ariaHidden:{defaultValue:null,description:"",name:"ariaHidden",required:!1,type:{name:"boolean"}},ariaLabelledby:{defaultValue:null,description:"",name:"ariaLabelledby",required:!1,type:{name:"string"}},dataType:{defaultValue:null,description:"",name:"dataType",required:!1,type:{name:"DataType"}},onFocus:{defaultValue:null,description:"",name:"onFocus",required:!1,type:{name:"({ index, x, y }: ActiveTooltip) => void"}},tabIndex:{defaultValue:null,description:"",name:"tabIndex",required:!1,type:{name:"number"}},visuallyHidden:{defaultValue:null,description:"",name:"visuallyHidden",required:!1,type:{name:"boolean"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/Point/Point.tsx#Point"]={docgenInfo:Point.__docgenInfo,name:"Point",path:"packages/polaris-viz/src/components/Point/Point.tsx#Point"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return PolarisVizProvider}));var _shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./packages/polaris-viz-core/src/components/PolarisVizProvider/PolarisVizProvider.tsx"),_react_spring_web__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@react-spring/web/dist/react-spring-web.esm.js"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/react/jsx-runtime.js"),PolarisVizProvider=function PolarisVizProvider(_ref){var themes=_ref.themes,children=_ref.children,defaultTheme=_ref.defaultTheme,onError=_ref.onError;return Object(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_shopify_polaris_viz_core__WEBPACK_IMPORTED_MODULE_0__.a,{themes:themes,animated:_react_spring_web__WEBPACK_IMPORTED_MODULE_1__.animated,defaultTheme:defaultTheme,onError:onError,children:children})};try{PolarisVizProvider.displayName="PolarisVizProvider",PolarisVizProvider.__docgenInfo={description:"",displayName:"PolarisVizProvider",props:{themes:{defaultValue:null,description:"",name:"themes",required:!1,type:{name:"{ [key: string]: PartialTheme; }"}},defaultTheme:{defaultValue:null,description:"",name:"defaultTheme",required:!1,type:{name:"string"}},onError:{defaultValue:null,description:"",name:"onError",required:!1,type:{name:"ErrorBoundaryResponse"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx#PolarisVizProvider"]={docgenInfo:PolarisVizProvider.__docgenInfo,name:"PolarisVizProvider",path:"packages/polaris-viz/src/components/PolarisVizProvider/PolarisVizProvider.tsx#PolarisVizProvider"})}catch(__react_docgen_typescript_loader_error){}},"./packages/polaris-viz/src/components/SimpleBarChart/SimpleBarChart.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return SimpleBarChart}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),usePolarisVizContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePolarisVizContext.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),types=__webpack_require__("./packages/polaris-viz-core/src/types.ts"),getAxisOptions=__webpack_require__("./packages/polaris-viz/src/utilities/getAxisOptions.ts"),ChartContainer=__webpack_require__("./packages/polaris-viz/src/components/ChartContainer/ChartContainer.tsx"),ChartSkeleton=__webpack_require__("./packages/polaris-viz/src/components/ChartSkeleton/ChartSkeleton.tsx"),react=__webpack_require__("./node_modules/react/index.js"),uniqueId=__webpack_require__("./packages/polaris-viz-core/src/utilities/uniqueId.ts"),useAriaLabel=__webpack_require__("./packages/polaris-viz-core/src/hooks/useAriaLabel.ts"),react_spring_web_esm=__webpack_require__("./node_modules/@react-spring/web/dist/react-spring-web.esm.js"),ChartElements=__webpack_require__("./packages/polaris-viz/src/components/ChartElements/index.ts"),useLegend=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/hooks/useLegend.ts"),LegendContainer=__webpack_require__("./packages/polaris-viz/src/components/LegendContainer/LegendContainer.tsx"),GradientDefs=__webpack_require__("./packages/polaris-viz/src/components/shared/GradientDefs/GradientDefs.tsx"),HorizontalGroup=__webpack_require__("./packages/polaris-viz/src/components/shared/HorizontalGroup/HorizontalGroup.tsx"),useColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useColorVisionEvents.ts"),useHorizontalSeriesColors=__webpack_require__("./packages/polaris-viz/src/hooks/useHorizontalSeriesColors.ts"),useDataForHorizontalChart=__webpack_require__("./packages/polaris-viz/src/hooks/useDataForHorizontalChart.ts"),useHorizontalStackedValues=__webpack_require__("./packages/polaris-viz/src/hooks/useHorizontalStackedValues.ts"),useHorizontalXScale=__webpack_require__("./packages/polaris-viz/src/hooks/useHorizontalXScale.ts"),useHorizontalBarSizes=__webpack_require__("./packages/polaris-viz/src/hooks/useHorizontalBarSizes.ts"),useHorizontalTransitions=__webpack_require__("./packages/polaris-viz/src/hooks/useHorizontalTransitions.ts"),getContainerAlignmentForLegend=__webpack_require__("./packages/polaris-viz/src/utilities/getContainerAlignmentForLegend.ts"),slicedToArray=(__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.object.entries.js"),__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js")),slicedToArray_default=__webpack_require__.n(slicedToArray),estimateTrendIndicatorWidth=__webpack_require__("./packages/polaris-viz/src/components/TrendIndicator/utilities/estimateTrendIndicatorWidth.ts");var jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function Chart(_ref){var data=_ref.data,dimensions=_ref.dimensions,renderLegendContent=_ref.renderLegendContent,_ref$legendPosition=_ref.legendPosition,legendPosition=void 0===_ref$legendPosition?"bottom-right":_ref$legendPosition,seriesNameFormatter=_ref.seriesNameFormatter,showLegend=_ref.showLegend,type=_ref.type,xAxisOptions=_ref.xAxisOptions,yAxisOptions=_ref.yAxisOptions;Object(useColorVisionEvents.a)({enabled:data.length>1});var id=Object(react.useMemo)((function(){return Object(uniqueId.a)("SimpleBarChart")}),[]),labelFormatter=xAxisOptions.labelFormatter,isStacked="stacked"===type,_useHorizontalSeriesC=Object(useHorizontalSeriesColors.a)(data),longestSeriesCount=_useHorizontalSeriesC.longestSeriesCount,seriesColors=_useHorizontalSeriesC.seriesColors,_useLegend=Object(useLegend.a)({data:[{shape:"Bar",series:data}],dimensions:dimensions,colors:seriesColors,showLegend:showLegend,seriesNameFormatter:seriesNameFormatter}),legend=_useLegend.legend,setLegendDimensions=_useLegend.setLegendDimensions,height=_useLegend.height,width=_useLegend.width,_useDataForHorizontal=Object(useDataForHorizontalChart.a)({data:data,isSimple:!0,isStacked:isStacked,labelFormatter:labelFormatter}),allNumbers=_useDataForHorizontal.allNumbers,longestLabel=_useDataForHorizontal.longestLabel,highestPositive=_useDataForHorizontal.highestPositive,lowestNegative=_useDataForHorizontal.lowestNegative,areAllNegative=_useDataForHorizontal.areAllNegative,_useHorizontalStacked=Object(useHorizontalStackedValues.a)({isStacked:isStacked,data:data}),stackedValues=_useHorizontalStacked.stackedValues,stackedMin=_useHorizontalStacked.stackedMin,stackedMax=_useHorizontalStacked.stackedMax,longestTrendIndicator=function getLongestTrendIndicator(data,highestPositive,lowestNegative){var longestTrendIndicator=data.reduce((function(longestTrendIndicator,series){for(var _metadata$trends,seriesData=series.data,metadata=series.metadata,trends=null!=(_metadata$trends=null==metadata?void 0:metadata.trends)?_metadata$trends:{},_i=0,_trendEntries=Object.entries(trends);_i<_trendEntries.length;_i++){var _ref=_trendEntries[_i],_ref2=slicedToArray_default()(_ref,2),index=_ref2[0],trend=_ref2[1],dataPoint=seriesData[index];(null==dataPoint?void 0:dataPoint.value)===highestPositive?longestTrendIndicator.positive=Object(estimateTrendIndicatorWidth.a)(trend.value).totalWidth:(null==dataPoint?void 0:dataPoint.value)===lowestNegative&&(longestTrendIndicator.negative=Object(estimateTrendIndicatorWidth.a)(trend.value).totalWidth)}return longestTrendIndicator}),{positive:0,negative:0});return longestTrendIndicator.positive>0&&(longestTrendIndicator.positive+=constants.F),longestTrendIndicator.negative>0&&(longestTrendIndicator.negative+=constants.F),longestTrendIndicator}(data,highestPositive,lowestNegative),trendIndicatorOffset=longestTrendIndicator.positive+longestTrendIndicator.negative,xScale=Object(useHorizontalXScale.a)({allNumbers:allNumbers,isStacked:isStacked,labelFormatter:labelFormatter,maxWidth:width-trendIndicatorOffset,stackedMax:stackedMax,stackedMin:stackedMin,longestLabel:longestLabel}).xScale,_useHorizontalBarSize=Object(useHorizontalBarSizes.a)({chartDimensions:{width:width,height:height},isSimple:!0,isStacked:isStacked,seriesLength:longestSeriesCount,singleBarCount:data.length,xAxisHeight:0}),barHeight=_useHorizontalBarSize.barHeight,groupHeight=_useHorizontalBarSize.groupHeight,transitions=Object(useHorizontalTransitions.a)({series:data,groupHeight:groupHeight,chartXPosition:0}).transitions,zeroPosition=xScale(0)+longestLabel.negative+longestTrendIndicator.negative,getAriaLabel=Object(useAriaLabel.a)(data,{xAxisLabelFormatter:labelFormatter}),containerStyle=Object(getContainerAlignmentForLegend.a)(legendPosition,!0);return Object(jsx_runtime.jsxs)(ChartElements.a.Div,{style:containerStyle,width:"auto",height:"auto",children:[Object(jsx_runtime.jsxs)(ChartElements.a.Svg,{height:height,width:width,children:[Object(jsx_runtime.jsx)(GradientDefs.a,{direction:"horizontal",gradientUnits:isStacked?"objectBoundingBox":"userSpaceOnUse",id:id,seriesColors:seriesColors,size:isStacked?"100%":width+"px"}),transitions((function(style,item,_transition,index){var _item$key,_data$0$data$item$ind,_ref2=style,opacity=_ref2.opacity,transform=_ref2.transform,name=null!=(_item$key=item.key)?_item$key:"",ariaLabel=getAriaLabel({seriesIndex:item.index,key:null==(_data$0$data$item$ind=data[0].data[item.index])?void 0:_data$0$data$item$ind.key});return Object(jsx_runtime.jsx)(react_spring_web_esm.animated.g,{style:{opacity:opacity,transform:transform},children:Object(jsx_runtime.jsx)(HorizontalGroup.a,{areAllNegative:areAllNegative,ariaLabel:ariaLabel,barHeight:barHeight,containerWidth:width,data:data,groupHeight:groupHeight,id:id,index:index,isSimple:!0,isStacked:isStacked,name:name,stackedValues:stackedValues,xAxisOptions:xAxisOptions,xScale:xScale,yAxisOptions:yAxisOptions,zeroPosition:zeroPosition})},"group-"+name)}))]}),showLegend&&Object(jsx_runtime.jsx)(LegendContainer.a,{colorVisionType:constants.q,data:legend,onDimensionChange:setLegendDimensions,renderLegendContent:renderLegendContent,position:legendPosition})]})}try{Chart.displayName="Chart",Chart.__docgenInfo={description:"",displayName:"Chart",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"SimpleBarChartDataSeries[]"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!0,type:{name:"LabelFormatter"}},showLegend:{defaultValue:null,description:"",name:"showLegend",required:!0,type:{name:"boolean"}},type:{defaultValue:null,description:"",name:"type",required:!0,type:{name:"ChartType"}},xAxisOptions:{defaultValue:null,description:"",name:"xAxisOptions",required:!0,type:{name:"XAxisOptions"}},yAxisOptions:{defaultValue:null,description:"",name:"yAxisOptions",required:!0,type:{name:"YAxisOptions"}},dimensions:{defaultValue:null,description:"",name:"dimensions",required:!1,type:{name:"Dimensions"}},renderLegendContent:{defaultValue:null,description:"",name:"renderLegendContent",required:!1,type:{name:"RenderLegendContent"}},legendPosition:{defaultValue:{value:"bottom-right"},description:"",name:"legendPosition",required:!1,type:{name:"LegendPosition"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/SimpleBarChart/Chart.tsx#Chart"]={docgenInfo:Chart.__docgenInfo,name:"Chart",path:"packages/polaris-viz/src/components/SimpleBarChart/Chart.tsx#Chart"})}catch(__react_docgen_typescript_loader_error){}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:LABELS;return labels.map((function(name,index){var data=GROUPS.map((function(name,groupIndex){var item=items[groupIndex],array=Array.isArray(item)?item:[item];return null!=array[index]&&{key:name,value:array[index]}}));return{name:name,data:data.filter(Boolean),metadata:{trends:{0:{value:"10%"}}}}}))}var SERIES=buildSeries([[3,4,7],[0,0,0],[4,5,6],[8,15,12],[48,8,50],[1,5,5]]),SINGLE_SERIES=buildSeries([[3],[0],[4],[8],[48],[1]],[LABELS[0]]),LONG_LABEL_SERIES=buildSeries([[1e3],[6e3]],["Series label"])},"./packages/polaris-viz/src/components/SimpleBarChart/stories/meta.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return META}));var _storybook_constants__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./packages/polaris-viz/src/storybook/constants.ts"),_Docs_stories__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./packages/polaris-viz/src/components/Docs/stories/components/PageWithSizingInfo/PageWithSizingInfo.tsx"),META={title:"polaris-viz/Charts/SimpleBarChart",component:__webpack_require__("./packages/polaris-viz/src/components/SimpleBarChart/SimpleBarChart.tsx").a,parameters:{docs:{page:_Docs_stories__WEBPACK_IMPORTED_MODULE_1__.a,description:{component:"Used to show comparison of different types, across categories or time. Bars can be stacked or side by side. "}},controls:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.c},argTypes:{data:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.e,isAnimated:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.h,renderLegendContent:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.m,legendPosition:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.k,state:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.b,theme:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.r,type:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.s,xAxisOptions:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.t,yAxisOptions:_storybook_constants__WEBPACK_IMPORTED_MODULE_0__.u}}},"./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return SimpleNormalizedChart_SimpleNormalizedChart}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),usePolarisVizContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePolarisVizContext.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),types=__webpack_require__("./packages/polaris-viz-core/src/types.ts"),ChartContainer=__webpack_require__("./packages/polaris-viz/src/components/ChartContainer/ChartContainer.tsx"),ChartSkeleton=__webpack_require__("./packages/polaris-viz/src/components/ChartSkeleton/ChartSkeleton.tsx"),toConsumableArray=(__webpack_require__("./node_modules/core-js/modules/es.array.flat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.some.js"),__webpack_require__("./node_modules/core-js/modules/es.array.slice.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reverse.js"),__webpack_require__("./node_modules/core-js/modules/es.array.every.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.array.find.js"),__webpack_require__("./node_modules/core-js/modules/es.function.name.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.date.to-string.js"),__webpack_require__("./node_modules/@babel/runtime/helpers/toConsumableArray.js")),toConsumableArray_default=__webpack_require__.n(toConsumableArray),slicedToArray=__webpack_require__("./node_modules/@babel/runtime/helpers/slicedToArray.js"),slicedToArray_default=__webpack_require__.n(slicedToArray),react=__webpack_require__("./node_modules/react/index.js"),sum=__webpack_require__("./node_modules/d3-array/src/sum.js"),linear=__webpack_require__("./node_modules/d3-scale/src/linear.js"),getColorVisionStylesForActiveIndex=__webpack_require__("./packages/polaris-viz-core/src/utilities/getColorVisionStylesForActiveIndex.ts"),utilities_getColorVisionEventAttrs=__webpack_require__("./packages/polaris-viz-core/src/utilities/getColorVisionEventAttrs.ts"),useThemeSeriesColors=__webpack_require__("./packages/polaris-viz/src/hooks/useThemeSeriesColors.ts"),useColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useColorVisionEvents.ts"),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),useWatchColorVisionEvents=__webpack_require__("./packages/polaris-viz/src/hooks/ColorVisionA11y/useWatchColorVisionEvents.tsx"),classnames=__webpack_require__("./packages/polaris-viz/src/utilities/classnames.ts"),src_constants=__webpack_require__("./packages/polaris-viz/src/constants.ts"),getCSSBackgroundFromColor=__webpack_require__("./packages/polaris-viz/src/utilities/getCSSBackgroundFromColor.ts"),ComparisonMetric=__webpack_require__("./packages/polaris-viz/src/components/ComparisonMetric/ComparisonMetric.tsx"),BarLabel=__webpack_require__("./packages/polaris-viz/src/components/SimpleNormalizedChart/components/BarLabel/BarLabel.scss"),BarLabel_default=__webpack_require__.n(BarLabel),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _objectSpread(target){for(var i=1;i0&&scale<1.5?1.5:scale,isMaxScale=scale>=100,delay=150*index,angle="horizontal"===direction?90:180,dimension="horizontal"===direction?"width":"height",backgroundColor=Object(getCSSBackgroundFromColor.a)(color,angle),springConfig=Object(useBarSpringConfig.a)({animationDelay:delay}),spring=Object(react_spring_web_esm.useSpring)(BarSegment_objectSpread({from:defineProperty_default()({},dimension,"0%"),to:defineProperty_default()({},dimension,safeScale+"%")},springConfig));return Object(jsx_runtime.jsx)(react_spring_web_esm.animated.div,BarSegment_objectSpread(BarSegment_objectSpread({className:Object(classnames.a)(BarSegment_default.a.Segment,roundedCorners&&!isMaxScale&&BarSegment_default.a[direction+"-RoundedCorners"],roundedCorners&&isMaxScale&&BarSegment_default.a.RoundedCorners,BarSegment_default.a[direction+"-"+size]),style:BarSegment_objectSpread((_objectSpread2={},defineProperty_default()(_objectSpread2,dimension,shouldAnimate?spring[dimension]:safeScale+"%"),defineProperty_default()(_objectSpread2,"background",backgroundColor),_objectSpread2),Object(getColorVisionStylesForActiveIndex.a)({activeIndex:activeIndex,index:index}))},Object(utilities_getColorVisionEventAttrs.a)({type:constants.q,index:index})),{},{tabIndex:0}))}try{BarSegment_BarSegment.displayName="BarSegment",BarSegment_BarSegment.__docgenInfo={description:"",displayName:"BarSegment",props:{activeIndex:{defaultValue:null,description:"",name:"activeIndex",required:!0,type:{name:"number"}},index:{defaultValue:null,description:"",name:"index",required:!0,type:{name:"number"}},scale:{defaultValue:null,description:"",name:"scale",required:!0,type:{name:"number"}},color:{defaultValue:null,description:"",name:"color",required:!0,type:{name:"Color"}},size:{defaultValue:null,description:"",name:"size",required:!0,type:{name:"Size"}},direction:{defaultValue:null,description:"",name:"direction",required:!0,type:{name:"Direction"}},roundedCorners:{defaultValue:null,description:"",name:"roundedCorners",required:!0,type:{name:"number"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/SimpleNormalizedChart/components/BarSegment/BarSegment.tsx#BarSegment"]={docgenInfo:BarSegment_BarSegment.__docgenInfo,name:"BarSegment",path:"packages/polaris-viz/src/components/SimpleNormalizedChart/components/BarSegment/BarSegment.tsx#BarSegment"})}catch(__react_docgen_typescript_loader_error){}var SimpleNormalizedChart=__webpack_require__("./packages/polaris-viz/src/components/SimpleNormalizedChart/SimpleNormalizedChart.scss"),SimpleNormalizedChart_default=__webpack_require__.n(SimpleNormalizedChart);function Chart(_ref){var _ref$comparisonMetric=_ref.comparisonMetrics,comparisonMetrics=void 0===_ref$comparisonMetric?[]:_ref$comparisonMetric,data=_ref.data,labelFormatter=_ref.labelFormatter,_ref$legendPosition=_ref.legendPosition,legendPosition=void 0===_ref$legendPosition?"top-left":_ref$legendPosition,seriesNameFormatter=_ref.seriesNameFormatter,_ref$direction=_ref.direction,direction=void 0===_ref$direction?"horizontal":_ref$direction,_ref$size=_ref.size,size=void 0===_ref$size?"small":_ref$size,_ref$showLegend=_ref.showLegend,showLegend=void 0===_ref$showLegend||_ref$showLegend,renderLegendContent=_ref.renderLegendContent,flattenedData=data.map((function(_ref2){return _ref2.data})).flat();Object(useColorVisionEvents.a)();var selectedTheme=Object(useTheme.a)(),colors=Object(useThemeSeriesColors.a)(data,selectedTheme),containsNegatives=flattenedData.some((function(_ref3){var value=_ref3.value;return null!==value&&value<0})),_useState=Object(react.useState)(-1),_useState2=slicedToArray_default()(_useState,2),activeIndex=_useState2[0],setActiveIndex=_useState2[1];if(Object(useWatchColorVisionEvents.a)({type:constants.q,onIndexChange:function onIndexChange(_ref4){var detail=_ref4.detail;return setActiveIndex(detail.index)}}),src_constants.m&&containsNegatives&&console.warn("This component is not built to handle negatives. Consider using a different component."),src_constants.m&&flattenedData.length>4)throw new Error("This component displays a max of 4 data items. Please modify your data before passing it into this component.");var slicedData=flattenedData.slice(0,4),totalValue=Object(sum.a)(slicedData,(function(_ref5){return _ref5.value})),xScale=Object(linear.a)().range([0,100]).domain([0,totalValue]),isVertical="vertical"===direction,bars=isVertical?slicedData.reverse():slicedData,isEmptyValues=slicedData.every((function(_ref6){return!_ref6.value})),isRightLabel=legendPosition.includes("right"),isBottomLabel=legendPosition.includes("bottom"),isVerticalAndRightLabel=isVertical&&isRightLabel,isVerticalAndBottomLabel=isVertical&&isBottomLabel,isHorizontalAndRightLabel=!isVertical&&isRightLabel,isHorizontalAndBottomLabel=!isVertical&&isBottomLabel;return Object(jsx_runtime.jsxs)("div",{className:Object(classnames.a)(SimpleNormalizedChart_default.a.Container,isVertical?SimpleNormalizedChart_default.a.VerticalContainer:SimpleNormalizedChart_default.a.HorizontalContainer,isVerticalAndRightLabel&&SimpleNormalizedChart_default.a.VerticalContainerRightLabel,isHorizontalAndBottomLabel&&SimpleNormalizedChart_default.a.HorizontalContainerBottomLabel),children:[function legendMarkup(){if(!showLegend)return null;if(renderLegendContent){var colorVisionInteractionMethods={getColorVisionStyles:function getColorVisionStyles(index){return Object(getColorVisionStylesForActiveIndex.a)({activeIndex:activeIndex,index:index})},getColorVisionEventAttrs:function getColorVisionEventAttrs(index){return Object(utilities_getColorVisionEventAttrs.a)({type:constants.q,index:index})}};return Object(jsx_runtime.jsx)("div",{className:Object(classnames.a)(isVertical?SimpleNormalizedChart_default.a.VerticalLabelContainer:SimpleNormalizedChart_default.a.HorizontalLabelContainer,(isVerticalAndBottomLabel||isHorizontalAndRightLabel)&&SimpleNormalizedChart_default.a.LabelContainerEndJustify),children:renderLegendContent(colorVisionInteractionMethods)})}return Object(jsx_runtime.jsx)("ul",{className:classnames.a.apply(void 0,toConsumableArray_default()(isVertical?[SimpleNormalizedChart_default.a.VerticalLabelContainer]:[SimpleNormalizedChart_default.a.HorizontalLabelContainer,SimpleNormalizedChart_default.a.HorizontalLabelContainerGrid]).concat([(isVerticalAndBottomLabel||isHorizontalAndRightLabel)&&SimpleNormalizedChart_default.a.LabelContainerEndJustify])),children:slicedData.map((function(_ref7,index){var _data$index$name$toSt,_data$index$name,key=_ref7.key,value=_ref7.value;if(null==value)return null;var comparisonMetric=comparisonMetrics.find((function(_ref8){var dataIndex=_ref8.dataIndex;return index===dataIndex})),formattedValue=labelFormatter(value),formattedName=seriesNameFormatter(null!=(_data$index$name$toSt=null==(_data$index$name=data[index].name)?void 0:_data$index$name.toString())?_data$index$name$toSt:"");return Object(jsx_runtime.jsx)(BarLabel_BarLabel,{activeIndex:activeIndex,index:index,label:formattedName,value:formattedValue,color:colors[index],comparisonMetric:comparisonMetric,direction:direction,legendPosition:legendPosition},key+"-"+formattedValue+"-"+index)}))})}(),Object(jsx_runtime.jsx)("div",{className:Object(classnames.a)(SimpleNormalizedChart_default.a.BarContainer,isVertical?SimpleNormalizedChart_default.a.VerticalBarContainer:SimpleNormalizedChart_default.a.HorizontalBarContainer),children:isEmptyValues?Object(jsx_runtime.jsx)(BarSegment_BarSegment,{activeIndex:-1,index:-1,direction:direction,size:size,scale:100,color:selectedTheme.seriesColors.empty,roundedCorners:selectedTheme.bar.borderRadius},"empty-bar"):bars.map((function(_ref9,index){var value=_ref9.value,key=_ref9.key;if(null==value||0===value)return null;var colorIndex=isVertical?bars.length-1-index:index;return Object(jsx_runtime.jsx)(BarSegment_BarSegment,{activeIndex:activeIndex,index:colorIndex,direction:direction,size:size,scale:xScale(value),color:colors[colorIndex],roundedCorners:selectedTheme.bar.borderRadius},key+"-"+index)}))})]})}try{Chart.displayName="Chart",Chart.__docgenInfo={description:"",displayName:"Chart",props:{data:{defaultValue:null,description:"",name:"data",required:!0,type:{name:"DataSeries[]"}},labelFormatter:{defaultValue:null,description:"",name:"labelFormatter",required:!0,type:{name:"LabelFormatter"}},seriesNameFormatter:{defaultValue:null,description:"",name:"seriesNameFormatter",required:!0,type:{name:"LabelFormatter"}},comparisonMetrics:{defaultValue:{value:"[]"},description:"",name:"comparisonMetrics",required:!1,type:{name:'Omit[]'}},legendPosition:{defaultValue:{value:"top-left"},description:"",name:"legendPosition",required:!1,type:{name:"LegendPosition"}},direction:{defaultValue:{value:"horizontal"},description:"",name:"direction",required:!1,type:{name:"Direction"}},size:{defaultValue:{value:"small"},description:"",name:"size",required:!1,type:{name:"Size"}},showLegend:{defaultValue:{value:"true"},description:"",name:"showLegend",required:!1,type:{name:"boolean"}},renderLegendContent:{defaultValue:null,description:"",name:"renderLegendContent",required:!1,type:{name:"RenderLegendContent"}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["packages/polaris-viz/src/components/SimpleNormalizedChart/Chart.tsx#Chart"]={docgenInfo:Chart.__docgenInfo,name:"Chart",path:"packages/polaris-viz/src/components/SimpleNormalizedChart/Chart.tsx#Chart"})}catch(__react_docgen_typescript_loader_error){}function SimpleNormalizedChart_ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function SimpleNormalizedChart_objectSpread(target){for(var i=1;i
Note: We currently only support a single series. Any additional series passed to the data array will be ignored."},accessibilityLabel:{description:"Visually hidden text for screen readers."},targetLine:{description:"The prop to determine the value of the comparison line, as well as the number of pixels to add to the left and right margin to the bar data."},isAnimated:_storybook_constants__WEBPACK_IMPORTED_MODULE_2__.h,theme:_storybook_constants__WEBPACK_IMPORTED_MODULE_2__.r,state:_storybook_constants__WEBPACK_IMPORTED_MODULE_2__.b}}},"./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.scss":function(module,exports,__webpack_require__){var api=__webpack_require__("./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),content=__webpack_require__("./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.scss");"string"==typeof(content=content.__esModule?content.default:content)&&(content=[[module.i,content,""]]);var options={insert:"head",singleton:!1};api(content,options);module.exports=content.locals||{}},"./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.tsx":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,"a",(function(){return SparkLineChart_SparkLineChart}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var defineProperty=__webpack_require__("./node_modules/@babel/runtime/helpers/defineProperty.js"),defineProperty_default=__webpack_require__.n(defineProperty),usePolarisVizContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/usePolarisVizContext.ts"),constants=__webpack_require__("./packages/polaris-viz-core/src/constants.ts"),types=__webpack_require__("./packages/polaris-viz-core/src/types.ts"),ChartContainer=__webpack_require__("./packages/polaris-viz/src/components/ChartContainer/ChartContainer.tsx"),ChartSkeleton=__webpack_require__("./packages/polaris-viz/src/components/ChartSkeleton/ChartSkeleton.tsx"),fillMissingDataPoints=__webpack_require__("./packages/polaris-viz/src/utilities/fillMissingDataPoints.ts"),react=(__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/react/index.js")),linear=__webpack_require__("./node_modules/d3-scale/src/linear.js"),useChartContext=__webpack_require__("./packages/polaris-viz-core/src/hooks/useChartContext.ts"),useSparkLine=__webpack_require__("./packages/polaris-viz-core/src/hooks/useSparkLine.ts"),LineSeries=__webpack_require__("./packages/polaris-viz-core/src/components/LineSeries/LineSeries.tsx"),useThemeSeriesColors=__webpack_require__("./packages/polaris-viz/src/hooks/useThemeSeriesColors.ts"),useTheme=__webpack_require__("./packages/polaris-viz-core/src/hooks/useTheme.ts"),SparkLineChart=__webpack_require__("./packages/polaris-viz/src/components/SparkLineChart/SparkLineChart.scss"),SparkLineChart_default=__webpack_require__.n(SparkLineChart),jsx_runtime=__webpack_require__("./node_modules/react/jsx-runtime.js");function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function Chart(_ref){var data=_ref.data,dimensions=_ref.dimensions,accessibilityLabel=_ref.accessibilityLabel,_ref$offsetLeft=_ref.offsetLeft,offsetLeft=void 0===_ref$offsetLeft?0:_ref$offsetLeft,_ref$offsetRight=_ref.offsetRight,offsetRight=void 0===_ref$offsetRight?0:_ref$offsetRight,theme=Object(useChartContext.a)().theme,selectedTheme=Object(useTheme.a)(),seriesColors=Object(useThemeSeriesColors.a)(data,selectedTheme),_ref2=null!=dimensions?dimensions:{height:0,width:0},width=_ref2.width,height=_ref2.height,_useSparkLine=Object(useSparkLine.a)({data:data,height:height}),minXDomain=_useSparkLine.minXDomain,maxXDomain=_useSparkLine.maxXDomain,yScale=_useSparkLine.yScale;return Object(jsx_runtime.jsxs)(react.Fragment,{children:[accessibilityLabel?Object(jsx_runtime.jsx)("span",{className:SparkLineChart_default.a.VisuallyHidden,children:accessibilityLabel}):null,Object(jsx_runtime.jsx)("svg",{xmlns:constants.mb,"aria-hidden":!0,width:width,height:height,children:data.map((function(series,index){var singleOffsetLeft=series.isComparison?0:offsetLeft,singleOffsetRight=series.isComparison?0:offsetRight,xScale=Object(linear.a)().range([singleOffsetLeft+2,width-singleOffsetRight-2]).domain([minXDomain,maxXDomain]),seriesWithColor=function _objectSpread(target){for(var i=1;i