@react-magma/charts 11.0.0-next.2 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts +100 -79
- package/dist/charts.css +19 -3
- package/dist/charts.css.map +1 -1
- package/dist/charts.js +1 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.map +1 -1
- package/dist/charts.modern.module.js +1 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +1 -1
- package/dist/charts.umd.js.map +1 -1
- package/dist/components/CarbonChart/index.d.ts +1 -1
- package/dist/components/LineChart/ChartDataTable.d.ts +1 -0
- package/dist/components/LineChart/DataTable.d.ts +1 -0
- package/dist/components/LineChart/GraphTooltip.d.ts +1 -0
- package/package.json +26 -26
- package/src/components/CarbonChart/CarbonChart.test.js +3 -1
- package/src/components/CarbonChart/CarbonChart.tsx +123 -101
- package/src/components/CarbonChart/CarbonChartArea.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartBar.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +4 -4
- package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartLine.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartPie.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +4 -2
- package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +3 -1
- package/src/components/CarbonChart/CarbonChartStep.stories.tsx +3 -1
- package/src/components/CarbonChart/index.ts +1 -1
- package/src/components/CarbonChart/styles.min.css +24790 -3
- package/src/components/LineChart/Chart.tsx +10 -5
- package/src/components/LineChart/ChartDataTable.test.js +3 -1
- package/src/components/LineChart/ChartDataTable.tsx +6 -6
- package/src/components/LineChart/CustomAxisComponent.tsx +1 -0
- package/src/components/LineChart/CustomPointComponent.tsx +2 -1
- package/src/components/LineChart/GraphTooltip.tsx +2 -2
- package/src/components/LineChart/LegendButton.tsx +1 -0
- package/src/components/LineChart/LineChart.stories.tsx +4 -1
- package/src/components/LineChart/LineChart.test.js +4 -1
- package/src/components/LineChart/LineChart.tsx +11 -12
- package/src/index.ts +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{css as n}from"@emotion/react";import{KeyboardIcon as t}from"react-magma-icons";import{Point as r,LineSegment as o,VictoryChart as a,VictoryVoronoiContainer as i,VictoryTooltip as s,VictoryAxis as l,VictoryLine as c,VictoryScatter as d}from"victory";import{StyledTooltip as u,ThemeContext as f,TooltipPosition as p,TooltipArrow as h,useForceUpdate as m,Checkbox as g,I18nContext as b,Card as v,Datagrid as x,Spinner as y,styled as k,Paragraph as w,TabsContainer as I,TabPanel as S,useDescendants as F,TypographyVisualStyle as P,Tabs as L,Tab as z,Tooltip as C,IconButton as E,ButtonVariant as A,Announce as j,TabPanelsContainer as O,useIsInverse as R}from"react-magma-dom";import W from"@emotion/styled";import{jsx as D,jsxs as T,Fragment as H}from"react/jsx-runtime";import{AreaChart as q,StackedAreaChart as _,SimpleBarChart as M,GroupedBarChart as G,StackedBarChart as B,DonutChart as $,LineChart as K,LollipopChart as V,PieChart as Y,RadarChart as N,BoxplotChart as U,BubbleChart as X,BulletChart as Z,GaugeChart as J,HistogramChart as Q,MeterChart as ee,ScatterChart as ne,ComboChart as te}from"@carbon/charts-react";function re(){return re=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},re.apply(this,arguments)}function oe(e,n){if(null==e)return{};var t={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(n.indexOf(r)>=0)continue;t[r]=e[r]}return t}function ae(e,n){return n||(n=e.slice(0)),e.raw=n,e}var ie,se,le,ce,de,ue,fe=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],pe={width:350,height:350,padding:50},he={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:"#3F3F3F",stroke:"transparent",strokeWidth:0},me=re({textAnchor:"middle"},he),ge={area:re({style:{data:{fill:"pink"},labels:he}},pe),axis:re({style:{axis:{fill:"transparent",stroke:"#8F8F8F",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:re({},me,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:"#dfdfdf",strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"painted"},ticks:{fill:"transparent",size:0,stroke:"#8F8F8F",strokeWidth:0,strokeLinecap:"round",strokeLinejoin:"round"},tickLabels:re({},he,{fill:"#3F3F3F"})}},pe),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:re({style:{data:{fill:"#3F3F3F",padding:8,strokeWidth:0},labels:he}},pe),boxplot:re({style:{max:{padding:8,stroke:"#3F3F3F",strokeWidth:1},maxLabels:re({},he,{padding:3}),median:{padding:8,stroke:"#3F3F3F",strokeWidth:1},medianLabels:re({},he,{padding:3}),min:{padding:8,stroke:"#3F3F3F",strokeWidth:1},minLabels:re({},he,{padding:3}),q1:{padding:8,fill:"#3F3F3F"},q1Labels:re({},he,{padding:3}),q3:{padding:8,fill:"#3F3F3F"},q3Labels:re({},he,{padding:3})},boxWidth:20},pe),candlestick:re({style:{data:{stroke:"#3F3F3F"},labels:re({},he,{padding:5})},candleColors:{positive:"#ffffff",negative:"#3F3F3F"}},pe),chart:pe,errorbar:re({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:he}},pe),group:re({colorScale:fe},pe),histogram:re({style:{data:{fill:"#3F3F3F",stroke:"pink",strokeWidth:2},labels:he}},pe),legend:{colorScale:fe,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:he,title:re({},he,{padding:5})}},line:re({style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:he}},pe),pie:re({colorScale:fe,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:re({},he,{padding:20})}},pe),scatter:re({style:{data:{fill:"#3F3F3F",opacity:1,stroke:"transparent",strokeWidth:0},labels:he}},pe),stack:re({colorScale:fe},pe),tooltip:{style:re({},he,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:re({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:re({},he,{padding:5,pointerEvents:"none"}),flyout:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},pe)},be=W(u)(ie||(ie=ae(["\n background: ",";\n border: 1px solid ",";\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);\n box-sizing: border-box;\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: ",";\n margin: 0;\n padding: 8px;\n width: fit-content;\n div {\n margin-bottom: 8px;\n display: flex;\n align-items: flex-start;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n"])),function(e){return e.theme.colors.neutral100},function(e){return e.theme.colors.neutral300},function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.theme.typeScale.size02.lineHeight}),ve=W.span(se||(se=ae(["\n background: ",";\n border: ",";\n border-radius: 4px;\n height: 20px;\n width: 20px;\n margin-right: 8px;\n"])),function(e){return e.color},function(e){return e.color?"none":"3px solid black"}),xe=function(n){var t=n.datum,r=n.index,o=n.showTooltip,a=n.x,i=n.y,s=e.useContext(f);return o===r+"-"+t.index?D("g",{style:{pointerEvents:"none"},children:D("foreignObject",{x:a,y:i,width:"275",height:"100%",children:T(be,{position:p.top,role:"tooltip",theme:s,children:[T("div",{children:[D(ve,{color:s.iterableColors[r]}),D("span",{children:t.label})]}),D(h,{theme:s})]})})}):null},ye=function(n){var t=n.x,r=n.y,o=n.activePoints,a=n.hiddenData,i=Array.from(Array(n.dataLength-0),function(e,n){return n+0}).filter(function(e){return!a.includes(e)}),s=e.useContext(f);return D("g",{style:{pointerEvents:"none"},children:D("foreignObject",{x:t,y:r,width:"275",height:"100%",children:T(be,{"data-testid":"axis-tooltip",position:p.top,role:"tooltip",theme:s,children:[o.map(function(e,n){return T("div",{children:[D(ve,{color:s.iterableColors[i[n]]}),D("span",{children:e.label})]},n)}),D(h,{theme:s})]})})})},ke=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],we=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],Ie=function(e){var n=e.datum,t=e.index,o=e.lineIndex,a=e.pointRefArray,i=e.registerPoint,s=e.unregisterPoint,l=oe(e,ke);return D(r,re({},l,{ariaLabel:n.label,pathComponent:D(Se,{lineIndex:o,pointIndex:t,pointRefArray:a,registerPoint:i,unregisterPoint:s}),role:"button",tabIndex:0}))},Se=function(n){var t=n.lineIndex,r=n.pointRefArray,o=n.pointIndex,a=n.registerPoint,i=n.unregisterPoint,s=oe(n,we),l=m(),c=e.useRef(null);return e.useEffect(function(){return a(r,c),l(),function(){return i(r,c)}},[]),D("path",re({ref:c,"data-line-index":t,"data-point-index":o},s))},Fe=["events"],Pe=function(e){var n=e.events,t=oe(e,Fe);return T("g",{children:[D(o,re({},t,{events:n,style:{strokeWidth:"50px",stroke:"transparent"}})),D(o,re({},t,{events:n,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},Le=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],ze=e.forwardRef(function(n,t){var r=n.color,o=n.dataIndex,a=n.isHidden,i=n.onClick,s=n.name,l=n.focusCurrentLine,c=n.resetLineFocus,d=oe(n,Le);function u(){a||l&&"function"==typeof l&&l(o)}var p=e.useContext(f);return D("div",{style:{display:"inline-flex"},onMouseEnter:u,onMouseLeave:c,children:D(g,re({checked:!a,color:r,containerStyle:{alignItems:"center",border:"0",boxShadow:"0 0 0",color:p.colors.neutral,display:"inline-flex",margin:"0 36px 20px 0",padding:"0"},inputStyle:{border:r?"none":"2px solid "+p.colors.neutral800,borderRadius:"4px"},labelText:s,onBlur:c,onClick:function(){i&&"function"==typeof i&&i(o),a||c&&"function"==typeof c&&c()},onFocus:u,ref:t,theme:p},d))})}),Ce=["axisLabel","tickLabels"],Ee=["style"],Ae=["axisLabel","tickLabels"],je=["style"],Oe=W.div(le||(le=ae(["\n max-height: 600px;\n max-width: 800px;\n svg {\n overflow: visible;\n }\n"]))),Re=W.div(ce||(ce=ae([""]))),We=W.div(de||(de=ae(["\n padding-bottom: 24px;\n"]))),De=W.p(ue||(ue=ae(["\n color: ",";\n font-size: ",";\n"])),function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size02.fontSize});function Te(n){var t=n.componentProps,r=void 0===t?{}:t,o=r.chart,u=void 0===o?{}:o,p=r.line,h=void 0===p?{}:p,m=r.scatter,g=void 0===m?{}:m,v=r.xAxis,x=void 0===v?{style:{}}:v,y=x.style,k=void 0===y?{}:y,w=k.axisLabel,I=void 0===w?void 0:w,S=k.tickLabels,F=void 0===S?void 0:S,P=oe(k,Ce),L=oe(x,Ee),z=r.yAxis,C=void 0===z?{style:{}}:z,E=C.style,A=void 0===E?{}:E,j=A.axisLabel,O=void 0===j?void 0:j,R=A.tickLabels,W=void 0===R?void 0:R,q=oe(A,Ae),_=oe(C,je),M=n.data,G=void 0===M?[]:M,B=n.lastFocusedScatterPoint,$=n.pointRefArray,K=n.registerPoint,V=n.unregisterPoint,Y=n.tabRef,N=n.x,U=n.y,X=e.useContext(f),Z=e.useContext(b),J=e.useState([]),Q=J[0],ee=J[1],ne=e.useState(800),te=ne[0],ae=ne[1],ie=e.useState(null),se=ie[0],le=ie[1],ce=e.useState(null),de=ce[0],ue=ce[1],fe=e.useState(!0),pe=fe[0],he=fe[1],me=e.useState(!1),be=me[0],ve=me[1],ke=e.useRef(null),we=e.useRef(null);e.useEffect(function(){return Te(),window.addEventListener("resize",Te),window.addEventListener("keydown",He),function(){window.removeEventListener("resize",Te),window.removeEventListener("keydown",He)}},[]),e.useEffect(function(){return window.addEventListener("mousemove",qe),function(){window.removeEventListener("mousemove",qe)}},[de]);var Se=G.map(function(e,n){return"scatter-"+n}),Fe=re({tickLabels:re({color:"#3f3f3f",fontSize:12},F),axisLabel:re({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},I)},P),Le=re({tickLabels:re({fontSize:12},W),axisLabel:re({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},O)},q);function Te(){ke.current&&ae(ke.current.clientWidth)}function He(e){"Escape"===e.key&&(ue(null),he(!1))}function qe(){!de&&he(!0)}function _e(e){return null===se||se===e?1:.1}function Me(e){Q.includes(e)?ee(Q.filter(function(n){return n!==e})):ee(Q.concat([e]))}function Ge(e){le(e)}function Be(){le(null)}var $e=function(e,n){if(n.current){var t=parseInt(n.current.getAttribute("data-line-index"),10);!e.includes(t)&&e.push(parseInt(n.current.getAttribute("data-line-index"),10))}return e},Ke=function(e){var n=parseInt(e.current.getAttribute("data-line-index"),10),t=parseInt(e.current.getAttribute("data-point-index"),10),r=$.current.reduce($e,[]);return{currentLineIndex:n,currentPointIndex:t,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},Ve=function(e,n){return function(t){return t.current&&parseInt(t.current.getAttribute("data-line-index"),10)===e&&parseInt(t.current.getAttribute("data-point-index"),10)===n}};function Ye(e){"Tab"===e.key&&e.shiftKey&&B&&B.current&&$.current.find(function(e){return e.current===B.current})&&(e.preventDefault(),B.current.focus())}return T(Oe,{ref:ke,children:[D(Re,{onKeyDown:function(e){var n=e.shiftKey;switch(e.key){case"Tab":e.preventDefault(),B.current=$.current.find(function(e){return e.current===document.activeElement}).current,n?Y.current&&Y.current.focus():we.current&&we.current.focus();break;case"ArrowRight":var t,r=$.current.findIndex(function(e){return e.current===document.activeElement});void 0!==r&&(r===$.current.length-1?null==(t=$.current[0])||null==(t=t.current)||t.focus():$.current[r+1].current.focus());break;case"ArrowLeft":var o=$.current.findIndex(function(e){return e.current===document.activeElement});void 0!==o&&(0===o?$.current[$.current.length-1].current.focus():$.current[o-1].current.focus());break;case"ArrowUp":e.preventDefault();var a=$.current.find(function(e){return e.current===document.activeElement});if(a&&a.current){var i=Ke(a),s=i.currentLineIndex,l=i.currentPointIndex,c=i.lineIndexes;if(s===i.lowestLineIndex)$.current.find(Ve(i.highestLineIndex,l)).current.focus();else{var d=c[c.indexOf(s)-1];$.current.find(Ve(d,l)).current.focus()}}break;case"ArrowDown":e.preventDefault();var u=$.current.find(function(e){return e.current===document.activeElement});if(u&&u.current){var f=Ke(u),p=f.currentLineIndex,h=f.currentPointIndex,m=f.lineIndexes;if(p===f.highestLineIndex)$.current.find(Ve(f.lowestLineIndex,h)).current.focus();else{var g=m[m.indexOf(p)+1];$.current.find(Ve(g,h)).current.focus()}}}},children:T(a,re({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:ge,width:te,containerComponent:D(i,{name:"xAxisGroupLabel",voronoiBlacklist:Se,voronoiDimension:"x",labels:be&&pe?function(){return" "}:void 0,labelComponent:pe?D(s,{flyoutComponent:D(ye,{dataLength:G.length,hiddenData:Q})}):void 0,role:"presentation",voronoiPadding:32})},u,{children:[D(l,re({},_,{dependentAxis:!0,style:Le})),G.map(function(e,n){var t=e.data;return!Q.includes(n)&&D(c,re({style:{data:{opacity:_e(n),stroke:X.iterableColors[n],strokeWidth:"3"},parent:{border:X.colors.neutral400}},data:t,labelComponent:D(H,{}),x:N,y:U},h),"line"+n)}),D(l,re({},L,{style:Fe,gridComponent:D(Pe,{events:{onMouseEnter:function(){return ve(!0)},onMouseLeave:function(){return ve(!1)}}})})),G.map(function(e,n){var t=e.data;return!Q.includes(n)&&D(d,re({name:"scatter-"+n,events:[{target:"data",eventHandlers:{onBlur:function(){return he(!0),ue(null),[{target:"labels",mutation:function(){return{active:void 0}}}]},onClick:function(){return[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onFocus:function(){return he(!1),[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onMouseEnter:function(){return he(!1),[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onMouseLeave:function(){ue(null),he(!0)}}}],style:{data:{fill:X.colors.neutral100,opacity:_e(n),stroke:X.iterableColors[n],strokeWidth:2}},size:5,data:t.map(function(e,t){return re({index:t,lineIndex:n},e)}),dataComponent:D(Ie,{lineIndex:n,pointRefArray:$,registerPoint:K,unregisterPoint:V}),labels:function(){return""},labelComponent:D(s,{text:"",flyoutComponent:D(xe,{index:n,showTooltip:de})}),x:N,y:U},g),"scatter"+n)})]}))}),T(We,{children:[D(De,{theme:X,children:Z.charts.line.dataLegendsLabel}),G.map(function(e,n){var t=e.name,r=Z.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,t);return D(ze,{"aria-label":r,color:X.iterableColors[n],dataIndex:n,isHidden:Q.includes(n),name:t,onClick:Me,onKeyDown:0===n?Ye:void 0,focusCurrentLine:Ge,ref:0===n?we:void 0,resetLineFocus:Be},n)})]})]})}function He(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,n){return 0===n?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}var qe,_e,Me,Ge,Be,$e,Ke=function(n){var t=n.data,r=void 0===t?[]:t,o=n.xData,a=o.keyValue,i=o.label,s=o.tickFormat,l=o.tickValues,c=n.yData,d=c.keyValue,u=c.tickFormat,f=e.useState({columns:[],rows:[]}),p=f[0],h=f[1];return e.useEffect(function(){var e,n,t;h((e=He(a||i||"x"),n=r.reduce(function(e,n){return n.data.forEach(function(n){var t=n.x||a&&n[a];!e.includes(t)&&e.push(t)}),e},[]),t={columns:n.length>0?[{field:e,header:i||a||"X",isRowHeader:!0}]:[],rows:n.reduce(function(t,r,o){var a,i=l&&"number"==typeof r&&l.length===n.length?s&&"function"==typeof s?s(l[r-1]):l[r-1]:s&&Array.isArray(s)?s[r-1]:s&&"function"==typeof s?s(r):r;return t.push(((a={})[e]=i,a.id=o,a)),t},[])},r.reduce(function(e,n){var r=n.name,o=n.data,a=He(r);return e.columns.push({field:a,header:r}),o.forEach(function(n,r){var o,i=n.y||0===n.y?n.y:d&&n[d];e.rows[r]=re({},e.rows[r],((o={id:t.rows.length>0?r+1:r})[a]=u&&"function"==typeof u?u(i):i,o))}),e},t)))},[r]),D(v,{children:p.rows.length>0?D(x,{hasPagination:!1,columns:p.columns,rows:p.rows}):D(y,{})})},Ve=["description","title","testId","type"],Ye=k.span(qe||(qe=ae(["\n color: ",";\n font-size: ",";\n font-weight: 600;\n font-family: ",";\n line-height: ",";\n margin: 0 0 12px 0;\n"])),function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size04.fontSize},function(e){return e.theme.bodyFont},function(e){return e.theme.typeScale.size04.lineHeight}),Ne=k(w)(_e||(_e=ae(["\n font-size: ",";\n margin: 0 0 18px 0;\n"])),function(e){return e.theme.typeScale.size02.fontSize}),Ue=k(I)(Me||(Me=ae(["\n width: 800px;\n ul {\n box-shadow: inset 0 -1px 0 ",";\n }\n"])),function(e){return e.theme.colors.neutral300}),Xe=k(S)(Ge||(Ge=ae(["\n padding: 22px 0;\n"]))),Ze=k(v)(Be||(Be=ae(["\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);\n display: ",";\n right: ",";\n max-height: ",";\n opacity: ",";\n outline: 0;\n overflow-y: auto;\n padding: ","\n ",";\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ","\n"])),function(e){return e.isOpen?"block":"none"},function(e){return e.theme.spaceScale.spacing02},function(e){return e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight},function(e){return e.isOpen?"1":"0"},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.spaceScale.spacing05},function(e){return e.width&&n($e||($e=ae(["\n white-space: normal;\n width: ",";\n "])),e.width)});function Je(n,r){var o,a,i,s=n.description,l=n.title,c=n.type,d=oe(n,Ve),u=e.useRef(null),p=e.useRef(null),h=e.useContext(f),m=e.useContext(b),g=F(),v=g[0],x=g[1],y=g[2],k=e.useState(!1),I=k[0],S=k[1];return T("div",{ref:r,children:[D(Ye,{theme:h,children:l}),s&&D(Ne,{theme:h,visualStyle:P.bodySmall,children:s}),T(Ue,{theme:h,children:[T(L,{children:[D(z,{children:m.charts.line.chartTabLabel}),D(z,{children:m.charts.line.dataTabLabel}),T("div",{onBlur:function(){S(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[D(C,{content:m.charts.line.keyboardInstructionsTooltip,ref:u,children:D(E,{"aria-controls":"keyboardInstructions","aria-label":m.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(I),icon:D(t,{}),onClick:function(){S(function(e){return!e})},onKeyDown:function(e){var n=e.shiftKey;switch(e.key){case"Escape":S(!1);break;case"Tab":!n&&p&&p.current&&v.current.find(function(e){return e.current===p.current})&&(e.preventDefault(),p.current.focus())}},variant:A.link})}),D(j,{children:T(Ze,{id:"keyboardInstructions",isOpen:I,theme:h,width:"350px",children:[D(w,{visualStyle:P.headingXSmall,style:{margin:"0 0 16px"},children:m.charts.line.keyboardInstructionsHeader}),m.charts.line.keyboardInstructions]})})]})]}),T(O,{children:[D(Xe,{theme:h,children:"line"===c&&D(Te,re({},d,{lastFocusedScatterPoint:p,pointRefArray:v,registerPoint:x,tabRef:u,unregisterPoint:y}))}),D(Xe,{theme:h,children:D(Ke,{data:d.data,xData:{keyValue:d.x,label:null==(o=d.componentProps)||null==(o=o.xAxis)?void 0:o.label,tickFormat:null==(a=d.componentProps)||null==(a=a.xAxis)?void 0:a.tickFormat},yData:{keyValue:d.y,tickFormat:null==(i=d.componentProps)||null==(i=i.yAxis)?void 0:i.tickFormat}})})]})]})]})}var Qe=e.forwardRef(Je);function en(){return en=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},en.apply(this,arguments)}function nn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tn(e,n){return tn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},tn(e,n)}function rn(e){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rn(e)}function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(on=function(){return!!e})()}function an(e,n,t){if(on())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,n);var o=new(e.bind.apply(e,r));return t&&tn(o,t.prototype),o}function sn(e){var n="function"==typeof Map?new Map:void 0;return sn=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(n){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return an(e,arguments,rn(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),tn(t,e)},sn(e)}var ln={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found.\n\n",75:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"};function cn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,o=n[0],a=[];for(r=1;r<n.length;r+=1)a.push(n[r]);return a.forEach(function(e){o=o.replace(/%[a-z]/,e)}),o}var dn=function(e){var n,t;function r(n){var t;if("production"===process.env.NODE_ENV)t=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+n+" for more information.")||this;else{for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];t=e.call(this,cn.apply(void 0,[ln[n]].concat(o)))||this}return nn(t)}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,tn(n,t),r}(sn(Error));function un(e){return Math.round(255*e)}function fn(e,n,t){return un(e)+","+un(n)+","+un(t)}function pn(e,n,t,r){if(void 0===r&&(r=fn),0===n)return r(t,t,t);var o=(e%360+360)%360/60,a=(1-Math.abs(2*t-1))*n,i=a*(1-Math.abs(o%2-1)),s=0,l=0,c=0;o>=0&&o<1?(s=a,l=i):o>=1&&o<2?(s=i,l=a):o>=2&&o<3?(l=a,c=i):o>=3&&o<4?(l=i,c=a):o>=4&&o<5?(s=i,c=a):o>=5&&o<6&&(s=a,c=i);var d=t-a/2;return r(s+d,l+d,c+d)}var hn={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},mn=/^#[a-fA-F0-9]{6}$/,gn=/^#[a-fA-F0-9]{8}$/,bn=/^#[a-fA-F0-9]{3}$/,vn=/^#[a-fA-F0-9]{4}$/,xn=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,yn=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,kn=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,wn=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,In=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function Sn(e){var n=e.toString(16);return 1===n.length?"0"+n:n}function Fn(e,n,t){return function(){var r=t.concat(Array.prototype.slice.call(arguments));return r.length>=n?e.apply(this,r):Fn(e,n,r)}}function Pn(e){return Fn(e,e.length,[])}function Ln(e,n){if("transparent"===n)return n;var t,r=function(e){if("string"!=typeof e)throw new dn(3);var n=function(e){if("string"!=typeof e)return e;var n=e.toLowerCase();return hn[n]?"#"+hn[n]:e}(e);if(n.match(mn))return{red:parseInt(""+n[1]+n[2],16),green:parseInt(""+n[3]+n[4],16),blue:parseInt(""+n[5]+n[6],16)};if(n.match(gn)){var t=parseFloat((parseInt(""+n[7]+n[8],16)/255).toFixed(2));return{red:parseInt(""+n[1]+n[2],16),green:parseInt(""+n[3]+n[4],16),blue:parseInt(""+n[5]+n[6],16),alpha:t}}if(n.match(bn))return{red:parseInt(""+n[1]+n[1],16),green:parseInt(""+n[2]+n[2],16),blue:parseInt(""+n[3]+n[3],16)};if(n.match(vn)){var r=parseFloat((parseInt(""+n[4]+n[4],16)/255).toFixed(2));return{red:parseInt(""+n[1]+n[1],16),green:parseInt(""+n[2]+n[2],16),blue:parseInt(""+n[3]+n[3],16),alpha:r}}var o=xn.exec(n);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=yn.exec(n.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=kn.exec(n);if(i){var s="rgb("+pn(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",l=xn.exec(s);if(!l)throw new dn(4,n,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=wn.exec(n.substring(0,50));if(c){var d="rgb("+pn(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",u=xn.exec(d);if(!u)throw new dn(4,n,d);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+c[4])}}throw new dn(5)}(n);return function(e,n,t,r){if("object"==typeof e)return e.alpha>=1?function(e,n,t){if("number"==typeof e&&"number"==typeof n&&"number"==typeof t)return In("#"+Sn(e)+Sn(n)+Sn(t));if("object"==typeof e&&void 0===n&&void 0===t)return In("#"+Sn(e.red)+Sn(e.green)+Sn(e.blue));throw new dn(6)}(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new dn(7)}(en({},r,{alpha:(t=+(100*("number"==typeof r.alpha?r.alpha:1)-100*parseFloat(e)).toFixed(2)/100,Math.max(0,Math.min(1,t)))}))}var zn,Cn,En=Pn(Ln),An=["children","testId","isInverse","type","dataSet","options"];!function(e){e.area="area",e.areaStacked="areaStacked",e.bar="bar",e.barGrouped="barGrouped",e.barStacked="barStacked",e.boxplot="boxplot",e.bubble="bubble",e.bullet="bullet",e.donut="donut",e.gauge="gauge",e.histogram="histogram",e.line="line",e.lollipop="lollipop",e.meter="meter",e.pie="pie",e.radar="radar",e.scatter="scatter",e.combo="combo"}(Cn||(Cn={}));var jn,On=W.div(zn||(zn=ae(["\n .cds--data-table thead tr th {\n background: "," !important;\n }\n .cds--data-table td,\n .cds--data-table tbody th {\n color: ",";\n }\n .cds--data-table tbody tr,\n .cds--data-table tbody tr td,\n .cds--data-table tbody tr th {\n color: ",";\n }\n .cds--data-table tr {\n block-size: 2.5rem;\n }\n\n .cds--cc--tooltip .content-box .datapoint-tooltip p {\n font-size: ",";\n padding: ",";\n color: ",";\n max-width:142px;\n white-space: normal;\n }\n\n .cds--modal-container {\n clip-path: inset(0% 0% 0% 0% round ",");\n background: ",";\n .cds--data-table th {\n background: ",";\n }\n .cds--data-table td {\n border-top: 1px solid\n ",";\n border-bottom: 1px solid\n ",";\n background: ",";\n }\n .cds--data-table tr:hover td {\n background: ",";\n }\n }\n\n p,\n div,\n text,\n .cds--cc--axes g.axis .axis-title,\n .cds--cc--title p.title,\n .cds--cc--axes g.axis g.tick text {\n font-family: "," !important;\n color: ",";\n }\n\n .cds--cc--axes {\n overflow: visible;\n }\n\n div.cds--cc--legend {\n div.legend-item {\n div.checkbox {\n background: ",";\n border: none;\n width: ",";\n height: ",";\n svg {\n left: 2px;\n position: relative;\n }\n }\n p {\n font-size: ",";\n margin: 0 "," 0 0;\n }\n }\n }\n div.cds--cc--legend.has-deactivated-items {\n div.legend-item {\n div.checkbox {\n border: 1px solid\n ",";\n }\n div.checkbox.active {\n border: 1px solid transparent;\n }\n }\n }\n .chart-holder {\n .cds--cc--axes g.axis g.tick text {\n fill: ",";\n }\n .cds--cc--axes g.axis path.domain {\n stroke: ",";\n }\n .cds--cc--grid g.x.grid g.tick line,\n .cds--cc--grid g.y.grid g.tick line {\n stroke: ",";\n }\n .cds--cc--grid rect.chart-grid-backdrop.stroked{\n stroke: ","\n }\n .cds--cc--skeleton .shimmer-effect-lines {\n filter: ",";\n }\n /* .chart-holder.cds--chart-holder.filled,\n .cds--cc--skeleton rect.chart-skeleton-backdrop,\n .cds--cc--grid rect.chart-grid-backdrop {\n } */\n \n .cds--cc--grid rect.chart-grid-backdrop{\n fill:transparent;\n }\n .cds--cc--scatter circle.dot.hovered {\n padding: 10px;\n }\n .cds--cc--scatter-stacked circle.dot.hovered,\n .cds--cc--scatter-stacked circle.dot.unfilled,\n .cds--cc--scatter circle.dot.unfilled{\n stroke-width: 6px;\n transition: 0.1s all linear;\n \n }\n .cds--cc--scatter circle.dot.hovered {\n stroke-width: 0.5em;\n transition: 0.1s all linear;\n filter: \n drop-shadow( 1px 0px 0px ",") \n drop-shadow(-1px 0px 0px ",")\n drop-shadow( 0px 1px 0px ",") \n drop-shadow( 0px -1px 0px ",");\n }\n .cds--cc--lollipop circle.dot.filled,\n .cds--cc--lollipop circle.dot.hovered {\n stroke-width: 15px;\n }\n .cds--cc--scatter-stacked circle.dot.hovered,\n .cds--cc--scatter-stacked circle.dot.unfilled,\n .cds--cc--scatter circle.dot.unfilled,\n .cds--cc--lollipop circle.dot.filled,\n .cds--cc--lollipop circle.dot.hovered{\n transition: 0.1s all linear;\n filter: \n drop-shadow( 1px 0px 0px ",")\n drop-shadow(-1px 0px 0px ",")\n drop-shadow( 0px 1px 0px ",")\n drop-shadow( 0px -1px 0px ",");\n }\n .cds--cc--lollipop .cds--cc--scatter circle.dot.hovered{\n transition: 0.1s all linear;\n stroke-width: 1.1em;\n }\n\n .cds--overflow-menu-options__btn:focus {\n outline-color: ",";\n }\n\n .cds--btn {\n min-height: auto;\n display: flex;\n flex: 0 auto;\n align-items: center;\n text-align: center;\n padding: 20px;\n margin: 0;\n line-height: ",";\n margin: 0;\n min-width: ",";\n overflow: hidden;\n padding: ;\n position: relative;\n right: ",";\n text-align: center;\n height: 40px;\n font-family: ",";\n font-size: ",";\n border-radius: ",";\n font-weight: 500;\n }\n\n .cds--btn--primary {\n background: ",";\n color: ",";\n }\n\n *:focus {\n outline: 2px solid\n "," !important;\n outline-offset: 0;\n }\n .cds--overflow-menu-options__btn:focus,\n .cds--overflow-menu:focus,\n .cds--overflow-menu__trigger:focus,\n .toolbar-control:focus {\n outline: 2px solid\n "," !important;\n }\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):focus\n div.checkbox,\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):hover\n div.checkbox {\n border: ",";\n }\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):hover\n div.checkbox {\n box-shadow: 0 0 0 2px\n "," !important;\n }\n\n .cds--btn--primary {\n &:focus {\n outline: 2px solid\n ",";\n }\n outline-offset: 2px;\n border: none;\n box-shadow: none;\n }\n .cds--modal-header {\n background: ",";\n margin-bottom: 0;\n border-bottom: 1px solid\n ",";\n }\n .cds--modal-header__heading {\n font-weight: 600;\n }\n\n .cds--modal-close {\n position: absolute;\n top: 0;\n right: 0;\n &:focus {\n outline: 2px solid\n ",";\n border-color: none;\n }\n outline-offset: 0;\n border: none;\n }\n }\n\n .cds--modal-footer.cds--modal-footer {\n display: flex;\n align-items: center;\n border-top: 1px solid\n ",";\n background: "," !important;\n }\n .layout-child.header {\n height: auto !important;\n p {\n text-overflow: inherit;\n overflow: auto;\n white-space: normal;\n }\n }\n\n svg:not(:root) {\n overflow: visible;\n }\n\n .cds--cc--chart-wrapper text {\n font-size: ",";\n }\n\n g.center text,\n .pie-label{\n fill: "," ;\n }\n\n // Zoom responsive tweaks\n\n @media screen and (max-width: 760px) {\n .cds--modal-container {\n overflow-y: auto;\n }\n .cds--chart-holder .cds--modal .cds--modal-container .cds--modal-content {\n overflow: visible;\n }\n .cds--chart-holder\n .cds--modal\n .cds--modal-container\n .cds--modal-content\n table\n th {\n position: relative;\n }\n }\n"])),function(e){return e.isInverse?e.theme.colors.primary700:""},function(e){return e.theme.colors.neutral700},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.theme.spaceScale.spacing02},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700},function(e){return e.theme.borderRadius},function(e){return e.isInverse?e.theme.colors.primary700:""},function(e){return e.isInverse?e.theme.colors.primary600:""},function(e){return e.isInverse?En(.8,e.theme.colors.neutral100):"inherit"},function(e){return e.isInverse?En(.8,e.theme.colors.neutral100):"inherit"},function(e){return e.isInverse?"#202565":""},function(e){return e.isInverse?e.theme.colors.primary600:""},function(e){return e.theme.bodyFont},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700},function(e){return e.isInverse?e.theme.colors.neutral900:e.theme.colors.neutral100},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.typeScale.size03.fontSize},function(e){return e.theme.spaceScale.spacing03},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral900},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?En(.5,e.theme.colors.neutral100):""},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?"invert(1)":""},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.focusInverse:""},function(e){return e.theme.typeScale.size03.lineHeight},function(e){return e.theme.spaceScale.spacing13},function(e){return e.theme.spaceScale.spacing04},function(e){return e.theme.bodyFont},function(e){return e.theme.typeScale.size03.fontSize},function(e){return e.theme.borderRadius},function(e){return e.isInverse?e.theme.colors.tertiary500:e.theme.colors.primary},function(e){return e.isInverse?e.theme.colors.neutral900:""},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?"1px solid "+e.theme.colors.focusInverse:""},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?En(.8,e.theme.colors.neutral100):e.theme.colors.neutral300},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?En(.8,e.theme.colors.neutral100):e.theme.colors.neutral300},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.isInverse?e.theme.colors.neutral100:""});!function(e){e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10"}(jn||(jn={}));var Rn=e.forwardRef(function(n,t){var r,o,a,i=n.testId,s=n.isInverse,l=n.type,c=n.dataSet,d=n.options,u=oe(n,An),p=e.useContext(f),h=R(s),m={area:q,areaStacked:_,bar:M,barGrouped:G,barStacked:B,donut:$,line:K,lollipop:V,pie:Y,radar:N,boxplot:U,bubble:X,bullet:Z,gauge:J,histogram:Q,meter:ee,scatter:ne,combo:te},g=re({},d,{theme:h?jn.G100:jn.WHITE,color:{scale:(r={},o=c.map(function(e){return"group"in e?e.group:null}),a=o.filter(function(e,n){return o.indexOf(e)===n}),a.forEach(function(e,n){return a.length<=p.chartColors.length?r[e||"null"]=h?p.chartColorsInverse[n]:p.chartColors[n]:{}}),r)},tooltip:{truncation:{type:"none"}}}),b=m[l];return e.useEffect(function(){document.querySelectorAll(".graph-frame ").forEach(function(e){e.setAttribute("aria-label","Interactive chart")})}),D(On,re({"data-testid":i,ref:t,isInverse:h,theme:p,className:"carbon-chart-wrapper"},u,{children:D(b,{data:c,options:g})}))});export{Rn as CarbonChart,Cn as CarbonChartType,Qe as Chart};
|
|
1
|
+
import*as e from"react";import{css as n}from"@emotion/react";import{Card as t,Datagrid as r,Spinner as o,useForceUpdate as a,StyledTooltip as i,ThemeContext as s,TooltipPosition as l,TooltipArrow as c,Checkbox as d,I18nContext as u,styled as f,Paragraph as p,TabsContainer as h,TabPanel as m,useDescendants as g,TypographyVisualStyle as b,Tabs as v,Tab as x,Tooltip as y,IconButton as k,ButtonVariant as w,Announce as I,TabPanelsContainer as S,useIsInverse as P}from"react-magma-dom";import{KeyboardIcon as L}from"react-magma-icons";import{jsx as z,jsxs as F,Fragment as C}from"react/jsx-runtime";import E from"@emotion/styled";import{LineSegment as A,Point as j,VictoryChart as R,VictoryVoronoiContainer as O,VictoryTooltip as W,VictoryAxis as T,VictoryLine as D,VictoryScatter as H}from"victory";import{AreaChart as q,StackedAreaChart as _,SimpleBarChart as M,GroupedBarChart as G,StackedBarChart as B,DonutChart as $,LineChart as K,LollipopChart as V,PieChart as Y,RadarChart as N,BoxplotChart as U,BubbleChart as X,BulletChart as Z,GaugeChart as J,HistogramChart as Q,MeterChart as ee,ScatterChart as ne,ComboChart as te}from"@carbon/charts-react";function re(){return re=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},re.apply(null,arguments)}function oe(e,n){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==n.indexOf(r))continue;t[r]=e[r]}return t}function ae(e,n){return n||(n=e.slice(0)),e.raw=n,e}function ie(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,function(e,n){return 0===n?e.toLowerCase():e.toUpperCase()}).replace(/\s+/g,"")}var se,le,ce,de,ue,fe,pe=function(n){var a=n.data,i=void 0===a?[]:a,s=n.xData,l=s.keyValue,c=s.label,d=s.tickFormat,u=s.tickValues,f=n.yData,p=f.keyValue,h=f.tickFormat,m=e.useState({columns:[],rows:[]}),g=m[0],b=m[1];return e.useEffect(function(){var e,n,t;b((e=ie(l||c||"x"),n=i.reduce(function(e,n){return n.data.forEach(function(n){var t=n.x||l&&n[l];!e.includes(t)&&e.push(t)}),e},[]),t={columns:n.length>0?[{field:e,header:c||l||"X",isRowHeader:!0}]:[],rows:n.reduce(function(t,r,o){var a,i=u&&"number"==typeof r&&u.length===n.length?d&&"function"==typeof d?d(u[r-1]):u[r-1]:d&&Array.isArray(d)?d[r-1]:d&&"function"==typeof d?d(r):r;return t.push(((a={})[e]=i,a.id=o,a)),t},[])},i.reduce(function(e,n){var r=n.name,o=n.data,a=ie(r);return e.columns.push({field:a,header:r}),o.forEach(function(n,r){var o,i=n.y||0===n.y?n.y:p&&n[p];e.rows[r]=re({},e.rows[r],((o={id:t.rows.length>0?r+1:r})[a]=h&&"function"==typeof h?h(i):i,o))}),e},t)))},[i]),/*#__PURE__*/z(t,{children:g.rows.length>0?/*#__PURE__*/z(r,{hasPagination:!1,columns:g.columns,rows:g.rows}):/*#__PURE__*/z(o,{})})},he=["events"],me=function(e){var n=e.events,t=oe(e,he);/*#__PURE__*/return F("g",{children:[/*#__PURE__*/z(A,re({},t,{events:n,style:{strokeWidth:"50px",stroke:"transparent"}})),/*#__PURE__*/z(A,re({},t,{events:n,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},ge=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],be=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],ve=function(e){var n=e.datum,t=e.index,r=e.lineIndex,o=e.pointRefArray,a=e.registerPoint,i=e.unregisterPoint,s=oe(e,ge);/*#__PURE__*/return z(j,re({},s,{ariaLabel:n.label,pathComponent:/*#__PURE__*/z(xe,{lineIndex:r,pointIndex:t,pointRefArray:o,registerPoint:a,unregisterPoint:i}),role:"button",tabIndex:0}))},xe=function(n){var t=n.lineIndex,r=n.pointRefArray,o=n.pointIndex,i=n.registerPoint,s=n.unregisterPoint,l=oe(n,be),c=a(),d=e.useRef(null);return e.useEffect(function(){return i(r,d),c(),function(){return s(r,d)}},[]),/*#__PURE__*/z("path",re({ref:d,"data-line-index":t,"data-point-index":o},l))},ye=E(i)(se||(se=ae(["\n background: ",";\n border: 1px solid ",";\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);\n box-sizing: border-box;\n color: ",";\n font-size: ",";\n font-weight: normal;\n line-height: ",";\n margin: 0;\n padding: 8px;\n width: fit-content;\n div {\n margin-bottom: 8px;\n display: flex;\n align-items: flex-start;\n &:last-of-type {\n margin-bottom: 0;\n }\n }\n"])),function(e){return e.theme.colors.neutral100},function(e){return e.theme.colors.neutral300},function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.theme.typeScale.size02.lineHeight}),ke=E.span(le||(le=ae(["\n background: ",";\n border: ",";\n border-radius: 4px;\n height: 20px;\n width: 20px;\n margin-right: 8px;\n"])),function(e){return e.color},function(e){return e.color?"none":"3px solid black"}),we=function(n){var t=n.datum,r=n.index,o=n.showTooltip,a=n.x,i=n.y,d=e.useContext(s);return o===r+"-"+t.index?/*#__PURE__*/z("g",{style:{pointerEvents:"none"},children:/*#__PURE__*/z("foreignObject",{x:a,y:i,width:"275",height:"100%",children:/*#__PURE__*/F(ye,{position:l.top,role:"tooltip",theme:d,children:[/*#__PURE__*/F("div",{children:[/*#__PURE__*/z(ke,{color:d.iterableColors[r]}),/*#__PURE__*/z("span",{children:t.label})]}),/*#__PURE__*/z(c,{theme:d})]})})}):null},Ie=function(n){var t=n.x,r=n.y,o=n.activePoints,a=n.hiddenData,i=Array.from(Array(n.dataLength-0),function(e,n){return n+0}).filter(function(e){return!a.includes(e)}),d=e.useContext(s);/*#__PURE__*/return z("g",{style:{pointerEvents:"none"},children:/*#__PURE__*/z("foreignObject",{x:t,y:r,width:"275",height:"100%",children:/*#__PURE__*/F(ye,{"data-testid":"axis-tooltip",position:l.top,role:"tooltip",theme:d,children:[o.map(function(e,n){/*#__PURE__*/return F("div",{children:[/*#__PURE__*/z(ke,{color:d.iterableColors[i[n]]}),/*#__PURE__*/z("span",{children:e.label})]},n)}),/*#__PURE__*/z(c,{theme:d})]})})})},Se=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],Pe=/*#__PURE__*/e.forwardRef(function(n,t){var r=n.color,o=n.dataIndex,a=n.isHidden,i=n.onClick,l=n.name,c=n.focusCurrentLine,u=n.resetLineFocus,f=oe(n,Se);function p(){a||c&&"function"==typeof c&&c(o)}var h=e.useContext(s);/*#__PURE__*/return z("div",{style:{display:"inline-flex"},onMouseEnter:p,onMouseLeave:u,children:/*#__PURE__*/z(d,re({checked:!a,color:r,containerStyle:{alignItems:"center",border:"0",boxShadow:"0 0 0",color:h.colors.neutral,display:"inline-flex",margin:"0 36px 20px 0",padding:"0"},inputStyle:{border:r?"none":"2px solid "+h.colors.neutral800,borderRadius:"4px"},labelText:l,onBlur:u,onClick:function(){i&&"function"==typeof i&&i(o),a||u&&"function"==typeof u&&u()},onFocus:p,ref:t,theme:h},f))})}),Le=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],ze="#8F8F8F",Fe="#3F3F3F",Ce="pink",Ee={width:350,height:350,padding:50},Ae={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:Fe,stroke:"transparent",strokeWidth:0},je=re({textAnchor:"middle"},Ae),Re="round",Oe="round",We={area:re({style:{data:{fill:Ce},labels:Ae}},Ee),axis:re({style:{axis:{fill:"transparent",stroke:ze,strokeWidth:1,strokeLinecap:Re,strokeLinejoin:Oe},axisLabel:re({},je,{padding:8,stroke:"transparent"}),grid:{fill:"none",stroke:"#dfdfdf",strokeLinecap:Re,strokeLinejoin:Oe,pointerEvents:"painted"},ticks:{fill:"transparent",size:0,stroke:ze,strokeWidth:0,strokeLinecap:Re,strokeLinejoin:Oe},tickLabels:re({},Ae,{fill:Fe})}},Ee),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:re({style:{data:{fill:Fe,padding:8,strokeWidth:0},labels:Ae}},Ee),boxplot:re({style:{max:{padding:8,stroke:Fe,strokeWidth:1},maxLabels:re({},Ae,{padding:3}),median:{padding:8,stroke:Fe,strokeWidth:1},medianLabels:re({},Ae,{padding:3}),min:{padding:8,stroke:Fe,strokeWidth:1},minLabels:re({},Ae,{padding:3}),q1:{padding:8,fill:Fe},q1Labels:re({},Ae,{padding:3}),q3:{padding:8,fill:Fe},q3Labels:re({},Ae,{padding:3})},boxWidth:20},Ee),candlestick:re({style:{data:{stroke:Fe},labels:re({},Ae,{padding:5})},candleColors:{positive:"#ffffff",negative:Fe}},Ee),chart:Ee,errorbar:re({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:Fe,strokeWidth:2},labels:Ae}},Ee),group:re({colorScale:Le},Ee),histogram:re({style:{data:{fill:Fe,stroke:Ce,strokeWidth:2},labels:Ae}},Ee),legend:{colorScale:Le,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:Ae,title:re({},Ae,{padding:5})}},line:re({style:{data:{fill:"transparent",opacity:1,stroke:Fe,strokeWidth:2},labels:Ae}},Ee),pie:re({colorScale:Le,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:re({},Ae,{padding:20})}},Ee),scatter:re({style:{data:{fill:Fe,opacity:1,stroke:"transparent",strokeWidth:0},labels:Ae}},Ee),stack:re({colorScale:Le},Ee),tooltip:{style:re({},Ae,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:Ce,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:re({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:re({},Ae,{padding:5,pointerEvents:"none"}),flyout:{stroke:Ce,strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},Ee)},Te=["axisLabel","tickLabels"],De=["style"],He=["axisLabel","tickLabels"],qe=["style"],_e=E.div(ce||(ce=ae(["\n max-height: 600px;\n max-width: 800px;\n svg {\n overflow: visible;\n }\n"]))),Me=E.div(de||(de=ae([""]))),Ge=E.div(ue||(ue=ae(["\n padding-bottom: 24px;\n"]))),Be=E.p(fe||(fe=ae(["\n color: ",";\n font-size: ",";\n"])),function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size02.fontSize});function $e(n){var t=n.componentProps,r=void 0===t?{}:t,o=r.chart,a=void 0===o?{}:o,i=r.line,l=void 0===i?{}:i,c=r.scatter,d=void 0===c?{}:c,f=r.xAxis,p=void 0===f?{style:{}}:f,h=p.style,m=void 0===h?{}:h,g=m.axisLabel,b=void 0===g?void 0:g,v=m.tickLabels,x=void 0===v?void 0:v,y=oe(m,Te),k=oe(p,De),w=r.yAxis,I=void 0===w?{style:{}}:w,S=I.style,P=void 0===S?{}:S,L=P.axisLabel,E=void 0===L?void 0:L,A=P.tickLabels,j=void 0===A?void 0:A,q=oe(P,He),_=oe(I,qe),M=n.data,G=void 0===M?[]:M,B=n.lastFocusedScatterPoint,$=n.pointRefArray,K=n.registerPoint,V=n.unregisterPoint,Y=n.tabRef,N=n.x,U=n.y,X=e.useContext(s),Z=e.useContext(u),J=e.useState([]),Q=J[0],ee=J[1],ne=e.useState(800),te=ne[0],ae=ne[1],ie=e.useState(null),se=ie[0],le=ie[1],ce=e.useState(null),de=ce[0],ue=ce[1],fe=e.useState(!0),pe=fe[0],he=fe[1],ge=e.useState(!1),be=ge[0],xe=ge[1],ye=e.useRef(null),ke=e.useRef(null);e.useEffect(function(){return Fe(),window.addEventListener("resize",Fe),window.addEventListener("keydown",Ce),function(){window.removeEventListener("resize",Fe),window.removeEventListener("keydown",Ce)}},[]),e.useEffect(function(){return window.addEventListener("mousemove",Ee),function(){window.removeEventListener("mousemove",Ee)}},[de]);var Se=G.map(function(e,n){return"scatter-"+n}),Le=re({tickLabels:re({color:"#3f3f3f",fontSize:12},x),axisLabel:re({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},b)},y),ze=re({tickLabels:re({fontSize:12},j),axisLabel:re({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},E)},q);function Fe(){ye.current&&ae(ye.current.clientWidth)}function Ce(e){"Escape"===e.key&&(ue(null),he(!1))}function Ee(){!de&&he(!0)}function Ae(e){return null===se||se===e?1:.1}function je(e){Q.includes(e)?ee(Q.filter(function(n){return n!==e})):ee(Q.concat([e]))}function Re(e){le(e)}function Oe(){le(null)}var $e=function(e,n){if(n.current){var t=parseInt(n.current.getAttribute("data-line-index"),10);!e.includes(t)&&e.push(parseInt(n.current.getAttribute("data-line-index"),10))}return e},Ke=function(e){var n=parseInt(e.current.getAttribute("data-line-index"),10),t=parseInt(e.current.getAttribute("data-point-index"),10),r=$.current.reduce($e,[]);return{currentLineIndex:n,currentPointIndex:t,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},Ve=function(e,n){return function(t){return t.current&&parseInt(t.current.getAttribute("data-line-index"),10)===e&&parseInt(t.current.getAttribute("data-point-index"),10)===n}};function Ye(e){"Tab"===e.key&&e.shiftKey&&B&&B.current&&$.current.find(function(e){return e.current===B.current})&&(e.preventDefault(),B.current.focus())}/*#__PURE__*/return F(_e,{ref:ye,children:[/*#__PURE__*/z(Me,{onKeyDown:function(e){var n=e.shiftKey;switch(e.key){case"Tab":e.preventDefault(),B.current=$.current.find(function(e){return e.current===document.activeElement}).current,n?Y.current&&Y.current.focus():ke.current&&ke.current.focus();break;case"ArrowRight":var t,r=$.current.findIndex(function(e){return e.current===document.activeElement});void 0!==r&&(r===$.current.length-1?null==(t=$.current[0])||null==(t=t.current)||t.focus():$.current[r+1].current.focus());break;case"ArrowLeft":var o=$.current.findIndex(function(e){return e.current===document.activeElement});void 0!==o&&(0===o?$.current[$.current.length-1].current.focus():$.current[o-1].current.focus());break;case"ArrowUp":e.preventDefault();var a=$.current.find(function(e){return e.current===document.activeElement});if(a&&a.current){var i=Ke(a),s=i.currentLineIndex,l=i.currentPointIndex,c=i.lineIndexes;if(s===i.lowestLineIndex)$.current.find(Ve(i.highestLineIndex,l)).current.focus();else{var d=c[c.indexOf(s)-1];$.current.find(Ve(d,l)).current.focus()}}break;case"ArrowDown":e.preventDefault();var u=$.current.find(function(e){return e.current===document.activeElement});if(u&&u.current){var f=Ke(u),p=f.currentLineIndex,h=f.currentPointIndex,m=f.lineIndexes;if(p===f.highestLineIndex)$.current.find(Ve(f.lowestLineIndex,h)).current.focus();else{var g=m[m.indexOf(p)+1];$.current.find(Ve(g,h)).current.focus()}}}},children:/*#__PURE__*/F(R,re({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:We,width:te,containerComponent:/*#__PURE__*/z(O,{name:"xAxisGroupLabel",voronoiBlacklist:Se,voronoiDimension:"x",labels:be&&pe?function(){return" "}:void 0,labelComponent:pe?/*#__PURE__*/z(W,{flyoutComponent:/*#__PURE__*/z(Ie,{dataLength:G.length,hiddenData:Q})}):void 0,role:"presentation",voronoiPadding:32})},a,{children:[/*#__PURE__*/z(T,re({},_,{dependentAxis:!0,style:ze})),G.map(function(e,n){var t=e.data;return!Q.includes(n)&&/*#__PURE__*/z(D,re({style:{data:{opacity:Ae(n),stroke:X.iterableColors[n],strokeWidth:"3"},parent:{border:X.colors.neutral400}},data:t,labelComponent:/*#__PURE__*/z(C,{}),x:N,y:U},l),"line"+n)}),/*#__PURE__*/z(T,re({},k,{style:Le,gridComponent:/*#__PURE__*/z(me,{events:{onMouseEnter:function(){return xe(!0)},onMouseLeave:function(){return xe(!1)}}})})),G.map(function(e,n){var t=e.data;return!Q.includes(n)&&/*#__PURE__*/z(H,re({name:"scatter-"+n,events:[{target:"data",eventHandlers:{onBlur:function(){return he(!0),ue(null),[{target:"labels",mutation:function(){return{active:void 0}}}]},onClick:function(){return[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onFocus:function(){return he(!1),[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onMouseEnter:function(){return he(!1),[{target:"labels",mutation:function(e){return ue(e.datum.lineIndex+"-"+e.datum.index),{active:!0}}}]},onMouseLeave:function(){ue(null),he(!0)}}}],style:{data:{fill:X.colors.neutral100,opacity:Ae(n),stroke:X.iterableColors[n],strokeWidth:2}},size:5,data:t.map(function(e,t){return re({index:t,lineIndex:n},e)}),dataComponent:/*#__PURE__*/z(ve,{lineIndex:n,pointRefArray:$,registerPoint:K,unregisterPoint:V}),labels:function(){return""},labelComponent:/*#__PURE__*/z(W,{text:"",flyoutComponent:/*#__PURE__*/z(we,{index:n,showTooltip:de})}),x:N,y:U},d),"scatter"+n)})]}))}),/*#__PURE__*/F(Ge,{children:[/*#__PURE__*/z(Be,{theme:X,children:Z.charts.line.dataLegendsLabel}),G.map(function(e,n){var t=e.name,r=Z.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,t);/*#__PURE__*/return z(Pe,{"aria-label":r,color:X.iterableColors[n],dataIndex:n,isHidden:Q.includes(n),name:t,onClick:je,onKeyDown:0===n?Ye:void 0,focusCurrentLine:Re,ref:0===n?ke:void 0,resetLineFocus:Oe},n)})]})]})}var Ke,Ve,Ye,Ne,Ue,Xe,Ze=["description","title","testId","type"],Je=f.span(Ke||(Ke=ae(["\n color: ",";\n font-size: ",";\n font-weight: 600;\n font-family: ",";\n line-height: ",";\n margin: 0 0 12px 0;\n"])),function(e){return e.theme.colors.neutral},function(e){return e.theme.typeScale.size04.fontSize},function(e){return e.theme.bodyFont},function(e){return e.theme.typeScale.size04.lineHeight}),Qe=f(p)(Ve||(Ve=ae(["\n font-size: ",";\n margin: 0 0 18px 0;\n"])),function(e){return e.theme.typeScale.size02.fontSize}),en=f(h)(Ye||(Ye=ae(["\n width: 800px;\n ul {\n box-shadow: inset 0 -1px 0 ",";\n }\n"])),function(e){return e.theme.colors.neutral300}),nn=f(m)(Ne||(Ne=ae(["\n padding: 22px 0;\n"]))),tn=f(t)(Ue||(Ue=ae(["\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);\n display: ",";\n right: ",";\n max-height: ",";\n opacity: ",";\n outline: 0;\n overflow-y: auto;\n padding: ","\n ",";\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ","\n"])),function(e){return e.isOpen?"block":"none"},function(e){return e.theme.spaceScale.spacing02},function(e){return e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight},function(e){return e.isOpen?"1":"0"},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.spaceScale.spacing05},function(e){return e.width&&n(Xe||(Xe=ae(["\n white-space: normal;\n width: ",";\n "])),e.width)});function rn(n,t){var r,o,a,i=n.description,l=n.title,c=n.type,d=oe(n,Ze),f=e.useRef(null),h=e.useRef(null),m=e.useContext(s),P=e.useContext(u),C=g(),E=C[0],A=C[1],j=C[2],R=e.useState(!1),O=R[0],W=R[1];/*#__PURE__*/return F("div",{ref:t,children:[/*#__PURE__*/z(Je,{theme:m,children:l}),i&&/*#__PURE__*/z(Qe,{theme:m,visualStyle:b.bodySmall,children:i}),/*#__PURE__*/F(en,{theme:m,children:[/*#__PURE__*/F(v,{children:[/*#__PURE__*/z(x,{children:P.charts.line.chartTabLabel}),/*#__PURE__*/z(x,{children:P.charts.line.dataTabLabel}),/*#__PURE__*/F("div",{onBlur:function(){W(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[/*#__PURE__*/z(y,{content:P.charts.line.keyboardInstructionsTooltip,ref:f,children:/*#__PURE__*/z(k,{"aria-controls":"keyboardInstructions","aria-label":P.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(O),icon:/*#__PURE__*/z(L,{}),onClick:function(){W(function(e){return!e})},onKeyDown:function(e){var n=e.shiftKey;switch(e.key){case"Escape":W(!1);break;case"Tab":!n&&h&&h.current&&E.current.find(function(e){return e.current===h.current})&&(e.preventDefault(),h.current.focus())}},variant:w.link})}),/*#__PURE__*/z(I,{children:/*#__PURE__*/F(tn,{id:"keyboardInstructions",isOpen:O,theme:m,width:"350px",children:[/*#__PURE__*/z(p,{visualStyle:b.headingXSmall,style:{margin:"0 0 16px"},children:P.charts.line.keyboardInstructionsHeader}),P.charts.line.keyboardInstructions]})})]})]}),/*#__PURE__*/F(S,{children:[/*#__PURE__*/z(nn,{theme:m,children:"line"===c&&/*#__PURE__*/z($e,re({},d,{lastFocusedScatterPoint:h,pointRefArray:E,registerPoint:A,tabRef:f,unregisterPoint:j}))}),/*#__PURE__*/z(nn,{theme:m,children:/*#__PURE__*/z(pe,{data:d.data,xData:{keyValue:d.x,label:null==(r=d.componentProps)||null==(r=r.xAxis)?void 0:r.label,tickFormat:null==(o=d.componentProps)||null==(o=o.xAxis)?void 0:o.tickFormat},yData:{keyValue:d.y,tickFormat:null==(a=d.componentProps)||null==(a=a.yAxis)?void 0:a.tickFormat}})})]})]})]})}var on=/*#__PURE__*/e.forwardRef(rn);function an(){return an=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},an.apply(null,arguments)}function sn(e,n){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,n){return e.__proto__=n,e},sn(e,n)}function ln(e){return ln=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ln(e)}function cn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(cn=function(){return!!e})()}function dn(e){var n="function"==typeof Map?new Map:void 0;return dn=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(n){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,n,t){if(cn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,n);var o=new(e.bind.apply(e,r));return t&&sn(o,t.prototype),o}(e,arguments,ln(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),sn(t,e)},dn(e)}var un={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function fn(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];var r,o=n[0],a=[];for(r=1;r<n.length;r+=1)a.push(n[r]);return a.forEach(function(e){o=o.replace(/%[a-z]/,e)}),o}var pn=/*#__PURE__*/function(e){var n,t;function r(n){var t;if("production"===process.env.NODE_ENV)t=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+n+" for more information.")||this;else{for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];t=e.call(this,fn.apply(void 0,[un[n]].concat(o)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}return t=e,(n=r).prototype=Object.create(t.prototype),n.prototype.constructor=n,sn(n,t),r}(/*#__PURE__*/dn(Error));function hn(e){return Math.round(255*e)}function mn(e,n,t){return hn(e)+","+hn(n)+","+hn(t)}function gn(e,n,t,r){if(void 0===r&&(r=mn),0===n)return r(t,t,t);var o=(e%360+360)%360/60,a=(1-Math.abs(2*t-1))*n,i=a*(1-Math.abs(o%2-1)),s=0,l=0,c=0;o>=0&&o<1?(s=a,l=i):o>=1&&o<2?(s=i,l=a):o>=2&&o<3?(l=a,c=i):o>=3&&o<4?(l=i,c=a):o>=4&&o<5?(s=i,c=a):o>=5&&o<6&&(s=a,c=i);var d=t-a/2;return r(s+d,l+d,c+d)}var bn={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},vn=/^#[a-fA-F0-9]{6}$/,xn=/^#[a-fA-F0-9]{8}$/,yn=/^#[a-fA-F0-9]{3}$/,kn=/^#[a-fA-F0-9]{4}$/,wn=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,In=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Sn=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Pn=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Ln=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function zn(e){var n=e.toString(16);return 1===n.length?"0"+n:n}var Fn,Cn,En,An=function e(n,t,r){return function(){var o=r.concat(Array.prototype.slice.call(arguments));return o.length>=t?n.apply(this,o):e(n,t,o)}}(Fn=function(e,n){if("transparent"===n)return n;var t,r=function(e){if("string"!=typeof e)throw new pn(3);var n=function(e){if("string"!=typeof e)return e;var n=e.toLowerCase();return bn[n]?"#"+bn[n]:e}(e);if(n.match(vn))return{red:parseInt(""+n[1]+n[2],16),green:parseInt(""+n[3]+n[4],16),blue:parseInt(""+n[5]+n[6],16)};if(n.match(xn)){var t=parseFloat((parseInt(""+n[7]+n[8],16)/255).toFixed(2));return{red:parseInt(""+n[1]+n[2],16),green:parseInt(""+n[3]+n[4],16),blue:parseInt(""+n[5]+n[6],16),alpha:t}}if(n.match(yn))return{red:parseInt(""+n[1]+n[1],16),green:parseInt(""+n[2]+n[2],16),blue:parseInt(""+n[3]+n[3],16)};if(n.match(kn)){var r=parseFloat((parseInt(""+n[4]+n[4],16)/255).toFixed(2));return{red:parseInt(""+n[1]+n[1],16),green:parseInt(""+n[2]+n[2],16),blue:parseInt(""+n[3]+n[3],16),alpha:r}}var o=wn.exec(n);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=In.exec(n.substring(0,50));if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])>1?parseFloat(""+a[4])/100:parseFloat(""+a[4])};var i=Sn.exec(n);if(i){var s="rgb("+gn(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",l=wn.exec(s);if(!l)throw new pn(4,n,s);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var c=Pn.exec(n.substring(0,50));if(c){var d="rgb("+gn(parseInt(""+c[1],10),parseInt(""+c[2],10)/100,parseInt(""+c[3],10)/100)+")",u=wn.exec(d);if(!u)throw new pn(4,n,d);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+c[4])>1?parseFloat(""+c[4])/100:parseFloat(""+c[4])}}throw new pn(5)}(n);return function(e){if("object"==typeof e)return e.alpha>=1?function(e,n,t){if("number"==typeof e&&"number"==typeof n&&"number"==typeof t)return Ln("#"+zn(e)+zn(n)+zn(t));if("object"==typeof e&&void 0===n&&void 0===t)return Ln("#"+zn(e.red)+zn(e.green)+zn(e.blue));throw new pn(6)}(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new pn(7)}(an({},r,{alpha:(t=+(100*("number"==typeof r.alpha?r.alpha:1)-100*parseFloat(e)).toFixed(2)/100,Math.max(0,Math.min(1,t)))}))},Fn.length,[]),jn=["children","testId","isInverse","type","dataSet","options"];!function(e){e.area="area",e.areaStacked="areaStacked",e.bar="bar",e.barGrouped="barGrouped",e.barStacked="barStacked",e.boxplot="boxplot",e.bubble="bubble",e.bullet="bullet",e.donut="donut",e.gauge="gauge",e.histogram="histogram",e.line="line",e.lollipop="lollipop",e.meter="meter",e.pie="pie",e.radar="radar",e.scatter="scatter",e.combo="combo"}(En||(En={}));var Rn,On=E.div(Cn||(Cn=ae(["\n .cds--data-table thead tr th {\n background: "," !important;\n }\n .cds--data-table td,\n .cds--data-table tbody th {\n color: ",";\n }\n .cds--data-table tbody tr,\n .cds--data-table tbody tr td,\n .cds--data-table tbody tr th {\n color: ",";\n }\n .cds--data-table tr {\n block-size: 2.5rem;\n }\n\n .cds--cc--tooltip .content-box .datapoint-tooltip p {\n font-size: ",";\n padding: ",";\n color: ",";\n max-width: 142px;\n white-space: normal;\n }\n\n .cds--modal-container {\n clip-path: inset(0% 0% 0% 0% round ",");\n background: ",";\n .cds--data-table th {\n background: ",";\n }\n .cds--data-table td {\n border-top: 1px solid\n ",";\n border-bottom: 1px solid\n ",";\n background: ",";\n }\n .cds--data-table tr:hover td {\n background: ",";\n }\n }\n\n p,\n div,\n text,\n .cds--cc--axes g.axis .axis-title,\n .cds--cc--title p.title,\n .cds--cc--axes g.axis g.tick text {\n font-family: "," !important;\n color: ",";\n }\n\n .cds--cc--axes {\n overflow: visible;\n }\n\n div.cds--cc--legend {\n div.legend-item {\n div.checkbox {\n background: ",";\n border: none;\n width: ",";\n height: ",";\n svg {\n left: 2px;\n position: relative;\n }\n }\n p {\n font-size: ",";\n margin: 0 "," 0 0;\n }\n }\n }\n div.cds--cc--legend.has-deactivated-items {\n div.legend-item {\n div.checkbox {\n border: 1px solid\n ",";\n }\n div.checkbox.active {\n border: 1px solid transparent;\n }\n }\n }\n .chart-holder {\n .cds--cc--axes g.axis g.tick text {\n fill: ",";\n }\n .cds--cc--axes g.axis path.domain {\n stroke: ",";\n }\n .cds--cc--grid g.x.grid g.tick line,\n .cds--cc--grid g.y.grid g.tick line {\n stroke: ",";\n }\n .cds--cc--grid rect.chart-grid-backdrop.stroked {\n stroke: ",";\n }\n .cds--cc--skeleton .shimmer-effect-lines {\n filter: ",";\n }\n /* .chart-holder.cds--chart-holder.filled,\n .cds--cc--skeleton rect.chart-skeleton-backdrop,\n .cds--cc--grid rect.chart-grid-backdrop {\n } */\n\n .cds--cc--grid rect.chart-grid-backdrop {\n fill: transparent;\n }\n .cds--cc--scatter circle.dot.hovered {\n padding: 10px;\n }\n .cds--cc--scatter-stacked circle.dot.hovered,\n .cds--cc--scatter-stacked circle.dot.unfilled,\n .cds--cc--scatter circle.dot.unfilled {\n stroke-width: 6px;\n transition: 0.1s all linear;\n }\n .cds--cc--scatter circle.dot.hovered {\n stroke-width: 0.5em;\n transition: 0.1s all linear;\n filter: drop-shadow(\n 1px 0px 0px\n ","\n )\n drop-shadow(\n -1px 0px 0px\n ","\n )\n drop-shadow(\n 0px 1px 0px\n ","\n )\n drop-shadow(\n 0px -1px 0px\n ","\n );\n }\n .cds--cc--lollipop circle.dot.filled,\n .cds--cc--lollipop circle.dot.hovered {\n stroke-width: 15px;\n }\n .cds--cc--scatter-stacked circle.dot.hovered,\n .cds--cc--scatter-stacked circle.dot.unfilled,\n .cds--cc--scatter circle.dot.unfilled,\n .cds--cc--lollipop circle.dot.filled,\n .cds--cc--lollipop circle.dot.hovered {\n transition: 0.1s all linear;\n filter: drop-shadow(\n 1px 0px 0px\n ","\n )\n drop-shadow(\n -1px 0px 0px\n ","\n )\n drop-shadow(\n 0px 1px 0px\n ","\n )\n drop-shadow(\n 0px -1px 0px\n ","\n );\n }\n .cds--cc--lollipop .cds--cc--scatter circle.dot.hovered {\n transition: 0.1s all linear;\n stroke-width: 1.1em;\n }\n\n .cds--overflow-menu-options__btn:focus {\n outline-color: ",";\n }\n\n .cds--btn {\n min-height: auto;\n display: flex;\n flex: 0 auto;\n align-items: center;\n text-align: center;\n padding: 20px;\n margin: 0;\n line-height: ",";\n margin: 0;\n min-width: ",";\n overflow: hidden;\n padding:;\n position: relative;\n right: ",";\n text-align: center;\n height: 40px;\n font-family: ",";\n font-size: ",";\n border-radius: ",";\n font-weight: 500;\n }\n\n .cds--btn--primary {\n background: ",";\n color: ",";\n }\n\n *:focus {\n outline: 2px solid\n "," !important;\n outline-offset: 0;\n }\n .cds--overflow-menu-options__btn:focus,\n .cds--overflow-menu:focus,\n .cds--overflow-menu__trigger:focus,\n .toolbar-control:focus {\n outline: 2px solid\n "," !important;\n }\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):focus\n div.checkbox,\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):hover\n div.checkbox {\n border: ",";\n }\n div.cds--cc--legend.clickable\n div.legend-item:not(.additional):hover\n div.checkbox {\n box-shadow: 0 0 0 2px\n "," !important;\n }\n\n .cds--btn--primary {\n &:focus {\n outline: 2px solid\n ",";\n }\n outline-offset: 2px;\n border: none;\n box-shadow: none;\n }\n .cds--modal-header {\n background: ",";\n margin-bottom: 0;\n border-bottom: 1px solid\n ",";\n }\n .cds--modal-header__heading {\n font-weight: 600;\n }\n\n .cds--modal-close {\n position: absolute;\n top: 0;\n right: 0;\n &:focus {\n outline: 2px solid\n ",";\n border-color: none;\n }\n outline-offset: 0;\n border: none;\n }\n }\n\n .cds--modal-footer.cds--modal-footer {\n display: flex;\n align-items: center;\n border-top: 1px solid\n ",";\n background: "," !important;\n }\n .layout-child.header {\n height: auto !important;\n p {\n text-overflow: inherit;\n overflow: auto;\n white-space: normal;\n }\n }\n\n svg:not(:root) {\n overflow: visible;\n }\n\n .cds--cc--chart-wrapper text {\n font-size: ",";\n }\n\n g.center text,\n .pie-label {\n fill: ",";\n }\n\n // Zoom responsive tweaks\n\n @media screen and (max-width: 760px) {\n .cds--modal-container {\n overflow-y: auto;\n }\n .cds--chart-holder .cds--modal .cds--modal-container .cds--modal-content {\n overflow: visible;\n }\n .cds--chart-holder\n .cds--modal\n .cds--modal-container\n .cds--modal-content\n table\n th {\n position: relative;\n }\n }\n"])),function(e){return e.isInverse?e.theme.colors.primary700:""},function(e){return e.theme.colors.neutral700},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.theme.spaceScale.spacing02},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700},function(e){return e.theme.borderRadius},function(e){return e.isInverse?e.theme.colors.primary700:""},function(e){return e.isInverse?e.theme.colors.primary600:""},function(e){return e.isInverse?An(.8,e.theme.colors.neutral100):"inherit"},function(e){return e.isInverse?An(.8,e.theme.colors.neutral100):"inherit"},function(e){return e.isInverse?"#202565":""},function(e){return e.isInverse?e.theme.colors.primary600:""},function(e){return e.theme.bodyFont},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral700},function(e){return e.isInverse?e.theme.colors.neutral900:e.theme.colors.neutral100},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.spaceScale.spacing05},function(e){return e.theme.typeScale.size03.fontSize},function(e){return e.theme.spaceScale.spacing03},function(e){return e.isInverse?e.theme.colors.neutral100:e.theme.colors.neutral900},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?An(.5,e.theme.colors.neutral100):""},function(e){return e.isInverse?e.theme.colors.neutral100:""},function(e){return e.isInverse?"invert(1)":""},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?e.theme.colors.focusInverse:""},function(e){return e.theme.typeScale.size03.lineHeight},function(e){return e.theme.spaceScale.spacing13},function(e){return e.theme.spaceScale.spacing04},function(e){return e.theme.bodyFont},function(e){return e.theme.typeScale.size03.fontSize},function(e){return e.theme.borderRadius},function(e){return e.isInverse?e.theme.colors.tertiary500:e.theme.colors.primary},function(e){return e.isInverse?e.theme.colors.neutral900:""},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?"1px solid "+e.theme.colors.focusInverse:""},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.isInverse?An(.8,e.theme.colors.neutral100):e.theme.colors.neutral300},function(e){return e.isInverse?e.theme.colors.focusInverse:e.theme.colors.focus},function(e){return e.isInverse?An(.8,e.theme.colors.neutral100):e.theme.colors.neutral300},function(e){return e.isInverse?e.theme.colors.primary600:e.theme.colors.neutral100},function(e){return e.theme.typeScale.size02.fontSize},function(e){return e.isInverse?e.theme.colors.neutral100:""});!function(e){e.WHITE="white",e.G100="g100",e.G90="g90",e.G10="g10"}(Rn||(Rn={}));var Wn=/*#__PURE__*/e.forwardRef(function(n,t){var r,o,a,i=n.testId,l=n.isInverse,c=n.type,d=n.dataSet,u=n.options,f=oe(n,jn),p=e.useContext(s),h=P(l),m={area:q,areaStacked:_,bar:M,barGrouped:G,barStacked:B,donut:$,line:K,lollipop:V,pie:Y,radar:N,boxplot:U,bubble:X,bullet:Z,gauge:J,histogram:Q,meter:ee,scatter:ne,combo:te},g=re({},u,{theme:h?Rn.G100:Rn.WHITE,color:{scale:(r={},o=d.map(function(e){return"group"in e?e.group:null}),a=o.filter(function(e,n){return o.indexOf(e)===n}),a.forEach(function(e,n){return a.length<=p.chartColors.length?r[e||"null"]=h?p.chartColorsInverse[n]:p.chartColors[n]:{}}),r)},tooltip:{truncation:{type:"none"}}}),b=m[c];return e.useEffect(function(){document.querySelectorAll(".graph-frame ").forEach(function(e){e.setAttribute("aria-label","Interactive chart")})}),/*#__PURE__*/z(On,re({"data-testid":i,ref:t,isInverse:h,theme:p,className:"carbon-chart-wrapper"},f,{children:/*#__PURE__*/z(b,{data:d,options:g})}))});export{Wn as CarbonChart,En as CarbonChartType,on as Chart};
|
|
2
2
|
//# sourceMappingURL=charts.modern.module.js.map
|