@react-magma/charts 6.0.0 → 6.1.0-next.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.
@@ -1,4 +1,4 @@
1
- import*as e from"react";import{styled as t,StyledTooltip as n,ThemeContext as r,TooltipPosition as i,TooltipArrow as o,useForceUpdate as a,Checkbox as l,I18nContext as s,Card as c,Datagrid as d,Spinner as u,Paragraph as p,TabsContainer as f,TabPanel as h,useDescendants as m,TypographyVisualStyle as x,Tabs as g,Tab as y,Tooltip as b,IconButton as k,ButtonVariant as v,Announce as w,TabPanelsContainer as F}from"react-magma-dom";import{css as L}from"@emotion/core";import{KeyboardIcon as I}from"react-magma-icons";import{Point as S,LineSegment as A,VictoryChart as $,VictoryVoronoiContainer as P,VictoryTooltip as C,VictoryAxis as E,VictoryLine as z,VictoryScatter as W}from"victory";import{jsx as R,jsxs as D,Fragment as O}from"react/jsx-runtime";function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(this,arguments)}function T(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}const j=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],B={width:350,height:350,padding:50},K={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:"#3F3F3F",stroke:"transparent",strokeWidth:0},M=H({textAnchor:"middle"},K),V={area:H({style:{data:{fill:"pink"},labels:K}},B),axis:H({style:{axis:{fill:"transparent",stroke:"#8F8F8F",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:H({},M,{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:H({},K,{fill:"#3F3F3F"})}},B),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:H({style:{data:{fill:"#3F3F3F",padding:8,strokeWidth:0},labels:K}},B),boxplot:H({style:{max:{padding:8,stroke:"#3F3F3F",strokeWidth:1},maxLabels:H({},K,{padding:3}),median:{padding:8,stroke:"#3F3F3F",strokeWidth:1},medianLabels:H({},K,{padding:3}),min:{padding:8,stroke:"#3F3F3F",strokeWidth:1},minLabels:H({},K,{padding:3}),q1:{padding:8,fill:"#3F3F3F"},q1Labels:H({},K,{padding:3}),q3:{padding:8,fill:"#3F3F3F"},q3Labels:H({},K,{padding:3})},boxWidth:20},B),candlestick:H({style:{data:{stroke:"#3F3F3F"},labels:H({},K,{padding:5})},candleColors:{positive:"#ffffff",negative:"#3F3F3F"}},B),chart:B,errorbar:H({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:K}},B),group:H({colorScale:j},B),histogram:H({style:{data:{fill:"#3F3F3F",stroke:"pink",strokeWidth:2},labels:K}},B),legend:{colorScale:j,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:K,title:H({},K,{padding:5})}},line:H({style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:K}},B),pie:H({colorScale:j,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:H({},K,{padding:20})}},B),scatter:H({style:{data:{fill:"#3F3F3F",opacity:1,stroke:"transparent",strokeWidth:0},labels:K}},B),stack:H({colorScale:j},B),tooltip:{style:H({},K,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:H({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:H({},K,{padding:5,pointerEvents:"none"}),flyout:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},B)};let q,U,X=e=>e;const G=t(n)(q||(q=X`
1
+ import*as e from"react";import{css as t}from"@emotion/core";import{KeyboardIcon as n}from"react-magma-icons";import{Point as r,LineSegment as i,VictoryChart as o,VictoryVoronoiContainer as a,VictoryTooltip as s,VictoryAxis as l,VictoryLine as c,VictoryScatter as d}from"victory";import{StyledTooltip as u,ThemeContext as p,TooltipPosition as f,TooltipArrow as h,useForceUpdate as m,Checkbox as x,I18nContext as g,Card as y,Datagrid as b,Spinner as k,Paragraph as v,TabsContainer as w,TabPanel as F,useDescendants as L,TypographyVisualStyle as I,Tabs as S,Tab as A,Tooltip as $,IconButton as P,ButtonVariant as C,Announce as E,TabPanelsContainer as z}from"react-magma-dom";import W from"@emotion/styled";import{jsx as R,jsxs as D,Fragment as O}from"react/jsx-runtime";function H(){return H=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H.apply(this,arguments)}function T(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}const j=["#00507A","#8F0033","#B84900","#255200","#711E6E","#005249"],B={width:350,height:350,padding:50},K={fontFamily:'"Work Sans",Helvetica,sans-serif',fontSize:12,letterSpacing:"normal",padding:8,fill:"#3F3F3F",stroke:"transparent",strokeWidth:0},M=H({textAnchor:"middle"},K),V={area:H({style:{data:{fill:"pink"},labels:K}},B),axis:H({style:{axis:{fill:"transparent",stroke:"#8F8F8F",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"},axisLabel:H({},M,{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:H({},K,{fill:"#3F3F3F"})}},B),polarDependentAxis:{style:{ticks:{fill:"transparent",size:1,stroke:"transparent"}}},bar:H({style:{data:{fill:"#3F3F3F",padding:8,strokeWidth:0},labels:K}},B),boxplot:H({style:{max:{padding:8,stroke:"#3F3F3F",strokeWidth:1},maxLabels:H({},K,{padding:3}),median:{padding:8,stroke:"#3F3F3F",strokeWidth:1},medianLabels:H({},K,{padding:3}),min:{padding:8,stroke:"#3F3F3F",strokeWidth:1},minLabels:H({},K,{padding:3}),q1:{padding:8,fill:"#3F3F3F"},q1Labels:H({},K,{padding:3}),q3:{padding:8,fill:"#3F3F3F"},q3Labels:H({},K,{padding:3})},boxWidth:20},B),candlestick:H({style:{data:{stroke:"#3F3F3F"},labels:H({},K,{padding:5})},candleColors:{positive:"#ffffff",negative:"#3F3F3F"}},B),chart:B,errorbar:H({borderWidth:8,style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:K}},B),group:H({colorScale:j},B),histogram:H({style:{data:{fill:"#3F3F3F",stroke:"pink",strokeWidth:2},labels:K}},B),legend:{colorScale:j,gutter:10,orientation:"vertical",titleOrientation:"top",style:{data:{type:"circle"},labels:K,title:H({},K,{padding:5})}},line:H({style:{data:{fill:"transparent",opacity:1,stroke:"#3F3F3F",strokeWidth:2},labels:K}},B),pie:H({colorScale:j,style:{data:{padding:8,stroke:"#DFDFDF",strokeWidth:1},labels:H({},K,{padding:20})}},B),scatter:H({style:{data:{fill:"#3F3F3F",opacity:1,stroke:"transparent",strokeWidth:0},labels:K}},B),stack:H({colorScale:j},B),tooltip:{style:H({},K,{padding:0,pointerEvents:"none"}),flyoutStyle:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"},flyoutPadding:5,cornerRadius:5,pointerLength:10},voronoi:H({style:{data:{fill:"transparent",stroke:"transparent",strokeWidth:0},labels:H({},K,{padding:5,pointerEvents:"none"}),flyout:{stroke:"pink",strokeWidth:1,fill:"#f0f0f0",pointerEvents:"none"}}},B)};let q,U,X=e=>e;const G=W,Z=G(u)(q||(q=X`
2
2
  background: ${0};
3
3
  border: 1px solid ${0};
4
4
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
@@ -18,42 +18,42 @@ import*as e from"react";import{styled as t,StyledTooltip as n,ThemeContext as r,
18
18
  margin-bottom: 0;
19
19
  }
20
20
  }
21
- `),e=>e.theme.colors.neutral100,e=>e.theme.colors.neutral300,e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize,e=>e.theme.typeScale.size02.lineHeight),Z=t.span(U||(U=X`
21
+ `),e=>e.theme.colors.neutral100,e=>e.theme.colors.neutral300,e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize,e=>e.theme.typeScale.size02.lineHeight),J=G.span(U||(U=X`
22
22
  background: ${0};
23
23
  border: ${0};
24
24
  border-radius: 4px;
25
25
  height: 20px;
26
26
  width: 20px;
27
27
  margin-right: 8px;
28
- `),e=>e.color,e=>e.color?"none":"3px solid black"),J=t=>{const{datum:n,index:a,showTooltip:l,x:s,y:c}=t,d=e.useContext(r);return l===`${a}-${n.index}`?R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:s,y:c,width:"275",height:"100%",children:D(G,{position:i.top,role:"tooltip",theme:d,children:[D("div",{children:[R(Z,{color:d.iterableColors[a]}),R("span",{children:n.label})]}),R(o,{theme:d})]})})}):null},N=t=>{const{x:n,y:a,activePoints:l,hiddenData:s,dataLength:c}=t,d=Array.from(Array(c-0),(e,t)=>t+0).filter(e=>!s.includes(e)),u=e.useContext(r);return R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:n,y:a,width:"275",height:"100%",children:D(G,{"data-testid":"axis-tooltip",position:i.top,role:"tooltip",theme:u,children:[l.map((e,t)=>D("div",{children:[R(Z,{color:u.iterableColors[d[t]]}),R("span",{children:e.label})]},t)),R(o,{theme:u})]})})})},Q=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],Y=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],_=e=>{const{datum:t,index:n,lineIndex:r,pointRefArray:i,registerPoint:o,unregisterPoint:a}=e,l=T(e,Q);return R(S,H({},l,{ariaLabel:t.label,pathComponent:R(ee,{lineIndex:r,pointIndex:n,pointRefArray:i,registerPoint:o,unregisterPoint:a}),role:"button",tabIndex:0}))},ee=t=>{const{lineIndex:n,pointRefArray:r,pointIndex:i,registerPoint:o,unregisterPoint:l}=t,s=T(t,Y),c=a(),d=e.useRef(null);return e.useEffect(()=>(o(r,d),c(),()=>l(r,d)),[]),R("path",H({ref:d,"data-line-index":n,"data-point-index":i},s))},te=["events"],ne=e=>{let{events:t}=e,n=T(e,te);return D("g",{children:[R(A,H({},n,{events:t,style:{strokeWidth:"50px",stroke:"transparent"}})),R(A,H({},n,{events:t,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},re=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],ie=e.forwardRef((t,n)=>{const{color:i,dataIndex:o,isHidden:a,onClick:s,name:c,focusCurrentLine:d,resetLineFocus:u}=t,p=T(t,re);function f(){a||d&&"function"==typeof d&&d(o)}const h=e.useContext(r);return R("div",{style:{display:"inline-flex"},onMouseEnter:f,onMouseLeave:u,children:R(l,H({checked:!a,color:i,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:i?"none":`2px solid ${h.colors.neutral800}`,borderRadius:"4px"},labelText:c,onBlur:u,onClick:function(){s&&"function"==typeof s&&s(o),a||u&&"function"==typeof u&&u()},onFocus:f,ref:n,theme:h},p))})}),oe=["axisLabel","tickLabels"],ae=["style"],le=["axisLabel","tickLabels"],se=["style"];let ce,de,ue,pe,fe=e=>e;const he=t.div(ce||(ce=fe`
28
+ `),e=>e.color,e=>e.color?"none":"3px solid black"),N=t=>{const{datum:n,index:r,showTooltip:i,x:o,y:a}=t,s=e.useContext(p);return i===`${r}-${n.index}`?R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:o,y:a,width:"275",height:"100%",children:D(Z,{position:f.top,role:"tooltip",theme:s,children:[D("div",{children:[R(J,{color:s.iterableColors[r]}),R("span",{children:n.label})]}),R(h,{theme:s})]})})}):null},Q=t=>{const{x:n,y:r,activePoints:i,hiddenData:o,dataLength:a}=t,s=Array.from(Array(a-0),(e,t)=>t+0).filter(e=>!o.includes(e)),l=e.useContext(p);return R("g",{style:{pointerEvents:"none"},children:R("foreignObject",{x:n,y:r,width:"275",height:"100%",children:D(Z,{"data-testid":"axis-tooltip",position:f.top,role:"tooltip",theme:l,children:[i.map((e,t)=>D("div",{children:[R(J,{color:l.iterableColors[s[t]]}),R("span",{children:e.label})]},t)),R(h,{theme:l})]})})})},Y=["datum","index","lineIndex","pointRefArray","registerPoint","unregisterPoint"],_=["lineIndex","pointRefArray","pointIndex","registerPoint","unregisterPoint"],ee=e=>{const{datum:t,index:n,lineIndex:i,pointRefArray:o,registerPoint:a,unregisterPoint:s}=e,l=T(e,Y);return R(r,H({},l,{ariaLabel:t.label,pathComponent:R(te,{lineIndex:i,pointIndex:n,pointRefArray:o,registerPoint:a,unregisterPoint:s}),role:"button",tabIndex:0}))},te=t=>{const{lineIndex:n,pointRefArray:r,pointIndex:i,registerPoint:o,unregisterPoint:a}=t,s=T(t,_),l=m(),c=e.useRef(null);return e.useEffect(()=>(o(r,c),l(),()=>a(r,c)),[]),R("path",H({ref:c,"data-line-index":n,"data-point-index":i},s))},ne=["events"],re=e=>{let{events:t}=e,n=T(e,ne);return D("g",{children:[R(i,H({},n,{events:t,style:{strokeWidth:"50px",stroke:"transparent"}})),R(i,H({},n,{events:t,style:{strokeWidth:"1px",stroke:"black",strokeOpacity:"0.2"}}))]})},ie=["children","color","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus"],oe=e.forwardRef((t,n)=>{const{color:r,dataIndex:i,isHidden:o,onClick:a,name:s,focusCurrentLine:l,resetLineFocus:c}=t,d=T(t,ie);function u(){o||l&&"function"==typeof l&&l(i)}const f=e.useContext(p);return R("div",{style:{display:"inline-flex"},onMouseEnter:u,onMouseLeave:c,children:R(x,H({checked:!o,color:r,containerStyle:{alignItems:"center",border:"0",boxShadow:"0 0 0",color:f.colors.neutral,display:"inline-flex",margin:"0 36px 20px 0",padding:"0"},inputStyle:{border:r?"none":`2px solid ${f.colors.neutral800}`,borderRadius:"4px"},labelText:s,onBlur:c,onClick:function(){a&&"function"==typeof a&&a(i),o||c&&"function"==typeof c&&c()},onFocus:u,ref:n,theme:f},d))})}),ae=["axisLabel","tickLabels"],se=["style"],le=["axisLabel","tickLabels"],ce=["style"];let de,ue,pe,fe,he=e=>e;const me=W,xe=me.div(de||(de=he`
29
29
  max-height: 600px;
30
30
  max-width: 800px;
31
31
  svg {
32
32
  overflow: visible;
33
33
  }
34
- `)),me=t.div(de||(de=fe``)),xe=t.div(ue||(ue=fe`
34
+ `)),ge=me.div(ue||(ue=he``)),ye=me.div(pe||(pe=he`
35
35
  padding-bottom: 24px;
36
- `)),ge=t.p(pe||(pe=fe`
36
+ `)),be=me.p(fe||(fe=he`
37
37
  color: ${0};
38
38
  font-size: ${0};
39
- `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize);function ye(t){const{componentProps:{chart:n={},line:i={},scatter:o={},xAxis:{style:{axisLabel:a,tickLabels:l}={}}={style:{}},yAxis:{style:{axisLabel:c,tickLabels:d}={}}={style:{}}}={},data:u=[],lastFocusedScatterPoint:p,pointRefArray:f,registerPoint:h,unregisterPoint:m,tabRef:x,x:g,y}=t,b=T(t.componentProps.xAxis.style,oe),k=T(t.componentProps.xAxis,ae),v=T(t.componentProps.yAxis.style,le),w=T(t.componentProps.yAxis,se),F=e.useContext(r),L=e.useContext(s),[I,S]=e.useState([]),[A,j]=e.useState(800),[B,K]=e.useState(null),[M,q]=e.useState(null),[U,X]=e.useState(!0),[G,Z]=e.useState(!1),Q=e.useRef(null),Y=e.useRef(null);e.useEffect(()=>(ce(),window.addEventListener("resize",ce),window.addEventListener("keydown",de),()=>{window.removeEventListener("resize",ce),window.removeEventListener("keydown",de)}),[]),e.useEffect(()=>(window.addEventListener("mousemove",ue),()=>{window.removeEventListener("mousemove",ue)}),[M]);const ee=u.map((e,t)=>`scatter-${t}`),te=H({tickLabels:H({color:"#3f3f3f",fontSize:12},l),axisLabel:H({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},a)},b),re=H({tickLabels:H({fontSize:12},d),axisLabel:H({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},c)},v);function ce(){Q.current&&j(Q.current.clientWidth)}function de(e){"Escape"===e.key&&(q(null),X(!1))}function ue(){!M&&X(!0)}function pe(e){return null===B||B===e?1:.1}function fe(e){I.includes(e)?S(I.filter(t=>t!==e)):S(I.concat([e]))}function ye(e){K(e)}function be(){K(null)}const ke=(e,t)=>{if(t.current){const n=parseInt(t.current.getAttribute("data-line-index"),10);!e.includes(n)&&e.push(parseInt(t.current.getAttribute("data-line-index"),10))}return e},ve=e=>{const t=parseInt(e.current.getAttribute("data-line-index"),10),n=parseInt(e.current.getAttribute("data-point-index"),10),r=f.current.reduce(ke,[]);return{currentLineIndex:t,currentPointIndex:n,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},we=(e,t)=>n=>n.current&&parseInt(n.current.getAttribute("data-line-index"),10)===e&&parseInt(n.current.getAttribute("data-point-index"),10)===t;function Fe(e){const{key:t,shiftKey:n}=e;"Tab"===t&&n&&p&&p.current&&f.current.find(e=>e.current===p.current)&&(e.preventDefault(),p.current.focus())}return D(he,{ref:Q,children:[R(me,{onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Tab":e.preventDefault(),p.current=f.current.find(e=>e.current===document.activeElement).current,n?x.current&&x.current.focus():Y.current&&Y.current.focus();break;case"ArrowRight":{const e=f.current.findIndex(e=>e.current===document.activeElement);var r,i;void 0!==e&&(e===f.current.length-1?null==(r=f.current[0])||null==(i=r.current)||i.focus():f.current[e+1].current.focus());break}case"ArrowLeft":{const e=f.current.findIndex(e=>e.current===document.activeElement);void 0!==e&&(0===e?f.current[f.current.length-1].current.focus():f.current[e-1].current.focus());break}case"ArrowUp":{e.preventDefault();const t=f.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:i,highestLineIndex:o}=ve(t);if(e===i)f.current.find(we(o,n)).current.focus();else{const t=r[r.indexOf(e)-1];f.current.find(we(t,n)).current.focus()}}break}case"ArrowDown":{e.preventDefault();const t=f.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:i,highestLineIndex:o}=ve(t);if(e===o)f.current.find(we(i,n)).current.focus();else{const t=r[r.indexOf(e)+1];f.current.find(we(t,n)).current.focus()}}break}}},children:D($,H({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:V,width:A,containerComponent:R(P,{name:"xAxisGroupLabel",voronoiBlacklist:ee,voronoiDimension:"x",labels:G&&U?()=>" ":void 0,labelComponent:U?R(C,{flyoutComponent:R(N,{dataLength:u.length,hiddenData:I})}):void 0,role:"presentation",voronoiPadding:32})},n,{children:[R(E,H({},w,{dependentAxis:!0,style:re})),u.map(({data:e},t)=>!I.includes(t)&&R(z,H({style:{data:{opacity:pe(t),stroke:F.iterableColors[t],strokeWidth:"3"},parent:{border:F.colors.neutral400}},data:e,labelComponent:R(O,{}),x:g,y},i),`line${t}`)),R(E,H({},k,{style:te,gridComponent:R(ne,{events:{onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1)}})})),u.map(({data:e},t)=>!I.includes(t)&&R(W,H({name:`scatter-${t}`,events:[{target:"data",eventHandlers:{onBlur:()=>(X(!0),q(null),[{target:"labels",mutation:()=>({active:void 0})}]),onClick:()=>[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}],onFocus:()=>(X(!1),[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseEnter:()=>(X(!1),[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseLeave:()=>{q(null),X(!0)}}}],style:{data:{fill:F.colors.neutral100,opacity:pe(t),stroke:F.iterableColors[t],strokeWidth:2}},size:5,data:e.map((e,n)=>H({index:n,lineIndex:t},e)),dataComponent:R(_,{lineIndex:t,pointRefArray:f,registerPoint:h,unregisterPoint:m}),labels:()=>"",labelComponent:R(C,{text:"",flyoutComponent:R(J,{index:t,showTooltip:M})}),x:g,y},o),`scatter${t}`))]}))}),D(xe,{children:[R(ge,{theme:F,children:L.charts.line.dataLegendsLabel}),u.map(({name:e},t)=>{const n=L.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,e);return R(ie,{"aria-label":n,color:F.iterableColors[t],dataIndex:t,isHidden:I.includes(t),name:e,onClick:fe,onKeyDown:0===t?Fe:void 0,focusCurrentLine:ye,ref:0===t?Y:void 0,resetLineFocus:be},t)})]})]})}function be(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}const ke=t=>{const{data:n=[],xData:{keyValue:r,label:i,tickFormat:o,tickValues:a},yData:{keyValue:l,tickFormat:s}}=t,[p,f]=e.useState({columns:[],rows:[]});return e.useEffect(()=>{f(function(){const e=be(r||i||"x"),t=n.reduce((e,{data:t})=>(t.forEach(t=>{const n=t.x||r&&t[r];!e.includes(n)&&e.push(n)}),e),[]);let c={columns:t.length>0?[{field:e,header:i||r||"X",isRowHeader:!0}]:[],rows:t.reduce((n,r,i)=>{const l=a&&"number"==typeof r&&a.length===t.length?o&&"function"==typeof o?o(a[r-1]):a[r-1]:o&&Array.isArray(o)?o[r-1]:o&&"function"==typeof o?o(r):r;return n.push({[e]:l,id:i}),n},[])};return n.reduce((e,t)=>{const{name:n,data:r}=t,i=be(n);return e.columns.push({field:i,header:n}),r.forEach((t,n)=>{const r=t.y||0===t.y?t.y:l&&t[l];e.rows[n]=H({},e.rows[n],{id:c.rows.length>0?n+1:n,[i]:s&&"function"==typeof s?s(r):r})}),e},c)}())},[n]),R(c,{children:p.rows.length>0?R(d,{hasPagination:!1,columns:p.columns,rows:p.rows}):R(u,{})})},ve=["description","title","testId","type"];let we,Fe,Le,Ie,Se,Ae,$e=e=>e;const Pe=t.span(we||(we=$e`
39
+ `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size02.fontSize);function ke(t){const{componentProps:{chart:n={},line:r={},scatter:i={},xAxis:{style:{axisLabel:u,tickLabels:f}={}}={style:{}},yAxis:{style:{axisLabel:h,tickLabels:m}={}}={style:{}}}={},data:x=[],lastFocusedScatterPoint:y,pointRefArray:b,registerPoint:k,unregisterPoint:v,tabRef:w,x:F,y:L}=t,I=T(t.componentProps.xAxis.style,ae),S=T(t.componentProps.xAxis,se),A=T(t.componentProps.yAxis.style,le),$=T(t.componentProps.yAxis,ce),P=e.useContext(p),C=e.useContext(g),[E,z]=e.useState([]),[W,j]=e.useState(800),[B,K]=e.useState(null),[M,q]=e.useState(null),[U,X]=e.useState(!0),[G,Z]=e.useState(!1),J=e.useRef(null),Y=e.useRef(null);e.useEffect(()=>(ie(),window.addEventListener("resize",ie),window.addEventListener("keydown",de),()=>{window.removeEventListener("resize",ie),window.removeEventListener("keydown",de)}),[]),e.useEffect(()=>(window.addEventListener("mousemove",ue),()=>{window.removeEventListener("mousemove",ue)}),[M]);const _=x.map((e,t)=>`scatter-${t}`),te=H({tickLabels:H({color:"#3f3f3f",fontSize:12},f),axisLabel:H({color:"#3f3f3f",padding:44,fontSize:14,fontWeight:"bold"},u)},I),ne=H({tickLabels:H({fontSize:12},m),axisLabel:H({color:"#3f3f3f",padding:64,fontSize:14,fontWeight:"bold"},h)},A);function ie(){J.current&&j(J.current.clientWidth)}function de(e){"Escape"===e.key&&(q(null),X(!1))}function ue(){!M&&X(!0)}function pe(e){return null===B||B===e?1:.1}function fe(e){E.includes(e)?z(E.filter(t=>t!==e)):z(E.concat([e]))}function he(e){K(e)}function me(){K(null)}const ke=(e,t)=>{if(t.current){const n=parseInt(t.current.getAttribute("data-line-index"),10);!e.includes(n)&&e.push(parseInt(t.current.getAttribute("data-line-index"),10))}return e},ve=e=>{const t=parseInt(e.current.getAttribute("data-line-index"),10),n=parseInt(e.current.getAttribute("data-point-index"),10),r=b.current.reduce(ke,[]);return{currentLineIndex:t,currentPointIndex:n,lineIndexes:r,lowestLineIndex:r[0],highestLineIndex:r[r.length-1]}},we=(e,t)=>n=>n.current&&parseInt(n.current.getAttribute("data-line-index"),10)===e&&parseInt(n.current.getAttribute("data-point-index"),10)===t;function Fe(e){const{key:t,shiftKey:n}=e;"Tab"===t&&n&&y&&y.current&&b.current.find(e=>e.current===y.current)&&(e.preventDefault(),y.current.focus())}return D(xe,{ref:J,children:[R(ge,{onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Tab":e.preventDefault(),y.current=b.current.find(e=>e.current===document.activeElement).current,n?w.current&&w.current.focus():Y.current&&Y.current.focus();break;case"ArrowRight":{const e=b.current.findIndex(e=>e.current===document.activeElement);void 0!==e&&(e===b.current.length-1?b.current[0].current.focus():b.current[e+1].current.focus());break}case"ArrowLeft":{const e=b.current.findIndex(e=>e.current===document.activeElement);void 0!==e&&(0===e?b.current[b.current.length-1].current.focus():b.current[e-1].current.focus());break}case"ArrowUp":{e.preventDefault();const t=b.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:i,highestLineIndex:o}=ve(t);if(e===i)b.current.find(we(o,n)).current.focus();else{const t=r[r.indexOf(e)-1];b.current.find(we(t,n)).current.focus()}}break}case"ArrowDown":{e.preventDefault();const t=b.current.find(e=>e.current===document.activeElement);if(t&&t.current){const{currentLineIndex:e,currentPointIndex:n,lineIndexes:r,lowestLineIndex:i,highestLineIndex:o}=ve(t);if(e===o)b.current.find(we(i,n)).current.focus();else{const t=r[r.indexOf(e)+1];b.current.find(we(t,n)).current.focus()}}break}}},children:D(o,H({domainPadding:32,height:400,padding:{top:0,left:80,right:0,bottom:62},theme:V,width:W,containerComponent:R(a,{name:"xAxisGroupLabel",voronoiBlacklist:_,voronoiDimension:"x",labels:G&&U?()=>" ":void 0,labelComponent:U?R(s,{flyoutComponent:R(Q,{dataLength:x.length,hiddenData:E})}):void 0,role:"presentation",voronoiPadding:32})},n,{children:[R(l,H({},$,{dependentAxis:!0,style:ne})),x.map(({data:e},t)=>!E.includes(t)&&R(c,H({style:{data:{opacity:pe(t),stroke:P.iterableColors[t],strokeWidth:"3"},parent:{border:P.colors.neutral400}},data:e,labelComponent:R(O,{}),x:F,y:L},r),`line${t}`)),R(l,H({},S,{style:te,gridComponent:R(re,{events:{onMouseEnter:()=>Z(!0),onMouseLeave:()=>Z(!1)}})})),x.map(({data:e},t)=>!E.includes(t)&&R(d,H({name:`scatter-${t}`,events:[{target:"data",eventHandlers:{onBlur:()=>(X(!0),q(null),[{target:"labels",mutation:()=>({active:void 0})}]),onClick:()=>[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}],onFocus:()=>(X(!1),[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseEnter:()=>(X(!1),[{target:"labels",mutation:e=>(q(`${e.datum.lineIndex}-${e.datum.index}`),{active:!0})}]),onMouseLeave:()=>{q(null),X(!0)}}}],style:{data:{fill:P.colors.neutral100,opacity:pe(t),stroke:P.iterableColors[t],strokeWidth:2}},size:5,data:e.map((e,n)=>H({index:n,lineIndex:t},e)),dataComponent:R(ee,{lineIndex:t,pointRefArray:b,registerPoint:k,unregisterPoint:v}),labels:()=>"",labelComponent:R(s,{text:"",flyoutComponent:R(N,{index:t,showTooltip:M})}),x:F,y:L},i),`scatter${t}`))]}))}),D(ye,{children:[R(be,{theme:P,children:C.charts.line.dataLegendsLabel}),x.map(({name:e},t)=>{const n=C.charts.line.legendButtonAriaLabel.replace(/\{name\}/g,e);return R(oe,{"aria-label":n,color:P.iterableColors[t],dataIndex:t,isHidden:E.includes(t),name:e,onClick:fe,onKeyDown:0===t?Fe:void 0,focusCurrentLine:he,ref:0===t?Y:void 0,resetLineFocus:me},t)})]})]})}function ve(e){return e.toLowerCase().replace(/[^a-z 0-9]/gi,"").replace(/(?:^\w|[A-Z]|\b\w)/g,(e,t)=>0===t?e.toLowerCase():e.toUpperCase()).replace(/\s+/g,"")}const we=t=>{const{data:n=[],xData:{keyValue:r,label:i,tickFormat:o,tickValues:a},yData:{keyValue:s,tickFormat:l}}=t,[c,d]=e.useState({columns:[],rows:[]});return e.useEffect(()=>{d(function(){const e=ve(r||i||"x"),t=n.reduce((e,{data:t})=>(t.forEach(t=>{const n=t.x||r&&t[r];!e.includes(n)&&e.push(n)}),e),[]);let c={columns:t.length>0?[{field:e,header:i||r||"X",isRowHeader:!0}]:[],rows:t.reduce((n,r,i)=>{const s=a&&"number"==typeof r&&a.length===t.length?o&&"function"==typeof o?o(a[r-1]):a[r-1]:o&&Array.isArray(o)?o[r-1]:o&&"function"==typeof o?o(r):r;return n.push({[e]:s,id:i}),n},[])};return n.reduce((e,t)=>{const{name:n,data:r}=t,i=ve(n);return e.columns.push({field:i,header:n}),r.forEach((t,n)=>{const r=t.y||0===t.y?t.y:s&&t[s];e.rows[n]=H({},e.rows[n],{id:c.rows.length>0?n+1:n,[i]:l&&"function"==typeof l?l(r):r})}),e},c)}())},[n]),R(y,{children:c.rows.length>0?R(b,{hasPagination:!1,columns:c.columns,rows:c.rows}):R(k,{})})},Fe=["description","title","testId","type"];let Le,Ie,Se,Ae,$e,Pe,Ce=e=>e;const Ee=W,ze=Ee.span(Le||(Le=Ce`
40
40
  color: ${0};
41
41
  font-size: ${0};
42
42
  font-weight: 600;
43
43
  font-family: ${0};
44
44
  line-height: ${0};
45
45
  margin: 0 0 12px 0;
46
- `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size04.fontSize,e=>e.theme.bodyFont,e=>e.theme.typeScale.size04.lineHeight),Ce=t(p)(Fe||(Fe=$e`
46
+ `),e=>e.theme.colors.neutral,e=>e.theme.typeScale.size04.fontSize,e=>e.theme.bodyFont,e=>e.theme.typeScale.size04.lineHeight),We=Ee(v)(Ie||(Ie=Ce`
47
47
  font-size: ${0};
48
48
  margin: 0 0 18px 0;
49
- `),e=>e.theme.typeScale.size02.fontSize),Ee=t(f)(Le||(Le=$e`
49
+ `),e=>e.theme.typeScale.size02.fontSize),Re=Ee(w)(Se||(Se=Ce`
50
50
  width: 800px;
51
51
  ul {
52
52
  box-shadow: inset 0 -1px 0 ${0};
53
53
  }
54
- `),e=>e.theme.colors.neutral300),ze=t(h)(Ie||(Ie=$e`
54
+ `),e=>e.theme.colors.neutral300),De=Ee(F)(Ae||(Ae=Ce`
55
55
  padding: 22px 0;
56
- `)),We=t(c)(Se||(Se=$e`
56
+ `)),Oe=Ee(y)($e||($e=Ce`
57
57
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
58
58
  display: ${0};
59
59
  right: ${0};
@@ -69,8 +69,8 @@ import*as e from"react";import{styled as t,StyledTooltip as n,ThemeContext as r,
69
69
  z-index: 2;
70
70
 
71
71
  ${0}
72
- `),e=>e.isOpen?"block":"none",e=>e.theme.spaceScale.spacing02,e=>e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight,e=>e.isOpen?"1":"0",e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.width&&L(Ae||(Ae=$e`
72
+ `),e=>e.isOpen?"block":"none",e=>e.theme.spaceScale.spacing02,e=>e.maxHeight?e.maxHeight:e.theme.dropdown.content.maxHeight,e=>e.isOpen?"1":"0",e=>e.theme.spaceScale.spacing05,e=>e.theme.spaceScale.spacing05,e=>e.width&&t(Pe||(Pe=Ce`
73
73
  white-space: normal;
74
74
  width: ${0};
75
- `),e.width));function Re(t,n){var i,o,a,l,c,d;const{description:u,title:f,type:h}=t,L=T(t,ve),S=e.useRef(null),A=e.useRef(null),$=e.useContext(r),P=e.useContext(s),[C,E,z]=m(),[W,O]=e.useState(!1);return D("div",{ref:n,children:[R(Pe,{theme:$,children:f}),u&&R(Ce,{theme:$,visualStyle:x.bodySmall,children:u}),D(Ee,{theme:$,children:[D(g,{children:[R(y,{children:P.charts.line.chartTabLabel}),R(y,{children:P.charts.line.dataTabLabel}),D("div",{onBlur:function(){O(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[R(b,{content:P.charts.line.keyboardInstructionsTooltip,ref:S,children:R(k,{"aria-controls":"keyboardInstructions","aria-label":P.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(W),icon:R(I,{}),onClick:function(){O(e=>!e)},onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Escape":O(!1);break;case"Tab":!n&&A&&A.current&&C.current.find(e=>e.current===A.current)&&(e.preventDefault(),A.current.focus())}},variant:v.link})}),R(w,{children:D(We,{id:"keyboardInstructions",isOpen:W,theme:$,width:"350px",children:[R(p,{visualStyle:x.headingXSmall,style:{margin:"0 0 16px"},children:P.charts.line.keyboardInstructionsHeader}),P.charts.line.keyboardInstructions]})})]})]}),D(F,{children:[R(ze,{theme:$,children:"line"===h&&R(ye,H({},L,{lastFocusedScatterPoint:A,pointRefArray:C,registerPoint:E,tabRef:S,unregisterPoint:z}))}),R(ze,{theme:$,children:R(ke,{data:L.data,xData:{keyValue:L.x,label:null==(i=L.componentProps)||null==(o=i.xAxis)?void 0:o.label,tickFormat:null==(a=L.componentProps)||null==(l=a.xAxis)?void 0:l.tickFormat},yData:{keyValue:L.y,tickFormat:null==(c=L.componentProps)||null==(d=c.yAxis)?void 0:d.tickFormat}})})]})]})]})}const De=e.forwardRef(Re);export{De as Chart};
75
+ `),e.width));function He(t,r){var i,o,a,s,l,c;const{description:d,title:u,type:f}=t,h=T(t,Fe),m=e.useRef(null),x=e.useRef(null),y=e.useContext(p),b=e.useContext(g),[k,w,F]=L(),[W,O]=e.useState(!1);return D("div",{ref:r,children:[R(ze,{theme:y,children:u}),d&&R(We,{theme:y,visualStyle:I.bodySmall,children:d}),D(Re,{theme:y,children:[D(S,{children:[R(A,{children:b.charts.line.chartTabLabel}),R(A,{children:b.charts.line.dataTabLabel}),D("div",{onBlur:function(){O(!1)},style:{display:"inline-block",marginLeft:"auto"},children:[R($,{content:b.charts.line.keyboardInstructionsTooltip,ref:m,children:R(P,{"aria-controls":"keyboardInstructions","aria-label":b.charts.line.keyboardInstructionsTooltip,"aria-expanded":Boolean(W),icon:R(n,{}),onClick:function(){O(e=>!e)},onKeyDown:function(e){const{key:t,shiftKey:n}=e;switch(t){case"Escape":O(!1);break;case"Tab":!n&&x&&x.current&&k.current.find(e=>e.current===x.current)&&(e.preventDefault(),x.current.focus())}},variant:C.link})}),R(E,{children:D(Oe,{id:"keyboardInstructions",isOpen:W,theme:y,width:"350px",children:[R(v,{visualStyle:I.headingXSmall,style:{margin:"0 0 16px"},children:b.charts.line.keyboardInstructionsHeader}),b.charts.line.keyboardInstructions]})})]})]}),D(z,{children:[R(De,{theme:y,children:"line"===f&&R(ke,H({},h,{lastFocusedScatterPoint:x,pointRefArray:k,registerPoint:w,tabRef:m,unregisterPoint:F}))}),R(De,{theme:y,children:R(we,{data:h.data,xData:{keyValue:h.x,label:null==(i=h.componentProps)||null==(o=i.xAxis)?void 0:o.label,tickFormat:null==(a=h.componentProps)||null==(s=a.xAxis)?void 0:s.tickFormat},yData:{keyValue:h.y,tickFormat:null==(l=h.componentProps)||null==(c=l.yAxis)?void 0:c.tickFormat}})})]})]})]})}const Te=e.forwardRef(He);export{Te as Chart};
76
76
  //# sourceMappingURL=charts.modern.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"charts.modern.js","sources":["../src/components/LineChart/magma-charts.ts","../src/components/LineChart/GraphTooltip.tsx","../src/components/LineChart/CustomPointComponent.tsx","../src/components/LineChart/CustomAxisComponent.tsx","../src/components/LineChart/LegendButton.tsx","../src/components/LineChart/LineChart.tsx","../src/components/LineChart/ChartDataTable.tsx","../src/components/LineChart/Chart.tsx"],"sourcesContent":["// *\n// * Colors\n// *\n// const yellow200 = '#FFF59D';\n// const deepOrange600 = '#F4511E';\n// const lime300 = '#DCE775';\n// const lightGreen500 = '#8BC34A';\n// const teal700 = '#00796B';\n// const cyan900 = '#006064';\n\n// const colors = [\n// '#0085CC',\n// '#E0004D',\n// '#FA6600',\n// '#48A200',\n// '#B12FAD',\n// '#00A393',\n// ];\n\nconst colors = [\n '#00507A',\n '#8F0033',\n '#B84900',\n '#255200',\n '#711E6E',\n '#005249',\n];\n\nconst blueGrey50 = '#DFDFDF';\nconst blueGrey300 = '#8F8F8F';\nconst blueGrey700 = '#3F3F3F';\nconst grey900 = 'pink';\n\n// *\n// * Typography\n// *\nconst sansSerif = '\"Work Sans\",Helvetica,sans-serif';\nconst letterSpacing = 'normal';\nconst fontSize = 12;\n\n// *\n// * Layout\n// *\nconst padding = 8;\nconst baseProps = {\n width: 350,\n height: 350,\n padding: 50,\n};\n\n// *\n// * Labels\n// *\nconst baseLabelStyles = {\n fontFamily: sansSerif,\n fontSize,\n letterSpacing,\n padding,\n fill: blueGrey700,\n stroke: 'transparent',\n strokeWidth: 0,\n};\n\nconst centeredLabelStyles = { textAnchor: 'middle', ...baseLabelStyles };\n// *\n// * Strokes\n// *\n// const strokeDasharray = '10, 5';\nconst strokeLinecap = 'round';\nconst strokeLinejoin = 'round';\n\nexport const magmaTheme: any = {\n area: {\n style: {\n data: {\n fill: grey900,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n axis: {\n style: {\n axis: {\n fill: 'transparent',\n stroke: blueGrey300,\n strokeWidth: 1,\n strokeLinecap,\n strokeLinejoin,\n },\n axisLabel: {\n ...centeredLabelStyles,\n padding,\n stroke: 'transparent',\n },\n grid: {\n fill: 'none',\n stroke: '#dfdfdf',\n //strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n pointerEvents: 'painted',\n },\n ticks: {\n fill: 'transparent',\n size: 0,\n stroke: blueGrey300,\n strokeWidth: 0,\n strokeLinecap,\n strokeLinejoin,\n },\n tickLabels: {\n ...baseLabelStyles,\n fill: blueGrey700,\n },\n },\n ...baseProps,\n },\n polarDependentAxis: {\n style: {\n ticks: {\n fill: 'transparent',\n size: 1,\n stroke: 'transparent',\n },\n },\n },\n bar: {\n style: {\n data: {\n fill: blueGrey700,\n padding,\n strokeWidth: 0,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n boxplot: {\n style: {\n max: { padding, stroke: blueGrey700, strokeWidth: 1 },\n maxLabels: { ...baseLabelStyles, padding: 3 },\n median: { padding, stroke: blueGrey700, strokeWidth: 1 },\n medianLabels: { ...baseLabelStyles, padding: 3 },\n min: { padding, stroke: blueGrey700, strokeWidth: 1 },\n minLabels: { ...baseLabelStyles, padding: 3 },\n q1: { padding, fill: blueGrey700 },\n q1Labels: { ...baseLabelStyles, padding: 3 },\n q3: { padding, fill: blueGrey700 },\n q3Labels: { ...baseLabelStyles, padding: 3 },\n },\n boxWidth: 20,\n ...baseProps,\n },\n candlestick: {\n style: {\n data: {\n stroke: blueGrey700,\n },\n labels: { ...baseLabelStyles, padding: 5 },\n },\n candleColors: {\n positive: '#ffffff',\n negative: blueGrey700,\n },\n ...baseProps,\n },\n chart: baseProps,\n errorbar: {\n borderWidth: 8,\n style: {\n data: {\n fill: 'transparent',\n opacity: 1,\n stroke: blueGrey700,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n group: {\n colorScale: colors,\n ...baseProps,\n },\n histogram: {\n style: {\n data: {\n fill: blueGrey700,\n stroke: grey900,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n legend: {\n colorScale: colors,\n gutter: 10,\n orientation: 'vertical',\n titleOrientation: 'top',\n style: {\n data: {\n type: 'circle',\n },\n labels: baseLabelStyles,\n title: { ...baseLabelStyles, padding: 5 },\n },\n },\n line: {\n style: {\n data: {\n fill: 'transparent',\n opacity: 1,\n stroke: blueGrey700,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n pie: {\n colorScale: colors,\n style: {\n data: {\n padding,\n stroke: blueGrey50,\n strokeWidth: 1,\n },\n labels: { ...baseLabelStyles, padding: 20 },\n },\n ...baseProps,\n },\n scatter: {\n style: {\n data: {\n fill: blueGrey700,\n opacity: 1,\n stroke: 'transparent',\n strokeWidth: 0,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n stack: {\n colorScale: colors,\n ...baseProps,\n },\n tooltip: {\n style: { ...baseLabelStyles, padding: 0, pointerEvents: 'none' },\n flyoutStyle: {\n stroke: grey900,\n strokeWidth: 1,\n fill: '#f0f0f0',\n pointerEvents: 'none',\n },\n flyoutPadding: 5,\n cornerRadius: 5,\n pointerLength: 10,\n },\n voronoi: {\n style: {\n data: {\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n },\n labels: { ...baseLabelStyles, padding: 5, pointerEvents: 'none' },\n flyout: {\n stroke: grey900,\n strokeWidth: 1,\n fill: '#f0f0f0',\n pointerEvents: 'none',\n },\n },\n ...baseProps,\n },\n};\n","import * as React from 'react';\nimport {\n StyledTooltip,\n ThemeContext,\n TooltipArrow,\n TooltipPosition,\n ThemeInterface,\n styled,\n} from 'react-magma-dom';\n\nconst StyledGraphTooltip = styled(StyledTooltip)`\n background: ${(props: any) => props.theme.colors.neutral100};\n border: 1px solid ${(props: any) => props.theme.colors.neutral300};\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);\n box-sizing: border-box;\n color: ${(props: any) => props.theme.colors.neutral};\n font-size: ${(props: any) => props.theme.typeScale.size02.fontSize};\n font-weight: normal;\n line-height: ${(props: any) => props.theme.typeScale.size02.lineHeight};\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`;\n\nconst TooltipColorSwatch = styled.span`\n background: ${(props: any) => props.color};\n border: ${(props: any) => (props.color ? 'none' : '3px solid black')};\n border-radius: 4px;\n height: 20px;\n width: 20px;\n margin-right: 8px;\n`;\n\nexport const GraphTooltip = (props: any) => {\n const { datum, index, showTooltip, x, y } = props;\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n const linePointIndex = `${index}-${datum.index}`;\n\n return showTooltip === linePointIndex ? (\n <g style={{ pointerEvents: 'none' }}>\n <foreignObject x={x} y={y} width=\"275\" height=\"100%\">\n <StyledGraphTooltip\n position={TooltipPosition.top}\n role=\"tooltip\"\n theme={theme}\n >\n <div>\n <TooltipColorSwatch color={theme.iterableColors[index]} />\n <span>{datum.label}</span>\n </div>\n <TooltipArrow theme={theme} />\n </StyledGraphTooltip>\n </foreignObject>\n </g>\n ) : null;\n};\n\nexport const AxisTooltip = (props: any) => {\n const { x, y, activePoints, hiddenData, dataLength } = props;\n\n const pointsIndexes = Array.from(\n Array(dataLength - 0),\n (_, i) => i + 0\n ).filter(i => !hiddenData.includes(i));\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n\n return (\n <g style={{ pointerEvents: 'none' }}>\n <foreignObject x={x} y={y} width=\"275\" height=\"100%\">\n <StyledGraphTooltip\n data-testid=\"axis-tooltip\"\n position={TooltipPosition.top}\n role=\"tooltip\"\n theme={theme}\n >\n {activePoints.map((point: any, i: number) => (\n <div key={i}>\n <TooltipColorSwatch\n color={theme.iterableColors[pointsIndexes[i]]}\n />\n <span>{point.label}</span>\n </div>\n ))}\n <TooltipArrow theme={theme} />\n </StyledGraphTooltip>\n </foreignObject>\n </g>\n );\n};\n","import * as React from 'react';\nimport { Point, PointProps } from 'victory';\nimport { useForceUpdate } from 'react-magma-dom';\n\nexport interface CustomScatterDataComponentInterface extends PointProps {\n lineIndex: number;\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport interface CustomPointComponentInterface {\n lineIndex: number;\n pointIndex: PointProps['index'];\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const CustomScatterDataComponent = (\n props: CustomScatterDataComponentInterface\n) => {\n const {\n datum,\n index: pointIndex,\n lineIndex,\n pointRefArray,\n registerPoint,\n unregisterPoint,\n ...other\n } = props;\n return (\n <Point\n {...other}\n ariaLabel={datum.label}\n pathComponent={\n <CustomPointComponent\n lineIndex={lineIndex}\n pointIndex={pointIndex}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n unregisterPoint={unregisterPoint}\n />\n }\n role=\"button\"\n tabIndex={0}\n />\n );\n};\n\nexport const CustomPointComponent = (props: CustomPointComponentInterface) => {\n const {\n lineIndex,\n pointRefArray,\n pointIndex,\n registerPoint,\n unregisterPoint,\n ...other\n } = props;\n const forceUpdate = useForceUpdate();\n const ref = React.useRef<SVGPathElement | null>(null);\n\n React.useEffect(() => {\n registerPoint(pointRefArray, ref as React.MutableRefObject<Element>);\n\n forceUpdate();\n\n return () =>\n unregisterPoint(pointRefArray, ref as React.MutableRefObject<Element>);\n }, []);\n\n return (\n <path\n ref={ref}\n data-line-index={lineIndex}\n data-point-index={pointIndex}\n {...other}\n />\n );\n};\n","import * as React from 'react';\nimport { LineSegment, LineSegmentProps } from 'victory';\n\nexport const CustomAxisComponent: React.FunctionComponent<LineSegmentProps> = ({\n events,\n ...props\n}: any) => {\n return (\n <g>\n <LineSegment\n {...props}\n events={events}\n style={{\n strokeWidth: '50px',\n stroke: 'transparent',\n }}\n />\n <LineSegment\n {...props}\n events={events}\n style={{\n strokeWidth: '1px',\n stroke: 'black',\n strokeOpacity: '0.2',\n }}\n />\n </g>\n );\n};\n","import * as React from 'react';\nimport { ThemeContext, Checkbox } from 'react-magma-dom';\n\nexport interface DataTableProps {\n name?: string;\n color?: string;\n}\n\nexport const LegendButton = React.forwardRef<HTMLButtonElement, any>(\n (props, ref) => {\n const {\n children,\n color,\n dataIndex,\n isHidden,\n onClick,\n name,\n focusCurrentLine,\n resetLineFocus,\n ...other\n } = props;\n\n function handleClick() {\n onClick && typeof onClick === 'function' && onClick(dataIndex);\n\n if (!isHidden) {\n resetLineFocus &&\n typeof resetLineFocus === 'function' &&\n resetLineFocus();\n }\n }\n\n function handleOnMouseEnterOrFocus() {\n if (!isHidden) {\n focusCurrentLine &&\n typeof focusCurrentLine === 'function' &&\n focusCurrentLine(dataIndex);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <div\n style={{ display: 'inline-flex' }}\n onMouseEnter={handleOnMouseEnterOrFocus}\n onMouseLeave={resetLineFocus}\n >\n <Checkbox\n checked={!isHidden}\n color={color}\n containerStyle={{\n alignItems: 'center',\n border: '0',\n boxShadow: '0 0 0',\n color: theme.colors.neutral,\n display: 'inline-flex',\n margin: '0 36px 20px 0',\n padding: '0',\n }}\n inputStyle={{\n border: color ? `none` : `2px solid ${theme.colors.neutral800}`,\n borderRadius: '4px',\n }}\n labelText={name}\n onBlur={resetLineFocus}\n onClick={handleClick}\n onFocus={handleOnMouseEnterOrFocus}\n ref={ref}\n theme={theme}\n {...other}\n />\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport {\n VictoryAxis,\n VictoryAxisProps,\n VictoryChart,\n VictoryChartProps,\n VictoryLine,\n VictoryLineProps,\n VictoryScatter,\n VictoryScatterProps,\n VictoryTooltip,\n VictoryVoronoiContainer,\n} from 'victory';\n\nimport {\n I18nContext,\n ThemeContext,\n styled,\n ThemeInterface,\n I18nInterface,\n} from 'react-magma-dom';\n\nimport { magmaTheme } from './magma-charts';\nimport { AxisTooltip, GraphTooltip } from './GraphTooltip';\nimport { CustomScatterDataComponent } from './CustomPointComponent';\nimport { CustomAxisComponent } from './CustomAxisComponent';\nimport { LegendButton } from './LegendButton';\n\nexport type LineChartAxisStyle = VictoryAxisProps['style'];\nexport type DataGetterPropType = VictoryLineProps['x'];\n\nexport type ChartDataOptions =\n | {\n label: string;\n x: string | number;\n y: string | number;\n [key: string]: any;\n }\n | { label: string; [key: string]: any }\n | any;\n\nexport interface LineChartData<T> {\n name: string;\n data: T[];\n}\n\nexport interface LineChartComponentProps {\n chart?: VictoryChartProps;\n line?: VictoryLineProps;\n scatter?: VictoryScatterProps;\n xAxis?: VictoryAxisProps;\n yAxis?: VictoryAxisProps;\n}\n\n// NOTE: These props are manually copied to line-chart.mdx\nexport interface LineChartProps<T extends ChartDataOptions> {\n /**\n * Props passed to each component that makes up the line chart. See `victory` for accepted props.\n */\n componentProps?: LineChartComponentProps;\n /**\n * Data used to build the chart\n */\n data?: LineChartData<T>[];\n isMulti?: boolean;\n /**\n * @internal\n */\n lastFocusedScatterPoint: React.MutableRefObject<SVGPathElement | null>;\n /**\n * @internal\n */\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n /**\n * @internal\n */\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n /**\n * @internal\n */\n tabRef: React.MutableRefObject<HTMLButtonElement | null>;\n /**\n * @internal\n */\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n /**\n * Value of x key in chart data\n */\n x?: keyof T;\n /**\n * Value of y key in chart data\n */\n y?: keyof T;\n}\n\nconst LineChartContainer = styled.div`\n max-height: 600px;\n max-width: 800px;\n svg {\n overflow: visible;\n }\n`;\n\nconst VictoryChartContainer = styled.div``;\n\nconst DataLegendsContainer = styled.div`\n padding-bottom: 24px;\n`;\n\nconst DataLegendsDescription = styled.p`\n color: ${(props: any) => props.theme.colors.neutral};\n font-size: ${(props: any) => props.theme.typeScale.size02.fontSize};\n`;\n\nexport function LineChart<T>(props: LineChartProps<T>) {\n const {\n componentProps: {\n chart = {},\n line = {},\n scatter = {},\n xAxis: {\n style: {\n axisLabel: xAxisLabel = undefined,\n tickLabels: xTickLabels = undefined,\n ...xRest\n } = {},\n ...xAxisOther\n } = { style: {} },\n yAxis: {\n style: {\n axisLabel: yAxisLabel = undefined,\n tickLabels: yTickLabels = undefined,\n ...yRest\n } = {},\n ...yAxisOther\n } = { style: {} },\n } = {},\n data = [],\n lastFocusedScatterPoint,\n pointRefArray,\n registerPoint,\n unregisterPoint,\n tabRef,\n x,\n y,\n } = props;\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n const i18n: I18nInterface = React.useContext(I18nContext);\n\n const [hiddenData, setHiddenData] = React.useState<number[]>([]);\n const [width, setWidth] = React.useState<number>(800);\n const [focusedLine, setFocusedLine] = React.useState<number | null>(null);\n const [showTooltip, setShowTooltip] = React.useState<string | null>(null);\n const [showXAxisLabel, setShowXAxisLabel] = React.useState<boolean>(true);\n const [hoveringOnXAxisLine, setHoveringOnXAxisLine] =\n React.useState<boolean>(false);\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const firstLegendButtonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useEffect(() => {\n updateWidth();\n\n window.addEventListener('resize', updateWidth);\n window.addEventListener('keydown', handleEsc);\n\n return () => {\n window.removeEventListener('resize', updateWidth);\n window.removeEventListener('keydown', handleEsc);\n };\n }, []);\n\n React.useEffect(() => {\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }, [showTooltip]);\n\n const scatterNames: string[] = data.map((_, i) => `scatter-${i}`);\n\n const xAxisStyles = {\n tickLabels: {\n color: '#3f3f3f',\n fontSize: 12,\n ...xTickLabels,\n },\n axisLabel: {\n color: '#3f3f3f',\n padding: 44,\n fontSize: 14,\n fontWeight: 'bold',\n ...xAxisLabel,\n },\n ...xRest,\n };\n\n const yAxisStyles = {\n tickLabels: {\n fontSize: 12,\n ...yTickLabels,\n },\n axisLabel: {\n color: '#3f3f3f',\n padding: 64,\n fontSize: 14,\n fontWeight: 'bold',\n ...yAxisLabel,\n },\n ...yRest,\n };\n\n function updateWidth() {\n containerRef.current && setWidth(containerRef.current.clientWidth);\n }\n\n function handleEsc(event: KeyboardEvent): any {\n if (event.key === 'Escape') {\n setShowTooltip(null);\n setShowXAxisLabel(false);\n }\n }\n\n function handleMouseMove() {\n !showTooltip && setShowXAxisLabel(true);\n }\n\n function setLineOpacity(index: number) {\n return focusedLine === null ? 1 : focusedLine === index ? 1 : 0.1;\n }\n\n function handleLegendClick(dataIndex: number) {\n if (hiddenData.includes(dataIndex)) {\n setHiddenData(hiddenData.filter(item => item !== dataIndex));\n } else {\n setHiddenData(hiddenData.concat([dataIndex]));\n }\n }\n\n function focusCurrentLine(dataIndex: number) {\n setFocusedLine(dataIndex);\n }\n\n function resetLineFocus() {\n setFocusedLine(null);\n }\n\n const buildLineIndexes = (\n acc: number[],\n point: React.MutableRefObject<Element>\n ) => {\n if (point.current) {\n const currentLineIndex = parseInt(\n point.current.getAttribute('data-line-index') as string,\n 10\n );\n !acc.includes(currentLineIndex) &&\n acc.push(\n parseInt(point.current.getAttribute('data-line-index') as string, 10)\n );\n }\n return acc;\n };\n\n const buildLineIndexData = (point: React.MutableRefObject<Element>) => {\n const currentLineIndex = parseInt(\n point.current.getAttribute('data-line-index') as string,\n 10\n );\n const currentPointIndex = parseInt(\n point.current.getAttribute('data-point-index') as string,\n 10\n );\n const lineIndexes = pointRefArray.current.reduce(buildLineIndexes, []);\n\n const lowestLineIndex = lineIndexes[0];\n const highestLineIndex = lineIndexes[lineIndexes.length - 1];\n\n return {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n };\n };\n\n const findPointToFocus =\n (lineIndex: number, pointIndex: number) =>\n (point: React.MutableRefObject<Element>) =>\n point.current &&\n parseInt(point.current.getAttribute('data-line-index') as string, 10) ===\n lineIndex &&\n parseInt(point.current.getAttribute('data-point-index') as string, 10) ===\n pointIndex;\n\n // eslint-disable-next-line complexity\n function handleChartContainerKeyDown(event: React.KeyboardEvent) {\n const { key, shiftKey } = event;\n switch (key) {\n case 'Tab': {\n event.preventDefault();\n lastFocusedScatterPoint.current = (\n pointRefArray.current.find(\n point => point.current === document.activeElement\n ) as React.MutableRefObject<Element>\n ).current as SVGPathElement;\n shiftKey\n ? tabRef.current && tabRef.current.focus()\n : firstLegendButtonRef.current &&\n firstLegendButtonRef.current.focus();\n break;\n }\n case 'ArrowRight': {\n const focusedPointIndex = pointRefArray.current.findIndex(\n point => point.current === document.activeElement\n );\n\n if (focusedPointIndex !== undefined) {\n focusedPointIndex === pointRefArray.current.length - 1\n ? (pointRefArray.current[0]?.current as HTMLButtonElement)?.focus()\n : (\n pointRefArray.current[focusedPointIndex + 1]\n .current as HTMLButtonElement\n ).focus();\n }\n break;\n }\n case 'ArrowLeft': {\n const focusedPointIndex = pointRefArray.current.findIndex(\n point => point.current === document.activeElement\n );\n\n if (focusedPointIndex !== undefined) {\n focusedPointIndex === 0\n ? (\n pointRefArray.current[pointRefArray.current.length - 1]\n .current as HTMLButtonElement\n ).focus()\n : (\n pointRefArray.current[focusedPointIndex - 1]\n .current as HTMLButtonElement\n ).focus();\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const focusedPoint = pointRefArray.current.find(\n point => point.current === document.activeElement\n );\n\n if (focusedPoint && focusedPoint.current) {\n const {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n } = buildLineIndexData(focusedPoint);\n\n switch (currentLineIndex) {\n case lowestLineIndex: {\n (\n (\n pointRefArray.current.find(\n findPointToFocus(highestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n break;\n }\n default: {\n const nextLowestLineIndex =\n lineIndexes[lineIndexes.indexOf(currentLineIndex) - 1];\n (\n (\n pointRefArray.current.find(\n findPointToFocus(nextLowestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n }\n }\n }\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const focusedPoint = pointRefArray.current.find(\n point => point.current === document.activeElement\n );\n\n if (focusedPoint && focusedPoint.current) {\n const {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n } = buildLineIndexData(focusedPoint);\n\n switch (currentLineIndex) {\n case highestLineIndex: {\n (\n (\n pointRefArray.current.find(\n findPointToFocus(lowestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n break;\n }\n default: {\n const nextHighestLineIndex =\n lineIndexes[lineIndexes.indexOf(currentLineIndex) + 1];\n (\n (\n pointRefArray.current.find(\n findPointToFocus(nextHighestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n }\n }\n }\n break;\n }\n }\n }\n\n function handleFirstLegendButtonKeydown(event: React.KeyboardEvent) {\n const { key, shiftKey } = event;\n switch (key) {\n case 'Tab': {\n if (\n shiftKey &&\n lastFocusedScatterPoint &&\n lastFocusedScatterPoint.current &&\n pointRefArray.current.find(\n point => point.current === lastFocusedScatterPoint.current\n )\n ) {\n event.preventDefault();\n lastFocusedScatterPoint.current.focus();\n }\n break;\n }\n }\n }\n\n return (\n <LineChartContainer ref={containerRef}>\n <VictoryChartContainer onKeyDown={handleChartContainerKeyDown}>\n <VictoryChart\n domainPadding={32}\n height={400}\n padding={{ top: 0, left: 80, right: 0, bottom: 62 }}\n theme={magmaTheme}\n width={width}\n containerComponent={\n <VictoryVoronoiContainer\n name=\"xAxisGroupLabel\"\n voronoiBlacklist={scatterNames}\n voronoiDimension=\"x\"\n labels={\n hoveringOnXAxisLine && showXAxisLabel ? () => ` ` : undefined\n }\n labelComponent={\n showXAxisLabel ? (\n <VictoryTooltip\n flyoutComponent={\n <AxisTooltip\n dataLength={data.length}\n hiddenData={hiddenData}\n />\n }\n />\n ) : undefined\n }\n role=\"presentation\"\n voronoiPadding={32}\n />\n }\n {...chart}\n >\n <VictoryAxis {...yAxisOther} dependentAxis style={yAxisStyles} />\n {data.map(\n ({ data: dataset }, i) =>\n !hiddenData.includes(i) && (\n <VictoryLine\n style={{\n data: {\n opacity: setLineOpacity(i),\n stroke: theme.iterableColors[i],\n strokeWidth: '3',\n },\n parent: { border: theme.colors.neutral400 },\n }}\n key={`line${i}`}\n data={dataset as unknown as any[]}\n labelComponent={<></>}\n x={x as DataGetterPropType}\n y={y as DataGetterPropType}\n {...line}\n />\n )\n )}\n <VictoryAxis\n {...xAxisOther}\n style={xAxisStyles}\n gridComponent={\n <CustomAxisComponent\n events={{\n onMouseEnter: () => setHoveringOnXAxisLine(true),\n onMouseLeave: () => setHoveringOnXAxisLine(false),\n }}\n />\n }\n />\n {data.map(\n ({ data: dataset }, i) =>\n !hiddenData.includes(i) && (\n <VictoryScatter\n name={`scatter-${i}`}\n events={[\n {\n target: 'data',\n eventHandlers: {\n onBlur: () => {\n setShowXAxisLabel(true);\n setShowTooltip(null);\n return [\n {\n target: 'labels',\n mutation: () => ({ active: undefined }),\n },\n ];\n },\n onClick: () => {\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onFocus: () => {\n setShowXAxisLabel(false);\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onMouseEnter: () => {\n setShowXAxisLabel(false);\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onMouseLeave: () => {\n setShowTooltip(null);\n setShowXAxisLabel(true);\n },\n },\n },\n ]}\n style={{\n data: {\n fill: theme.colors.neutral100,\n opacity: setLineOpacity(i),\n stroke: theme.iterableColors[i],\n strokeWidth: 2,\n },\n }}\n size={5}\n data={\n dataset.map((datum, index) => ({\n index,\n lineIndex: i,\n ...datum,\n })) as unknown as any[]\n }\n dataComponent={\n <CustomScatterDataComponent\n lineIndex={i}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n unregisterPoint={unregisterPoint}\n />\n }\n labels={() => ''}\n labelComponent={\n <VictoryTooltip\n text=\"\"\n flyoutComponent={\n <GraphTooltip index={i} showTooltip={showTooltip} />\n }\n />\n }\n key={`scatter${i}`}\n x={x as DataGetterPropType}\n y={y as DataGetterPropType}\n {...scatter}\n />\n )\n )}\n </VictoryChart>\n </VictoryChartContainer>\n\n <DataLegendsContainer>\n <DataLegendsDescription theme={theme}>\n {i18n.charts.line.dataLegendsLabel}\n </DataLegendsDescription>\n {data.map(({ name }, i) => {\n const legendButtonAriaLabel =\n i18n.charts.line.legendButtonAriaLabel.replace(/\\{name\\}/g, name);\n\n return (\n <LegendButton\n aria-label={legendButtonAriaLabel}\n color={theme.iterableColors[i]}\n dataIndex={i}\n isHidden={hiddenData.includes(i)}\n key={i}\n name={name}\n onClick={handleLegendClick}\n onKeyDown={i === 0 ? handleFirstLegendButtonKeydown : undefined}\n focusCurrentLine={focusCurrentLine}\n ref={i === 0 ? firstLegendButtonRef : undefined}\n resetLineFocus={resetLineFocus}\n />\n );\n })}\n </DataLegendsContainer>\n </LineChartContainer>\n );\n}\n","import * as React from 'react';\nimport { VictoryAxisProps } from 'victory';\n\nimport { Card, Datagrid, Spinner } from 'react-magma-dom';\n\nexport function toCamelCase(str: string) {\n return str\n .toLowerCase()\n .replace(/[^a-z 0-9]/gi, '')\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (ltr, index) =>\n index === 0 ? ltr.toLowerCase() : ltr.toUpperCase()\n )\n .replace(/\\s+/g, '');\n}\n\nexport interface DataTableProps {\n data?: any[];\n xData: {\n keyValue?: string | number | symbol;\n label?: VictoryAxisProps['label'];\n tickFormat?: Partial<VictoryAxisProps['tickFormat']>;\n tickValues?: VictoryAxisProps['tickValues'];\n };\n yData: {\n keyValue?: string | number | symbol;\n tickFormat?: Partial<VictoryAxisProps['tickFormat']>;\n };\n}\n\nexport const ChartDataTable = (props: DataTableProps) => {\n const {\n data = [],\n xData: {\n keyValue: xKeyValue,\n label: xAxisLabel,\n tickFormat: xTickFormat,\n tickValues: xTickValues,\n },\n yData: { keyValue: yKeyValue, tickFormat: yTickFormat },\n } = props;\n const [dataForTable, setDataForTable] = React.useState({\n columns: [],\n rows: [],\n });\n\n React.useEffect(() => {\n setDataForTable(convertData());\n }, [data]);\n\n function convertData() {\n const xField = toCamelCase((xKeyValue || xAxisLabel || 'x') as string);\n const xTickValuesArray = data.reduce((valuesArray, { data: dataset }) => {\n dataset.forEach((datum: any) => {\n const value = datum.x || (xKeyValue && datum[xKeyValue]);\n !valuesArray.includes(value) && valuesArray.push(value);\n });\n\n return valuesArray;\n }, []);\n\n let baseTableData = {\n columns:\n xTickValuesArray.length > 0\n ? [\n {\n field: xField,\n header: xAxisLabel || xKeyValue || 'X',\n isRowHeader: true,\n },\n ]\n : [],\n rows: xTickValuesArray.reduce(\n (agg: any[], tick: number, index: number) => {\n const tickValue =\n xTickValues &&\n typeof tick === 'number' &&\n xTickValues.length === xTickValuesArray.length\n ? xTickFormat && typeof xTickFormat === 'function'\n ? xTickFormat(xTickValues[tick - 1])\n : xTickValues[tick - 1]\n : xTickFormat && Array.isArray(xTickFormat)\n ? xTickFormat[tick - 1]\n : xTickFormat && typeof xTickFormat === 'function'\n ? xTickFormat(tick)\n : tick;\n agg.push({\n [xField]: tickValue,\n id: index,\n });\n\n return agg;\n },\n []\n ),\n };\n\n return data.reduce((tableData, datum) => {\n const { name: header, data: dataset } = datum;\n const field = toCamelCase(header);\n\n tableData.columns.push({\n field,\n header,\n });\n\n dataset.forEach((d: any, i: number) => {\n const yValue =\n d.y || d.y === 0 ? d.y : undefined || (yKeyValue && d[yKeyValue]);\n tableData.rows[i] = {\n ...tableData.rows[i],\n id: baseTableData.rows.length > 0 ? i + 1 : i,\n [field]:\n yTickFormat && typeof yTickFormat === 'function'\n ? yTickFormat(yValue)\n : yValue,\n };\n });\n\n return tableData;\n }, baseTableData);\n }\n\n return (\n <Card>\n {dataForTable.rows.length > 0 ? (\n <Datagrid\n hasPagination={false}\n columns={dataForTable.columns}\n rows={dataForTable.rows}\n />\n ) : (\n <Spinner />\n )}\n </Card>\n );\n};\n","import * as React from 'react';\nimport {\n I18nContext,\n styled,\n ThemeContext,\n useDescendants,\n} from 'react-magma-dom';\nimport { css } from '@emotion/core';\nimport { KeyboardIcon } from 'react-magma-icons';\n\nimport { LineChart, LineChartProps } from './LineChart';\nimport { ChartDataTable } from './ChartDataTable';\nimport {\n Announce,\n ButtonVariant,\n Card,\n IconButton,\n Paragraph,\n TabsContainer,\n Tabs,\n Tab,\n TabPanelsContainer,\n TabPanel,\n Tooltip,\n TypographyVisualStyle,\n} from 'react-magma-dom';\n\ninterface BaseChartProps {\n /**\n * Description of what the line chart data represents placed above the chart\n */\n description?: string;\n /**\n * @internal\n */\n testId?: string;\n /**\n * Title of the line chart\n */\n title: string;\n /**\n * Type of chart - for now just 'line' is accepted\n */\n type: string;\n}\nexport interface ChartProps<T extends any>\n extends BaseChartProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>,\n LineChartProps<T> {}\n\nconst StyledTitle = styled.span`\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size04.fontSize};\n font-weight: 600;\n font-family: ${props => props.theme.bodyFont};\n line-height: ${props => props.theme.typeScale.size04.lineHeight};\n margin: 0 0 12px 0;\n`;\n\nconst StyledParagraph = styled(Paragraph)`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n margin: 0 0 18px 0;\n`;\n\nconst StyledTabsContainer = styled(TabsContainer)`\n width: 800px;\n ul {\n box-shadow: inset 0 -1px 0 ${props => props.theme.colors.neutral300};\n }\n`;\n\nconst StyledTabPanel = styled(TabPanel)`\n padding: 22px 0;\n`;\n\nconst KeyboardInstructionsCard = styled(Card)<{\n isOpen?: boolean;\n maxHeight?: string;\n width?: string;\n}>`\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);\n display: ${props => (props.isOpen ? 'block' : 'none')};\n right: ${props => props.theme.spaceScale.spacing02};\n max-height: ${props =>\n props.maxHeight ? props.maxHeight : props.theme.dropdown.content.maxHeight};\n opacity: ${props => (props.isOpen ? '1' : '0')};\n outline: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing05};\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ${props =>\n props.width &&\n css`\n white-space: normal;\n width: ${props.width};\n `}\n`;\n\nfunction BaseChart<T>(props: ChartProps<T>, ref: React.Ref<HTMLDivElement>) {\n const { description, title, testId, type, ...other } = props;\n const keyboardInstructionsRef = React.useRef<HTMLButtonElement>(null);\n const lastFocusedScatterPoint = React.useRef<SVGPathElement>(null);\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const [pointRefArray, registerPoint, unregisterPoint] = useDescendants();\n\n const [isKeyboardInstructionsOpen, setIsKeyboardInstructionsOpen] =\n React.useState<boolean>(false);\n\n function handleKeyboardInstructionsButtonBlur() {\n setIsKeyboardInstructionsOpen(false);\n }\n\n function handleKeyboardInstructionsButtonClick() {\n setIsKeyboardInstructionsOpen(prevOpen => !prevOpen);\n }\n\n function handleKeyboardInstructionsButtonKeydown(event: { preventDefault?: any; key?: any; shiftKey?: any; }) {\n const { key, shiftKey } = event;\n\n switch (key) {\n case 'Escape': {\n setIsKeyboardInstructionsOpen(false);\n break;\n }\n case 'Tab': {\n if (\n !shiftKey &&\n lastFocusedScatterPoint &&\n lastFocusedScatterPoint.current &&\n pointRefArray.current.find(\n point => point.current === lastFocusedScatterPoint.current\n )\n ) {\n event.preventDefault();\n lastFocusedScatterPoint.current.focus();\n }\n break;\n }\n }\n }\n\n return (\n <div ref={ref}>\n <StyledTitle theme={theme}>{title}</StyledTitle>\n {description && (\n <StyledParagraph\n theme={theme}\n visualStyle={TypographyVisualStyle.bodySmall}\n >\n {description}\n </StyledParagraph>\n )}\n <StyledTabsContainer theme={theme}>\n <Tabs>\n <Tab>{i18n.charts.line.chartTabLabel}</Tab>\n <Tab>{i18n.charts.line.dataTabLabel}</Tab>\n <div\n onBlur={handleKeyboardInstructionsButtonBlur}\n style={{\n display: 'inline-block',\n marginLeft: 'auto',\n }}\n >\n <Tooltip\n content={i18n.charts.line.keyboardInstructionsTooltip}\n ref={keyboardInstructionsRef}\n >\n <IconButton\n aria-controls=\"keyboardInstructions\"\n aria-label={i18n.charts.line.keyboardInstructionsTooltip}\n aria-expanded={Boolean(isKeyboardInstructionsOpen)}\n icon={<KeyboardIcon />}\n onClick={handleKeyboardInstructionsButtonClick}\n onKeyDown={handleKeyboardInstructionsButtonKeydown}\n variant={ButtonVariant.link}\n />\n </Tooltip>\n <Announce>\n <KeyboardInstructionsCard\n id=\"keyboardInstructions\"\n isOpen={isKeyboardInstructionsOpen}\n theme={theme}\n width=\"350px\"\n >\n <Paragraph\n visualStyle={TypographyVisualStyle.headingXSmall}\n style={{ margin: '0 0 16px' }}\n >\n {i18n.charts.line.keyboardInstructionsHeader}\n </Paragraph>\n {i18n.charts.line.keyboardInstructions}\n </KeyboardInstructionsCard>\n </Announce>\n </div>\n </Tabs>\n <TabPanelsContainer>\n <StyledTabPanel theme={theme}>\n {type === 'line' && (\n <LineChart<T>\n {...other}\n lastFocusedScatterPoint={lastFocusedScatterPoint}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n tabRef={keyboardInstructionsRef}\n unregisterPoint={unregisterPoint}\n />\n )}\n </StyledTabPanel>\n <StyledTabPanel theme={theme}>\n <ChartDataTable\n data={other.data}\n xData={{\n keyValue: other.x,\n label: other.componentProps?.xAxis?.label,\n tickFormat: other.componentProps?.xAxis?.tickFormat,\n }}\n yData={{\n keyValue: other.y,\n tickFormat: other.componentProps?.yAxis?.tickFormat,\n }}\n />\n </StyledTabPanel>\n </TabPanelsContainer>\n </StyledTabsContainer>\n </div>\n );\n}\n\nexport const Chart = React.forwardRef(BaseChart) as <T>(\n props: ChartProps<T> & { ref?: React.MutableRefObject<HTMLDivElement> }\n) => ReturnType<typeof BaseChart>;\n"],"names":["width","height","padding","fontFamily","fontSize","letterSpacing","fill","stroke","strokeWidth","textAnchor","baseLabelStyles","area","style","data","labels","baseProps","axis","strokeLinecap","strokeLinejoin","axisLabel","centeredLabelStyles","grid","pointerEvents","ticks","size","tickLabels","polarDependentAxis","bar","boxplot","max","maxLabels","median","medianLabels","min","minLabels","q1","q1Labels","q3","q3Labels","boxWidth","candlestick","candleColors","positive","negative","chart","errorbar","borderWidth","opacity","group","colorScale","colors","histogram","legend","gutter","orientation","titleOrientation","type","title","line","pie","scatter","stack","tooltip","flyoutStyle","flyoutPadding","cornerRadius","pointerLength","voronoi","flyout","styled","StyledTooltip","props","theme","neutral100","neutral300","neutral","typeScale","size02","lineHeight","span","color","datum","index","showTooltip","x","y","React","useContext","ThemeContext","_jsx","_jsxs","StyledGraphTooltip","position","TooltipPosition","top","role","TooltipColorSwatch","iterableColors","label","TooltipArrow","activePoints","hiddenData","dataLength","Array","from","_","i","filter","includes","map","point","pointsIndexes","pointIndex","lineIndex","pointRefArray","registerPoint","unregisterPoint","other","Point","ariaLabel","pathComponent","CustomPointComponent","tabIndex","useForceUpdate","useRef","useEffect","ref","forceUpdate","_ref","events","LineSegment","strokeOpacity","forwardRef","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus","display","onMouseEnter","handleOnMouseEnterOrFocus","onMouseLeave","Checkbox","checked","containerStyle","alignItems","border","boxShadow","margin","inputStyle","neutral800","borderRadius","labelText","onBlur","onFocus","div","p","componentProps","xAxis","xAxisLabel","xTickLabels","yAxis","yAxisLabel","yTickLabels","lastFocusedScatterPoint","tabRef","xRest","xAxisOther","yRest","yAxisOther","I18nContext","setHiddenData","useState","setWidth","focusedLine","setFocusedLine","setShowTooltip","showXAxisLabel","setShowXAxisLabel","hoveringOnXAxisLine","setHoveringOnXAxisLine","updateWidth","window","addEventListener","handleEsc","removeEventListener","handleMouseMove","fontWeight","containerRef","current","clientWidth","event","key","item","concat","acc","parseInt","getAttribute","currentLineIndex","push","reduce","buildLineIndexes","currentPointIndex","lineIndexes","lowestLineIndex","highestLineIndex","length","shiftKey","find","preventDefault","focus","LineChartContainer","VictoryChartContainer","onKeyDown","document","activeElement","firstLegendButtonRef","findIndex","undefined","focusedPointIndex","_pointRefArray$curren","_pointRefArray$curren2","focusedPoint","buildLineIndexData","findPointToFocus","indexOf","nextLowestLineIndex","nextHighestLineIndex","VictoryChart","domainPadding","left","right","bottom","magmaTheme","containerComponent","VictoryVoronoiContainer","voronoiBlacklist","scatterNames","voronoiDimension","labelComponent","VictoryTooltip","flyoutComponent","AxisTooltip","voronoiPadding","VictoryAxis","dependentAxis","yAxisStyles","dataset","VictoryLine","setLineOpacity","parent","neutral400","xAxisStyles","gridComponent","CustomAxisComponent","VictoryScatter","target","eventHandlers","mutation","active","dataComponent","CustomScatterDataComponent","text","GraphTooltip","DataLegendsContainer","DataLegendsDescription","i18n","charts","dataLegendsLabel","legendButtonAriaLabel","replace","LegendButton","handleLegendClick","handleFirstLegendButtonKeydown","str","toLowerCase","ltr","toUpperCase","xData","keyValue","xKeyValue","tickFormat","xTickFormat","tickValues","xTickValues","yData","yKeyValue","yTickFormat","dataForTable","setDataForTable","columns","rows","toCamelCase","valuesArray","forEach","value","xTickValuesArray","field","xField","header","isRowHeader","agg","tick","isArray","tickValue","id","tableData","d","baseTableData","yValue","convertData","Card","Datagrid","hasPagination","Spinner","size04","bodyFont","Paragraph","TabsContainer","TabPanel","isOpen","spaceScale","spacing02","maxHeight","dropdown","content","spacing05","css","description","useDescendants","isKeyboardInstructionsOpen","setIsKeyboardInstructionsOpen","StyledTitle","StyledParagraph","visualStyle","TypographyVisualStyle","bodySmall","StyledTabsContainer","Tabs","Tab","chartTabLabel","dataTabLabel","marginLeft","Tooltip","keyboardInstructionsTooltip","keyboardInstructionsRef","IconButton","Boolean","icon","KeyboardIcon","prevOpen","variant","ButtonVariant","link","Announce","KeyboardInstructionsCard","headingXSmall","keyboardInstructionsHeader","keyboardInstructions","TabPanelsContainer","StyledTabPanel","LineChart","ChartDataTable","_other$componentProps","_other$componentProps2","_other$componentProps3","_other$componentProps4","_other$componentProps5","_other$componentProps6","Chart","BaseChart"],"mappings":"gkCAmBA,QAAe,CACb,UACA,UACA,UACA,UACA,UACA,aAmBgB,CAChBA,MAAO,IACPC,OAAQ,IACRC,QAAS,MAMa,CACtBC,WAlBgB,mCAmBhBC,SAjBe,GAkBfC,cAnBoB,SAoBpBH,QAdc,EAedI,KA5BkB,UA6BlBC,OAAQ,cACRC,YAAa,QAGeC,WAAY,UAAaC,KAQxB,CAC7BC,QACEC,MAAO,CACLC,KAAM,CACJP,KA5CQ,QA8CVQ,OAAQJ,IAEPK,GAELC,QACEJ,MAAO,CACLI,KAAM,CACJV,KAAM,cACNC,OAxDY,UAyDZC,YAAa,EACbS,cAnBc,QAoBdC,eAnBe,SAqBjBC,eACKC,GACHlB,QAjDQ,EAkDRK,OAAQ,gBAEVc,KAAM,CACJf,KAAM,OACNC,OAAQ,UAERU,cA/Bc,QAgCdC,eA/Be,QAgCfI,cAAe,WAEjBC,MAAO,CACLjB,KAAM,cACNkB,KAAM,EACNjB,OA7EY,UA8EZC,YAAa,EACbS,cAxCc,QAyCdC,eAxCe,SA0CjBO,gBACKf,G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yC,0BAAN8M,EAAsB7M,cAAtB8M,EAA6B3Q,MACpCwL,oBAAYrK,EAAMyC,0BAANgN,EAAsB/M,cAAtBgN,EAA6BrF,YAE3CI,MAAO,CACLN,SAAUnK,EAAMhC,EAChBqM,oBAAYrK,EAAMyC,0BAANkN,EAAsB9M,cAAtB+M,EAA6BvF,wBAQzD,CAEawF,SAAQ5R,EAAM8C,WAAW+O"}
1
+ {"version":3,"file":"charts.modern.js","sources":["../src/components/LineChart/magma-charts.ts","../src/components/LineChart/GraphTooltip.tsx","../src/components/LineChart/CustomPointComponent.tsx","../src/components/LineChart/CustomAxisComponent.tsx","../src/components/LineChart/LegendButton.tsx","../src/components/LineChart/LineChart.tsx","../src/components/LineChart/ChartDataTable.tsx","../src/components/LineChart/Chart.tsx"],"sourcesContent":["// *\n// * Colors\n// *\n// const yellow200 = '#FFF59D';\n// const deepOrange600 = '#F4511E';\n// const lime300 = '#DCE775';\n// const lightGreen500 = '#8BC34A';\n// const teal700 = '#00796B';\n// const cyan900 = '#006064';\n\n// const colors = [\n// '#0085CC',\n// '#E0004D',\n// '#FA6600',\n// '#48A200',\n// '#B12FAD',\n// '#00A393',\n// ];\n\nconst colors = [\n '#00507A',\n '#8F0033',\n '#B84900',\n '#255200',\n '#711E6E',\n '#005249',\n];\n\nconst blueGrey50 = '#DFDFDF';\nconst blueGrey300 = '#8F8F8F';\nconst blueGrey700 = '#3F3F3F';\nconst grey900 = 'pink';\n\n// *\n// * Typography\n// *\nconst sansSerif = '\"Work Sans\",Helvetica,sans-serif';\nconst letterSpacing = 'normal';\nconst fontSize = 12;\n\n// *\n// * Layout\n// *\nconst padding = 8;\nconst baseProps = {\n width: 350,\n height: 350,\n padding: 50,\n};\n\n// *\n// * Labels\n// *\nconst baseLabelStyles = {\n fontFamily: sansSerif,\n fontSize,\n letterSpacing,\n padding,\n fill: blueGrey700,\n stroke: 'transparent',\n strokeWidth: 0,\n};\n\nconst centeredLabelStyles = { textAnchor: 'middle', ...baseLabelStyles };\n// *\n// * Strokes\n// *\n// const strokeDasharray = '10, 5';\nconst strokeLinecap = 'round';\nconst strokeLinejoin = 'round';\n\nexport const magmaTheme: any = {\n area: {\n style: {\n data: {\n fill: grey900,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n axis: {\n style: {\n axis: {\n fill: 'transparent',\n stroke: blueGrey300,\n strokeWidth: 1,\n strokeLinecap,\n strokeLinejoin,\n },\n axisLabel: {\n ...centeredLabelStyles,\n padding,\n stroke: 'transparent',\n },\n grid: {\n fill: 'none',\n stroke: '#dfdfdf',\n //strokeDasharray,\n strokeLinecap,\n strokeLinejoin,\n pointerEvents: 'painted',\n },\n ticks: {\n fill: 'transparent',\n size: 0,\n stroke: blueGrey300,\n strokeWidth: 0,\n strokeLinecap,\n strokeLinejoin,\n },\n tickLabels: {\n ...baseLabelStyles,\n fill: blueGrey700,\n },\n },\n ...baseProps,\n },\n polarDependentAxis: {\n style: {\n ticks: {\n fill: 'transparent',\n size: 1,\n stroke: 'transparent',\n },\n },\n },\n bar: {\n style: {\n data: {\n fill: blueGrey700,\n padding,\n strokeWidth: 0,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n boxplot: {\n style: {\n max: { padding, stroke: blueGrey700, strokeWidth: 1 },\n maxLabels: { ...baseLabelStyles, padding: 3 },\n median: { padding, stroke: blueGrey700, strokeWidth: 1 },\n medianLabels: { ...baseLabelStyles, padding: 3 },\n min: { padding, stroke: blueGrey700, strokeWidth: 1 },\n minLabels: { ...baseLabelStyles, padding: 3 },\n q1: { padding, fill: blueGrey700 },\n q1Labels: { ...baseLabelStyles, padding: 3 },\n q3: { padding, fill: blueGrey700 },\n q3Labels: { ...baseLabelStyles, padding: 3 },\n },\n boxWidth: 20,\n ...baseProps,\n },\n candlestick: {\n style: {\n data: {\n stroke: blueGrey700,\n },\n labels: { ...baseLabelStyles, padding: 5 },\n },\n candleColors: {\n positive: '#ffffff',\n negative: blueGrey700,\n },\n ...baseProps,\n },\n chart: baseProps,\n errorbar: {\n borderWidth: 8,\n style: {\n data: {\n fill: 'transparent',\n opacity: 1,\n stroke: blueGrey700,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n group: {\n colorScale: colors,\n ...baseProps,\n },\n histogram: {\n style: {\n data: {\n fill: blueGrey700,\n stroke: grey900,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n legend: {\n colorScale: colors,\n gutter: 10,\n orientation: 'vertical',\n titleOrientation: 'top',\n style: {\n data: {\n type: 'circle',\n },\n labels: baseLabelStyles,\n title: { ...baseLabelStyles, padding: 5 },\n },\n },\n line: {\n style: {\n data: {\n fill: 'transparent',\n opacity: 1,\n stroke: blueGrey700,\n strokeWidth: 2,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n pie: {\n colorScale: colors,\n style: {\n data: {\n padding,\n stroke: blueGrey50,\n strokeWidth: 1,\n },\n labels: { ...baseLabelStyles, padding: 20 },\n },\n ...baseProps,\n },\n scatter: {\n style: {\n data: {\n fill: blueGrey700,\n opacity: 1,\n stroke: 'transparent',\n strokeWidth: 0,\n },\n labels: baseLabelStyles,\n },\n ...baseProps,\n },\n stack: {\n colorScale: colors,\n ...baseProps,\n },\n tooltip: {\n style: { ...baseLabelStyles, padding: 0, pointerEvents: 'none' },\n flyoutStyle: {\n stroke: grey900,\n strokeWidth: 1,\n fill: '#f0f0f0',\n pointerEvents: 'none',\n },\n flyoutPadding: 5,\n cornerRadius: 5,\n pointerLength: 10,\n },\n voronoi: {\n style: {\n data: {\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n },\n labels: { ...baseLabelStyles, padding: 5, pointerEvents: 'none' },\n flyout: {\n stroke: grey900,\n strokeWidth: 1,\n fill: '#f0f0f0',\n pointerEvents: 'none',\n },\n },\n ...baseProps,\n },\n};\n","import * as React from 'react';\nimport {\n StyledTooltip,\n ThemeContext,\n TooltipArrow,\n TooltipPosition,\n ThemeInterface,\n} from 'react-magma-dom';\n\nimport styled, { CreateStyled } from '@emotion/styled';\n\nconst typedStyled = styled as CreateStyled<ThemeInterface>;\n\nconst StyledGraphTooltip = typedStyled(StyledTooltip)`\n background: ${(props: any) => props.theme.colors.neutral100};\n border: 1px solid ${(props: any) => props.theme.colors.neutral300};\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);\n box-sizing: border-box;\n color: ${(props: any) => props.theme.colors.neutral};\n font-size: ${(props: any) => props.theme.typeScale.size02.fontSize};\n font-weight: normal;\n line-height: ${(props: any) => props.theme.typeScale.size02.lineHeight};\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`;\n\nconst TooltipColorSwatch = typedStyled.span`\n background: ${(props: any) => props.color};\n border: ${(props: any) => (props.color ? 'none' : '3px solid black')};\n border-radius: 4px;\n height: 20px;\n width: 20px;\n margin-right: 8px;\n`;\n\nexport const GraphTooltip = (props: any) => {\n const { datum, index, showTooltip, x, y } = props;\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n const linePointIndex = `${index}-${datum.index}`;\n\n return showTooltip === linePointIndex ? (\n <g style={{ pointerEvents: 'none' }}>\n <foreignObject x={x} y={y} width=\"275\" height=\"100%\">\n <StyledGraphTooltip\n position={TooltipPosition.top}\n role=\"tooltip\"\n theme={theme}\n >\n <div>\n <TooltipColorSwatch color={theme.iterableColors[index]} />\n <span>{datum.label}</span>\n </div>\n <TooltipArrow theme={theme} />\n </StyledGraphTooltip>\n </foreignObject>\n </g>\n ) : null;\n};\n\nexport const AxisTooltip = (props: any) => {\n const { x, y, activePoints, hiddenData, dataLength } = props;\n\n const pointsIndexes = Array.from(\n Array(dataLength - 0),\n (_, i) => i + 0\n ).filter(i => !hiddenData.includes(i));\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n\n return (\n <g style={{ pointerEvents: 'none' }}>\n <foreignObject x={x} y={y} width=\"275\" height=\"100%\">\n <StyledGraphTooltip\n data-testid=\"axis-tooltip\"\n position={TooltipPosition.top}\n role=\"tooltip\"\n theme={theme}\n >\n {activePoints.map((point: any, i: number) => (\n <div key={i}>\n <TooltipColorSwatch\n color={theme.iterableColors[pointsIndexes[i]]}\n />\n <span>{point.label}</span>\n </div>\n ))}\n <TooltipArrow theme={theme} />\n </StyledGraphTooltip>\n </foreignObject>\n </g>\n );\n};\n","import * as React from 'react';\nimport { Point, PointProps } from 'victory';\nimport { useForceUpdate } from 'react-magma-dom';\n\nexport interface CustomScatterDataComponentInterface extends PointProps {\n lineIndex: number;\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport interface CustomPointComponentInterface {\n lineIndex: number;\n pointIndex: PointProps['index'];\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n}\n\nexport const CustomScatterDataComponent = (\n props: CustomScatterDataComponentInterface\n) => {\n const {\n datum,\n index: pointIndex,\n lineIndex,\n pointRefArray,\n registerPoint,\n unregisterPoint,\n ...other\n } = props;\n return (\n <Point\n {...other}\n ariaLabel={datum.label}\n pathComponent={\n <CustomPointComponent\n lineIndex={lineIndex}\n pointIndex={pointIndex}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n unregisterPoint={unregisterPoint}\n />\n }\n role=\"button\"\n tabIndex={0}\n />\n );\n};\n\nexport const CustomPointComponent = (props: CustomPointComponentInterface) => {\n const {\n lineIndex,\n pointRefArray,\n pointIndex,\n registerPoint,\n unregisterPoint,\n ...other\n } = props;\n const forceUpdate = useForceUpdate();\n const ref = React.useRef<SVGPathElement | null>(null);\n\n React.useEffect(() => {\n registerPoint(pointRefArray, ref as React.MutableRefObject<Element>);\n\n forceUpdate();\n\n return () =>\n unregisterPoint(pointRefArray, ref as React.MutableRefObject<Element>);\n }, []);\n\n return (\n <path\n ref={ref}\n data-line-index={lineIndex}\n data-point-index={pointIndex}\n {...other}\n />\n );\n};\n","import * as React from 'react';\nimport { LineSegment, LineSegmentProps } from 'victory';\n\nexport const CustomAxisComponent: React.FunctionComponent<LineSegmentProps> = ({\n events,\n ...props\n}: any) => {\n return (\n <g>\n <LineSegment\n {...props}\n events={events}\n style={{\n strokeWidth: '50px',\n stroke: 'transparent',\n }}\n />\n <LineSegment\n {...props}\n events={events}\n style={{\n strokeWidth: '1px',\n stroke: 'black',\n strokeOpacity: '0.2',\n }}\n />\n </g>\n );\n};\n","import * as React from 'react';\nimport { ThemeContext, Checkbox } from 'react-magma-dom';\n\nexport interface DataTableProps {\n name?: string;\n color?: string;\n}\n\nexport const LegendButton = React.forwardRef<HTMLButtonElement, any>(\n (props, ref) => {\n const {\n children,\n color,\n dataIndex,\n isHidden,\n onClick,\n name,\n focusCurrentLine,\n resetLineFocus,\n ...other\n } = props;\n\n function handleClick() {\n onClick && typeof onClick === 'function' && onClick(dataIndex);\n\n if (!isHidden) {\n resetLineFocus &&\n typeof resetLineFocus === 'function' &&\n resetLineFocus();\n }\n }\n\n function handleOnMouseEnterOrFocus() {\n if (!isHidden) {\n focusCurrentLine &&\n typeof focusCurrentLine === 'function' &&\n focusCurrentLine(dataIndex);\n }\n }\n\n const theme = React.useContext(ThemeContext);\n\n return (\n <div\n style={{ display: 'inline-flex' }}\n onMouseEnter={handleOnMouseEnterOrFocus}\n onMouseLeave={resetLineFocus}\n >\n <Checkbox\n checked={!isHidden}\n color={color}\n containerStyle={{\n alignItems: 'center',\n border: '0',\n boxShadow: '0 0 0',\n color: theme.colors.neutral,\n display: 'inline-flex',\n margin: '0 36px 20px 0',\n padding: '0',\n }}\n inputStyle={{\n border: color ? `none` : `2px solid ${theme.colors.neutral800}`,\n borderRadius: '4px',\n }}\n labelText={name}\n onBlur={resetLineFocus}\n onClick={handleClick}\n onFocus={handleOnMouseEnterOrFocus}\n ref={ref}\n theme={theme}\n {...other}\n />\n </div>\n );\n }\n);\n","import * as React from 'react';\nimport {\n VictoryAxis,\n VictoryAxisProps,\n VictoryChart,\n VictoryChartProps,\n VictoryLine,\n VictoryLineProps,\n VictoryScatter,\n VictoryScatterProps,\n VictoryTooltip,\n VictoryVoronoiContainer,\n} from 'victory';\n\nimport {\n I18nContext,\n ThemeContext,\n ThemeInterface,\n I18nInterface,\n} from 'react-magma-dom';\n\nimport { magmaTheme } from './magma-charts';\nimport { AxisTooltip, GraphTooltip } from './GraphTooltip';\nimport { CustomScatterDataComponent } from './CustomPointComponent';\nimport { CustomAxisComponent } from './CustomAxisComponent';\nimport { LegendButton } from './LegendButton';\n\nimport styled, { CreateStyled } from '@emotion/styled';\nconst typedStyled = styled as CreateStyled<ThemeInterface>;\n\nexport type LineChartAxisStyle = VictoryAxisProps['style'];\nexport type DataGetterPropType = VictoryLineProps['x'];\n\nexport type ChartDataOptions =\n | {\n label: string;\n x: string | number;\n y: string | number;\n [key: string]: any;\n }\n | { label: string; [key: string]: any }\n | any;\n\nexport interface LineChartData<T> {\n name: string;\n data: T[];\n}\n\nexport interface LineChartComponentProps {\n chart?: VictoryChartProps;\n line?: VictoryLineProps;\n scatter?: VictoryScatterProps;\n xAxis?: VictoryAxisProps;\n yAxis?: VictoryAxisProps;\n}\n\n// NOTE: These props are manually copied to line-chart.mdx\nexport interface LineChartProps<T extends ChartDataOptions> {\n /**\n * Props passed to each component that makes up the line chart. See `victory` for accepted props.\n */\n componentProps?: LineChartComponentProps;\n /**\n * Data used to build the chart\n */\n data?: LineChartData<T>[];\n isMulti?: boolean;\n /**\n * @internal\n */\n lastFocusedScatterPoint: React.MutableRefObject<SVGPathElement | null>;\n /**\n * @internal\n */\n pointRefArray: React.MutableRefObject<React.MutableRefObject<Element>[]>;\n /**\n * @internal\n */\n registerPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n /**\n * @internal\n */\n tabRef: React.MutableRefObject<HTMLButtonElement | null>;\n /**\n * @internal\n */\n unregisterPoint: (\n refArray: React.MutableRefObject<React.MutableRefObject<Element>[]>,\n ref: React.MutableRefObject<Element>\n ) => void;\n /**\n * Value of x key in chart data\n */\n x?: keyof T;\n /**\n * Value of y key in chart data\n */\n y?: keyof T;\n}\n\nconst LineChartContainer = typedStyled.div`\n max-height: 600px;\n max-width: 800px;\n svg {\n overflow: visible;\n }\n`;\n\nconst VictoryChartContainer = typedStyled.div``;\n\nconst DataLegendsContainer = typedStyled.div`\n padding-bottom: 24px;\n`;\n\nconst DataLegendsDescription = typedStyled.p`\n color: ${(props: any) => props.theme.colors.neutral};\n font-size: ${(props: any) => props.theme.typeScale.size02.fontSize};\n`;\n\nexport function LineChart<T>(props: LineChartProps<T>) {\n const {\n componentProps: {\n chart = {},\n line = {},\n scatter = {},\n xAxis: {\n style: {\n axisLabel: xAxisLabel = undefined,\n tickLabels: xTickLabels = undefined,\n ...xRest\n } = {},\n ...xAxisOther\n } = { style: {} },\n yAxis: {\n style: {\n axisLabel: yAxisLabel = undefined,\n tickLabels: yTickLabels = undefined,\n ...yRest\n } = {},\n ...yAxisOther\n } = { style: {} },\n } = {},\n data = [],\n lastFocusedScatterPoint,\n pointRefArray,\n registerPoint,\n unregisterPoint,\n tabRef,\n x,\n y,\n } = props;\n\n const theme: ThemeInterface = React.useContext(ThemeContext);\n const i18n: I18nInterface = React.useContext(I18nContext);\n\n const [hiddenData, setHiddenData] = React.useState<number[]>([]);\n const [width, setWidth] = React.useState<number>(800);\n const [focusedLine, setFocusedLine] = React.useState<number | null>(null);\n const [showTooltip, setShowTooltip] = React.useState<string | null>(null);\n const [showXAxisLabel, setShowXAxisLabel] = React.useState<boolean>(true);\n const [hoveringOnXAxisLine, setHoveringOnXAxisLine] =\n React.useState<boolean>(false);\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const firstLegendButtonRef = React.useRef<HTMLButtonElement>(null);\n\n React.useEffect(() => {\n updateWidth();\n\n window.addEventListener('resize', updateWidth);\n window.addEventListener('keydown', handleEsc);\n\n return () => {\n window.removeEventListener('resize', updateWidth);\n window.removeEventListener('keydown', handleEsc);\n };\n }, []);\n\n React.useEffect(() => {\n window.addEventListener('mousemove', handleMouseMove);\n\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }, [showTooltip]);\n\n const scatterNames: string[] = data.map((_, i) => `scatter-${i}`);\n\n const xAxisStyles = {\n tickLabels: {\n color: '#3f3f3f',\n fontSize: 12,\n ...xTickLabels,\n },\n axisLabel: {\n color: '#3f3f3f',\n padding: 44,\n fontSize: 14,\n fontWeight: 'bold',\n ...xAxisLabel,\n },\n ...xRest,\n };\n\n const yAxisStyles = {\n tickLabels: {\n fontSize: 12,\n ...yTickLabels,\n },\n axisLabel: {\n color: '#3f3f3f',\n padding: 64,\n fontSize: 14,\n fontWeight: 'bold',\n ...yAxisLabel,\n },\n ...yRest,\n };\n\n function updateWidth() {\n containerRef.current && setWidth(containerRef.current.clientWidth);\n }\n\n function handleEsc(event: KeyboardEvent): any {\n if (event.key === 'Escape') {\n setShowTooltip(null);\n setShowXAxisLabel(false);\n }\n }\n\n function handleMouseMove() {\n !showTooltip && setShowXAxisLabel(true);\n }\n\n function setLineOpacity(index: number) {\n return focusedLine === null ? 1 : focusedLine === index ? 1 : 0.1;\n }\n\n function handleLegendClick(dataIndex: number) {\n if (hiddenData.includes(dataIndex)) {\n setHiddenData(hiddenData.filter(item => item !== dataIndex));\n } else {\n setHiddenData(hiddenData.concat([dataIndex]));\n }\n }\n\n function focusCurrentLine(dataIndex: number) {\n setFocusedLine(dataIndex);\n }\n\n function resetLineFocus() {\n setFocusedLine(null);\n }\n\n const buildLineIndexes = (\n acc: number[],\n point: React.MutableRefObject<Element>\n ) => {\n if (point.current) {\n const currentLineIndex = parseInt(\n point.current.getAttribute('data-line-index') as string,\n 10\n );\n !acc.includes(currentLineIndex) &&\n acc.push(\n parseInt(point.current.getAttribute('data-line-index') as string, 10)\n );\n }\n return acc;\n };\n\n const buildLineIndexData = (point: React.MutableRefObject<Element>) => {\n const currentLineIndex = parseInt(\n point.current.getAttribute('data-line-index') as string,\n 10\n );\n const currentPointIndex = parseInt(\n point.current.getAttribute('data-point-index') as string,\n 10\n );\n const lineIndexes = pointRefArray.current.reduce(buildLineIndexes, []);\n\n const lowestLineIndex = lineIndexes[0];\n const highestLineIndex = lineIndexes[lineIndexes.length - 1];\n\n return {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n };\n };\n\n const findPointToFocus =\n (lineIndex: number, pointIndex: number) =>\n (point: React.MutableRefObject<Element>) =>\n point.current &&\n parseInt(point.current.getAttribute('data-line-index') as string, 10) ===\n lineIndex &&\n parseInt(point.current.getAttribute('data-point-index') as string, 10) ===\n pointIndex;\n\n // eslint-disable-next-line complexity\n function handleChartContainerKeyDown(event: React.KeyboardEvent) {\n const { key, shiftKey } = event;\n switch (key) {\n case 'Tab': {\n event.preventDefault();\n lastFocusedScatterPoint.current = (\n pointRefArray.current.find(\n point => point.current === document.activeElement\n ) as React.MutableRefObject<Element>\n ).current as SVGPathElement;\n shiftKey\n ? tabRef.current && tabRef.current.focus()\n : firstLegendButtonRef.current &&\n firstLegendButtonRef.current.focus();\n break;\n }\n case 'ArrowRight': {\n const focusedPointIndex = pointRefArray.current.findIndex(\n point => point.current === document.activeElement\n );\n\n if (focusedPointIndex !== undefined) {\n focusedPointIndex === pointRefArray.current.length - 1\n ? (pointRefArray.current[0].current as HTMLButtonElement).focus()\n : (\n pointRefArray.current[focusedPointIndex + 1]\n .current as HTMLButtonElement\n ).focus();\n }\n break;\n }\n case 'ArrowLeft': {\n const focusedPointIndex = pointRefArray.current.findIndex(\n point => point.current === document.activeElement\n );\n\n if (focusedPointIndex !== undefined) {\n focusedPointIndex === 0\n ? (\n pointRefArray.current[pointRefArray.current.length - 1]\n .current as HTMLButtonElement\n ).focus()\n : (\n pointRefArray.current[focusedPointIndex - 1]\n .current as HTMLButtonElement\n ).focus();\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n const focusedPoint = pointRefArray.current.find(\n point => point.current === document.activeElement\n );\n\n if (focusedPoint && focusedPoint.current) {\n const {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n } = buildLineIndexData(focusedPoint);\n\n switch (currentLineIndex) {\n case lowestLineIndex: {\n (\n (\n pointRefArray.current.find(\n findPointToFocus(highestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n break;\n }\n default: {\n const nextLowestLineIndex =\n lineIndexes[lineIndexes.indexOf(currentLineIndex) - 1];\n (\n (\n pointRefArray.current.find(\n findPointToFocus(nextLowestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n }\n }\n }\n break;\n }\n case 'ArrowDown': {\n event.preventDefault();\n const focusedPoint = pointRefArray.current.find(\n point => point.current === document.activeElement\n );\n\n if (focusedPoint && focusedPoint.current) {\n const {\n currentLineIndex,\n currentPointIndex,\n lineIndexes,\n lowestLineIndex,\n highestLineIndex,\n } = buildLineIndexData(focusedPoint);\n\n switch (currentLineIndex) {\n case highestLineIndex: {\n (\n (\n pointRefArray.current.find(\n findPointToFocus(lowestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n break;\n }\n default: {\n const nextHighestLineIndex =\n lineIndexes[lineIndexes.indexOf(currentLineIndex) + 1];\n (\n (\n pointRefArray.current.find(\n findPointToFocus(nextHighestLineIndex, currentPointIndex)\n ) as React.MutableRefObject<Element>\n ).current as HTMLButtonElement\n ).focus();\n }\n }\n }\n break;\n }\n }\n }\n\n function handleFirstLegendButtonKeydown(event: React.KeyboardEvent) {\n const { key, shiftKey } = event;\n switch (key) {\n case 'Tab': {\n if (\n shiftKey &&\n lastFocusedScatterPoint &&\n lastFocusedScatterPoint.current &&\n pointRefArray.current.find(\n point => point.current === lastFocusedScatterPoint.current\n )\n ) {\n event.preventDefault();\n lastFocusedScatterPoint.current.focus();\n }\n break;\n }\n }\n }\n\n return (\n <LineChartContainer ref={containerRef}>\n <VictoryChartContainer onKeyDown={handleChartContainerKeyDown}>\n <VictoryChart\n domainPadding={32}\n height={400}\n padding={{ top: 0, left: 80, right: 0, bottom: 62 }}\n theme={magmaTheme}\n width={width}\n containerComponent={\n <VictoryVoronoiContainer\n name=\"xAxisGroupLabel\"\n voronoiBlacklist={scatterNames}\n voronoiDimension=\"x\"\n labels={\n hoveringOnXAxisLine && showXAxisLabel ? () => ` ` : undefined\n }\n labelComponent={\n showXAxisLabel ? (\n <VictoryTooltip\n flyoutComponent={\n <AxisTooltip\n dataLength={data.length}\n hiddenData={hiddenData}\n />\n }\n />\n ) : undefined\n }\n role=\"presentation\"\n voronoiPadding={32}\n />\n }\n {...chart}\n >\n <VictoryAxis {...yAxisOther} dependentAxis style={yAxisStyles} />\n {data.map(\n ({ data: dataset }, i) =>\n !hiddenData.includes(i) && (\n <VictoryLine\n style={{\n data: {\n opacity: setLineOpacity(i),\n stroke: theme.iterableColors[i],\n strokeWidth: '3',\n },\n parent: { border: theme.colors.neutral400 },\n }}\n key={`line${i}`}\n data={dataset as unknown as any[]}\n labelComponent={<></>}\n x={x as DataGetterPropType}\n y={y as DataGetterPropType}\n {...line}\n />\n )\n )}\n <VictoryAxis\n {...xAxisOther}\n style={xAxisStyles}\n gridComponent={\n <CustomAxisComponent\n events={{\n onMouseEnter: () => setHoveringOnXAxisLine(true),\n onMouseLeave: () => setHoveringOnXAxisLine(false),\n }}\n />\n }\n />\n {data.map(\n ({ data: dataset }, i) =>\n !hiddenData.includes(i) && (\n <VictoryScatter\n name={`scatter-${i}`}\n events={[\n {\n target: 'data',\n eventHandlers: {\n onBlur: () => {\n setShowXAxisLabel(true);\n setShowTooltip(null);\n return [\n {\n target: 'labels',\n mutation: () => ({ active: undefined }),\n },\n ];\n },\n onClick: () => {\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onFocus: () => {\n setShowXAxisLabel(false);\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onMouseEnter: () => {\n setShowXAxisLabel(false);\n return [\n {\n target: 'labels',\n mutation: props => {\n setShowTooltip(\n `${props.datum.lineIndex}-${props.datum.index}`\n );\n return { active: true };\n },\n },\n ];\n },\n onMouseLeave: () => {\n setShowTooltip(null);\n setShowXAxisLabel(true);\n },\n },\n },\n ]}\n style={{\n data: {\n fill: theme.colors.neutral100,\n opacity: setLineOpacity(i),\n stroke: theme.iterableColors[i],\n strokeWidth: 2,\n },\n }}\n size={5}\n data={\n dataset.map((datum, index) => ({\n index,\n lineIndex: i,\n ...datum,\n })) as unknown as any[]\n }\n dataComponent={\n <CustomScatterDataComponent\n lineIndex={i}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n unregisterPoint={unregisterPoint}\n />\n }\n labels={() => ''}\n labelComponent={\n <VictoryTooltip\n text=\"\"\n flyoutComponent={\n <GraphTooltip index={i} showTooltip={showTooltip} />\n }\n />\n }\n key={`scatter${i}`}\n x={x as DataGetterPropType}\n y={y as DataGetterPropType}\n {...scatter}\n />\n )\n )}\n </VictoryChart>\n </VictoryChartContainer>\n\n <DataLegendsContainer>\n <DataLegendsDescription theme={theme}>\n {i18n.charts.line.dataLegendsLabel}\n </DataLegendsDescription>\n {data.map(({ name }, i) => {\n const legendButtonAriaLabel =\n i18n.charts.line.legendButtonAriaLabel.replace(/\\{name\\}/g, name);\n\n return (\n <LegendButton\n aria-label={legendButtonAriaLabel}\n color={theme.iterableColors[i]}\n dataIndex={i}\n isHidden={hiddenData.includes(i)}\n key={i}\n name={name}\n onClick={handleLegendClick}\n onKeyDown={i === 0 ? handleFirstLegendButtonKeydown : undefined}\n focusCurrentLine={focusCurrentLine}\n ref={i === 0 ? firstLegendButtonRef : undefined}\n resetLineFocus={resetLineFocus}\n />\n );\n })}\n </DataLegendsContainer>\n </LineChartContainer>\n );\n}\n","import * as React from 'react';\nimport { VictoryAxisProps } from 'victory';\n\nimport { Card, Datagrid, Spinner } from 'react-magma-dom';\n\nexport function toCamelCase(str: string) {\n return str\n .toLowerCase()\n .replace(/[^a-z 0-9]/gi, '')\n .replace(/(?:^\\w|[A-Z]|\\b\\w)/g, (ltr, index) =>\n index === 0 ? ltr.toLowerCase() : ltr.toUpperCase()\n )\n .replace(/\\s+/g, '');\n}\n\nexport interface DataTableProps {\n data?: any[];\n xData: {\n keyValue?: string | number | symbol;\n label?: VictoryAxisProps['label'];\n tickFormat?: Partial<VictoryAxisProps['tickFormat']>;\n tickValues?: VictoryAxisProps['tickValues'];\n };\n yData: {\n keyValue?: string | number | symbol;\n tickFormat?: Partial<VictoryAxisProps['tickFormat']>;\n };\n}\n\nexport const ChartDataTable = (props: DataTableProps) => {\n const {\n data = [],\n xData: {\n keyValue: xKeyValue,\n label: xAxisLabel,\n tickFormat: xTickFormat,\n tickValues: xTickValues,\n },\n yData: { keyValue: yKeyValue, tickFormat: yTickFormat },\n } = props;\n const [dataForTable, setDataForTable] = React.useState({\n columns: [],\n rows: [],\n });\n\n React.useEffect(() => {\n setDataForTable(convertData());\n }, [data]);\n\n function convertData() {\n const xField = toCamelCase((xKeyValue || xAxisLabel || 'x') as string);\n const xTickValuesArray = data.reduce((valuesArray, { data: dataset }) => {\n dataset.forEach((datum: any) => {\n const value = datum.x || (xKeyValue && datum[xKeyValue]);\n !valuesArray.includes(value) && valuesArray.push(value);\n });\n\n return valuesArray;\n }, []);\n\n let baseTableData = {\n columns:\n xTickValuesArray.length > 0\n ? [\n {\n field: xField,\n header: xAxisLabel || xKeyValue || 'X',\n isRowHeader: true,\n },\n ]\n : [],\n rows: xTickValuesArray.reduce(\n (agg: any[], tick: number, index: number) => {\n const tickValue =\n xTickValues &&\n typeof tick === 'number' &&\n xTickValues.length === xTickValuesArray.length\n ? xTickFormat && typeof xTickFormat === 'function'\n ? xTickFormat(xTickValues[tick - 1])\n : xTickValues[tick - 1]\n : xTickFormat && Array.isArray(xTickFormat)\n ? xTickFormat[tick - 1]\n : xTickFormat && typeof xTickFormat === 'function'\n ? xTickFormat(tick)\n : tick;\n agg.push({\n [xField]: tickValue,\n id: index,\n });\n\n return agg;\n },\n []\n ),\n };\n\n return data.reduce((tableData, datum) => {\n const { name: header, data: dataset } = datum;\n const field = toCamelCase(header);\n\n tableData.columns.push({\n field,\n header,\n });\n\n dataset.forEach((d: any, i: number) => {\n const yValue =\n d.y || d.y === 0 ? d.y : undefined || (yKeyValue && d[yKeyValue]);\n tableData.rows[i] = {\n ...tableData.rows[i],\n id: baseTableData.rows.length > 0 ? i + 1 : i,\n [field]:\n yTickFormat && typeof yTickFormat === 'function'\n ? yTickFormat(yValue)\n : yValue,\n };\n });\n\n return tableData;\n }, baseTableData);\n }\n\n return (\n <Card>\n {dataForTable.rows.length > 0 ? (\n <Datagrid\n hasPagination={false}\n columns={dataForTable.columns}\n rows={dataForTable.rows}\n />\n ) : (\n <Spinner />\n )}\n </Card>\n );\n};\n","import * as React from 'react';\nimport { css } from '@emotion/core';\nimport { KeyboardIcon } from 'react-magma-icons';\n\nimport { LineChart, LineChartProps } from './LineChart';\nimport { ChartDataTable } from './ChartDataTable';\nimport {\n Announce,\n ButtonVariant,\n Card,\n I18nContext,\n IconButton,\n Paragraph,\n Tab,\n TabPanel,\n TabPanelsContainer,\n Tabs,\n TabsContainer,\n ThemeContext,\n ThemeInterface,\n Tooltip,\n TypographyVisualStyle,\n useDescendants,\n} from 'react-magma-dom';\n\nimport styled, { CreateStyled } from '@emotion/styled';\nconst typedStyled = styled as CreateStyled<ThemeInterface>;\n\ninterface BaseChartProps {\n /**\n * Description of what the line chart data represents placed above the chart\n */\n description?: string;\n /**\n * @internal\n */\n testId?: string;\n /**\n * Title of the line chart\n */\n title: string;\n /**\n * Type of chart - for now just 'line' is accepted\n */\n type: string;\n}\nexport interface ChartProps<T extends any>\n extends BaseChartProps,\n Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>,\n LineChartProps<T> {}\n\nconst StyledTitle = typedStyled.span`\n color: ${props => props.theme.colors.neutral};\n font-size: ${props => props.theme.typeScale.size04.fontSize};\n font-weight: 600;\n font-family: ${props => props.theme.bodyFont};\n line-height: ${props => props.theme.typeScale.size04.lineHeight};\n margin: 0 0 12px 0;\n`;\n\nconst StyledParagraph = typedStyled(Paragraph)`\n font-size: ${props => props.theme.typeScale.size02.fontSize};\n margin: 0 0 18px 0;\n`;\n\nconst StyledTabsContainer = typedStyled(TabsContainer)`\n width: 800px;\n ul {\n box-shadow: inset 0 -1px 0 ${props => props.theme.colors.neutral300};\n }\n`;\n\nconst StyledTabPanel = typedStyled(TabPanel)`\n padding: 22px 0;\n`;\n\nconst KeyboardInstructionsCard = typedStyled(Card)<{\n isOpen?: boolean;\n maxHeight?: string;\n width?: string;\n}>`\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);\n display: ${props => (props.isOpen ? 'block' : 'none')};\n right: ${props => props.theme.spaceScale.spacing02};\n max-height: ${props =>\n props.maxHeight ? props.maxHeight : props.theme.dropdown.content.maxHeight};\n opacity: ${props => (props.isOpen ? '1' : '0')};\n outline: 0;\n overflow-y: auto;\n padding: ${props => props.theme.spaceScale.spacing05}\n ${props => props.theme.spaceScale.spacing05};\n position: absolute;\n transition: opacity 0.3s;\n white-space: nowrap;\n z-index: 2;\n\n ${props =>\n props.width &&\n css`\n white-space: normal;\n width: ${props.width};\n `}\n`;\n\nfunction BaseChart<T>(props: ChartProps<T>, ref: React.Ref<HTMLDivElement>) {\n const { description, title, testId, type, ...other } = props;\n const keyboardInstructionsRef = React.useRef<HTMLButtonElement>(null);\n const lastFocusedScatterPoint = React.useRef<SVGPathElement>(null);\n const theme = React.useContext(ThemeContext);\n const i18n = React.useContext(I18nContext);\n\n const [pointRefArray, registerPoint, unregisterPoint] = useDescendants();\n\n const [isKeyboardInstructionsOpen, setIsKeyboardInstructionsOpen] =\n React.useState<boolean>(false);\n\n function handleKeyboardInstructionsButtonBlur() {\n setIsKeyboardInstructionsOpen(false);\n }\n\n function handleKeyboardInstructionsButtonClick() {\n setIsKeyboardInstructionsOpen(prevOpen => !prevOpen);\n }\n\n function handleKeyboardInstructionsButtonKeydown(event: { preventDefault?: any; key?: any; shiftKey?: any; }) {\n const { key, shiftKey } = event;\n\n switch (key) {\n case 'Escape': {\n setIsKeyboardInstructionsOpen(false);\n break;\n }\n case 'Tab': {\n if (\n !shiftKey &&\n lastFocusedScatterPoint &&\n lastFocusedScatterPoint.current &&\n pointRefArray.current.find(\n point => point.current === lastFocusedScatterPoint.current\n )\n ) {\n event.preventDefault();\n lastFocusedScatterPoint.current.focus();\n }\n break;\n }\n }\n }\n\n return (\n <div ref={ref}>\n <StyledTitle theme={theme}>{title}</StyledTitle>\n {description && (\n <StyledParagraph\n theme={theme}\n visualStyle={TypographyVisualStyle.bodySmall}\n >\n {description}\n </StyledParagraph>\n )}\n <StyledTabsContainer theme={theme}>\n <Tabs>\n <Tab>{i18n.charts.line.chartTabLabel}</Tab>\n <Tab>{i18n.charts.line.dataTabLabel}</Tab>\n <div\n onBlur={handleKeyboardInstructionsButtonBlur}\n style={{\n display: 'inline-block',\n marginLeft: 'auto',\n }}\n >\n <Tooltip\n content={i18n.charts.line.keyboardInstructionsTooltip}\n ref={keyboardInstructionsRef}\n >\n <IconButton\n aria-controls=\"keyboardInstructions\"\n aria-label={i18n.charts.line.keyboardInstructionsTooltip}\n aria-expanded={Boolean(isKeyboardInstructionsOpen)}\n icon={<KeyboardIcon />}\n onClick={handleKeyboardInstructionsButtonClick}\n onKeyDown={handleKeyboardInstructionsButtonKeydown}\n variant={ButtonVariant.link}\n />\n </Tooltip>\n <Announce>\n <KeyboardInstructionsCard\n id=\"keyboardInstructions\"\n isOpen={isKeyboardInstructionsOpen}\n theme={theme}\n width=\"350px\"\n >\n <Paragraph\n visualStyle={TypographyVisualStyle.headingXSmall}\n style={{ margin: '0 0 16px' }}\n >\n {i18n.charts.line.keyboardInstructionsHeader}\n </Paragraph>\n {i18n.charts.line.keyboardInstructions}\n </KeyboardInstructionsCard>\n </Announce>\n </div>\n </Tabs>\n <TabPanelsContainer>\n <StyledTabPanel theme={theme}>\n {type === 'line' && (\n <LineChart<T>\n {...other}\n lastFocusedScatterPoint={lastFocusedScatterPoint}\n pointRefArray={pointRefArray}\n registerPoint={registerPoint}\n tabRef={keyboardInstructionsRef}\n unregisterPoint={unregisterPoint}\n />\n )}\n </StyledTabPanel>\n <StyledTabPanel theme={theme}>\n <ChartDataTable\n data={other.data}\n xData={{\n keyValue: other.x,\n label: other.componentProps?.xAxis?.label,\n tickFormat: other.componentProps?.xAxis?.tickFormat,\n }}\n yData={{\n keyValue: other.y,\n tickFormat: other.componentProps?.yAxis?.tickFormat,\n }}\n />\n </StyledTabPanel>\n </TabPanelsContainer>\n </StyledTabsContainer>\n </div>\n );\n}\n\nexport const Chart = React.forwardRef(BaseChart) as <T>(\n props: ChartProps<T> & { ref?: React.MutableRefObject<HTMLDivElement> }\n) => ReturnType<typeof BaseChart>;\n"],"names":["colors","baseProps","width","height","padding","baseLabelStyles","fontFamily","fontSize","letterSpacing","fill","stroke","strokeWidth","centeredLabelStyles","_extends","textAnchor","magmaTheme","area","style","data","labels","axis","strokeLinecap","strokeLinejoin","axisLabel","grid","pointerEvents","ticks","size","tickLabels","polarDependentAxis","bar","boxplot","max","maxLabels","median","medianLabels","min","minLabels","q1","q1Labels","q3","q3Labels","boxWidth","candlestick","candleColors","positive","negative","chart","errorbar","borderWidth","opacity","group","colorScale","histogram","legend","gutter","orientation","titleOrientation","type","title","line","pie","scatter","stack","tooltip","flyoutStyle","flyoutPadding","cornerRadius","pointerLength","voronoi","flyout","typedStyled","styled","StyledGraphTooltip","StyledTooltip","_t","_2","props","theme","neutral100","neutral300","neutral","typeScale","size02","lineHeight","TooltipColorSwatch","span","_t2","color","GraphTooltip","datum","index","showTooltip","x","y","React","useContext","ThemeContext","_jsx","children","_jsxs","position","TooltipPosition","top","role","iterableColors","label","TooltipArrow","AxisTooltip","activePoints","hiddenData","dataLength","pointsIndexes","Array","from","_","i","filter","includes","map","point","CustomScatterDataComponent","pointIndex","lineIndex","pointRefArray","registerPoint","unregisterPoint","other","_objectWithoutPropertiesLoose","_excluded","Point","ariaLabel","pathComponent","CustomPointComponent","tabIndex","_excluded2","forceUpdate","useForceUpdate","ref","useRef","useEffect","CustomAxisComponent","_ref","events","LineSegment","strokeOpacity","LegendButton","forwardRef","dataIndex","isHidden","onClick","name","focusCurrentLine","resetLineFocus","handleOnMouseEnterOrFocus","display","onMouseEnter","onMouseLeave","Checkbox","checked","containerStyle","alignItems","border","boxShadow","margin","inputStyle","neutral800","borderRadius","labelText","onBlur","onFocus","LineChartContainer","div","VictoryChartContainer","DataLegendsContainer","_t3","DataLegendsDescription","p","_t4","LineChart","componentProps","xAxis","xAxisLabel","xTickLabels","yAxis","yAxisLabel","yTickLabels","lastFocusedScatterPoint","tabRef","xRest","xAxisOther","yRest","_excluded3","yAxisOther","_excluded4","i18n","I18nContext","setHiddenData","useState","setWidth","focusedLine","setFocusedLine","setShowTooltip","showXAxisLabel","setShowXAxisLabel","hoveringOnXAxisLine","setHoveringOnXAxisLine","containerRef","firstLegendButtonRef","updateWidth","window","addEventListener","handleEsc","removeEventListener","handleMouseMove","scatterNames","xAxisStyles","fontWeight","yAxisStyles","current","clientWidth","event","key","setLineOpacity","handleLegendClick","item","concat","buildLineIndexes","acc","currentLineIndex","parseInt","getAttribute","push","buildLineIndexData","currentPointIndex","lineIndexes","reduce","lowestLineIndex","highestLineIndex","length","findPointToFocus","handleFirstLegendButtonKeydown","shiftKey","find","preventDefault","focus","onKeyDown","document","activeElement","focusedPointIndex","findIndex","undefined","focusedPoint","nextLowestLineIndex","indexOf","nextHighestLineIndex","VictoryChart","domainPadding","left","right","bottom","containerComponent","VictoryVoronoiContainer","voronoiBlacklist","voronoiDimension","labelComponent","VictoryTooltip","flyoutComponent","voronoiPadding","VictoryAxis","dependentAxis","dataset","VictoryLine","parent","neutral400","_Fragment","gridComponent","VictoryScatter","target","eventHandlers","mutation","active","dataComponent","text","charts","dataLegendsLabel","legendButtonAriaLabel","replace","toCamelCase","str","toLowerCase","ltr","toUpperCase","ChartDataTable","xData","keyValue","xKeyValue","tickFormat","xTickFormat","tickValues","xTickValues","yData","yKeyValue","yTickFormat","dataForTable","setDataForTable","columns","rows","xField","xTickValuesArray","valuesArray","forEach","value","baseTableData","field","header","isRowHeader","agg","tick","tickValue","isArray","id","tableData","d","yValue","convertData","Card","Datagrid","hasPagination","Spinner","StyledTitle","size04","bodyFont","StyledParagraph","Paragraph","StyledTabsContainer","TabsContainer","StyledTabPanel","TabPanel","KeyboardInstructionsCard","_t5","isOpen","spaceScale","spacing02","maxHeight","dropdown","content","spacing05","css","_t6","BaseChart","description","keyboardInstructionsRef","useDescendants","isKeyboardInstructionsOpen","setIsKeyboardInstructionsOpen","visualStyle","TypographyVisualStyle","bodySmall","Tabs","Tab","chartTabLabel","dataTabLabel","marginLeft","Tooltip","keyboardInstructionsTooltip","IconButton","Boolean","icon","KeyboardIcon","prevOpen","variant","ButtonVariant","link","Announce","headingXSmall","keyboardInstructionsHeader","keyboardInstructions","TabPanelsContainer","_other$componentProps","_other$componentProps2","_other$componentProps3","_other$componentProps4","_other$componentProps5","_other$componentProps6","Chart"],"mappings":"mlCAmBA,MAAMA,EAAS,CACb,UACA,UACA,UACA,UACA,UACA,WAmBIC,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