@undp/data-viz 1.4.12 → 1.4.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AreaChart.cjs +1 -1
- package/dist/AreaChart.cjs.map +1 -1
- package/dist/AreaChart.js +25 -24
- package/dist/AreaChart.js.map +1 -1
- package/dist/BarGraph.cjs +1 -1
- package/dist/BarGraph.cjs.map +1 -1
- package/dist/BarGraph.js +638 -632
- package/dist/BarGraph.js.map +1 -1
- package/dist/BeeSwarmChart.cjs +1 -1
- package/dist/BeeSwarmChart.cjs.map +1 -1
- package/dist/BeeSwarmChart.js +134 -132
- package/dist/BeeSwarmChart.js.map +1 -1
- package/dist/BiVariateChoroplethMap.cjs +1 -1
- package/dist/BiVariateChoroplethMap.cjs.map +1 -1
- package/dist/BiVariateChoroplethMap.js +35 -34
- package/dist/BiVariateChoroplethMap.js.map +1 -1
- package/dist/BulletChart.cjs +1 -1
- package/dist/BulletChart.cjs.map +1 -1
- package/dist/BulletChart.js +226 -224
- package/dist/BulletChart.js.map +1 -1
- package/dist/ButterflyChart.cjs +1 -1
- package/dist/ButterflyChart.cjs.map +1 -1
- package/dist/ButterflyChart.js +48 -47
- package/dist/ButterflyChart.js.map +1 -1
- package/dist/ChoroplethMap.cjs +1 -1
- package/dist/ChoroplethMap.cjs.map +1 -1
- package/dist/ChoroplethMap.js +56 -55
- package/dist/ChoroplethMap.js.map +1 -1
- package/dist/CirclePackingGraph.cjs +1 -1
- package/dist/CirclePackingGraph.js +1 -1
- package/dist/DataCards.cjs +3 -3
- package/dist/DataCards.cjs.map +1 -1
- package/dist/DataCards.js +2 -1
- package/dist/DataCards.js.map +1 -1
- package/dist/DataTable.cjs +1 -1
- package/dist/DataTable.cjs.map +1 -1
- package/dist/DataTable.js +9 -8
- package/dist/DataTable.js.map +1 -1
- package/dist/DifferenceLineChart.cjs +1 -1
- package/dist/DifferenceLineChart.cjs.map +1 -1
- package/dist/DifferenceLineChart.js +1 -0
- package/dist/DifferenceLineChart.js.map +1 -1
- package/dist/DonutChart.cjs +1 -1
- package/dist/DonutChart.cjs.map +1 -1
- package/dist/DonutChart.js +77 -76
- package/dist/DonutChart.js.map +1 -1
- package/dist/DotDensityMap.cjs +1 -1
- package/dist/DotDensityMap.cjs.map +1 -1
- package/dist/DotDensityMap.js +1 -0
- package/dist/DotDensityMap.js.map +1 -1
- package/dist/{DropdownSelect-CeHog_ih.js → DropdownSelect-CtOKZHD0.js} +22 -20
- package/dist/{DropdownSelect-CeHog_ih.js.map → DropdownSelect-CtOKZHD0.js.map} +1 -1
- package/dist/{DropdownSelect-BmE5JaeE.cjs → DropdownSelect-DBDM64B5.cjs} +2 -2
- package/dist/{DropdownSelect-BmE5JaeE.cjs.map → DropdownSelect-DBDM64B5.cjs.map} +1 -1
- package/dist/DualAxisLineChart.cjs +1 -1
- package/dist/DualAxisLineChart.cjs.map +1 -1
- package/dist/DualAxisLineChart.d.ts +3 -1
- package/dist/DualAxisLineChart.js +265 -261
- package/dist/DualAxisLineChart.js.map +1 -1
- package/dist/DumbbellChart.cjs +1 -1
- package/dist/DumbbellChart.cjs.map +1 -1
- package/dist/DumbbellChart.js +216 -214
- package/dist/DumbbellChart.js.map +1 -1
- package/dist/GeoHubCompareMaps.cjs +1 -1
- package/dist/GeoHubCompareMaps.cjs.map +1 -1
- package/dist/GeoHubCompareMaps.js +1 -0
- package/dist/GeoHubCompareMaps.js.map +1 -1
- package/dist/GeoHubMap.cjs +1 -1
- package/dist/GeoHubMap.cjs.map +1 -1
- package/dist/GeoHubMap.js +29 -28
- package/dist/GeoHubMap.js.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs +1 -1
- package/dist/GeoHubMapWithLayerSelection.cjs.map +1 -1
- package/dist/GeoHubMapWithLayerSelection.js +34 -33
- package/dist/GeoHubMapWithLayerSelection.js.map +1 -1
- package/dist/{GraphEl-s3ctz7oA.js → GraphEl-N6vuMRw_.js} +6 -2
- package/dist/GraphEl-N6vuMRw_.js.map +1 -0
- package/dist/GraphEl-Zl0W-LK9.cjs +2 -0
- package/dist/GraphEl-Zl0W-LK9.cjs.map +1 -0
- package/dist/GriddedGraphs.cjs +1 -1
- package/dist/GriddedGraphs.d.ts +1 -0
- package/dist/GriddedGraphs.js +2 -2
- package/dist/GriddedGraphsFromConfig.d.ts +1 -0
- package/dist/HeatMap.cjs +1 -1
- package/dist/HeatMap.cjs.map +1 -1
- package/dist/HeatMap.js +55 -54
- package/dist/HeatMap.js.map +1 -1
- package/dist/Histogram.cjs +1 -1
- package/dist/Histogram.js +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs +1 -1
- package/dist/LineChartWithConfidenceInterval.cjs.map +1 -1
- package/dist/LineChartWithConfidenceInterval.js +22 -21
- package/dist/LineChartWithConfidenceInterval.js.map +1 -1
- package/dist/MultiGraphDashboard.cjs +1 -1
- package/dist/MultiGraphDashboard.d.ts +1 -0
- package/dist/MultiGraphDashboard.js +1 -1
- package/dist/MultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/MultiGraphDashboardWideToLongFormat.cjs +1 -1
- package/dist/MultiGraphDashboardWideToLongFormat.js +1 -1
- package/dist/MultiLineAltChart.cjs +1 -1
- package/dist/MultiLineAltChart.cjs.map +1 -1
- package/dist/MultiLineAltChart.js +34 -33
- package/dist/MultiLineAltChart.js.map +1 -1
- package/dist/MultiLineChart.cjs +1 -1
- package/dist/MultiLineChart.cjs.map +1 -1
- package/dist/MultiLineChart.js +72 -71
- package/dist/MultiLineChart.js.map +1 -1
- package/dist/ParetoChart.cjs +1 -1
- package/dist/ParetoChart.cjs.map +1 -1
- package/dist/ParetoChart.d.ts +4 -0
- package/dist/ParetoChart.js +317 -312
- package/dist/ParetoChart.js.map +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.cjs +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboard.d.ts +1 -0
- package/dist/PerformanceIntensiveMultiGraphDashboard.js +1 -1
- package/dist/PerformanceIntensiveMultiGraphDashboardFromConfig.d.ts +1 -0
- package/dist/PerformanceIntensiveScrollStory.d.ts +1 -0
- package/dist/RadarChart.cjs +1 -1
- package/dist/RadarChart.cjs.map +1 -1
- package/dist/RadarChart.js +27 -26
- package/dist/RadarChart.js.map +1 -1
- package/dist/SankeyChart.cjs +1 -1
- package/dist/SankeyChart.cjs.map +1 -1
- package/dist/SankeyChart.js +30 -29
- package/dist/SankeyChart.js.map +1 -1
- package/dist/ScatterPlot.cjs +1 -1
- package/dist/ScatterPlot.cjs.map +1 -1
- package/dist/ScatterPlot.js +119 -118
- package/dist/ScatterPlot.js.map +1 -1
- package/dist/ScrollStory.d.ts +1 -0
- package/dist/SimpleLineChart.cjs +1 -1
- package/dist/SimpleLineChart.cjs.map +1 -1
- package/dist/SimpleLineChart.js +16 -15
- package/dist/SimpleLineChart.js.map +1 -1
- package/dist/SingleGraphDashboard.cjs +1 -1
- package/dist/SingleGraphDashboard.d.ts +1 -0
- package/dist/SingleGraphDashboard.js +2 -2
- package/dist/SingleGraphDashboardFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMaps.d.ts +1 -0
- package/dist/SingleGraphDashboardGeoHubMapsFromConfig.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.cjs +1 -1
- package/dist/SingleGraphDashboardThreeDGraphs.d.ts +1 -0
- package/dist/SingleGraphDashboardThreeDGraphs.js +1 -1
- package/dist/SingleGraphDashboardThreeDGraphsFromConfig.d.ts +1 -0
- package/dist/SlopeChart.cjs +1 -1
- package/dist/SlopeChart.cjs.map +1 -1
- package/dist/SlopeChart.js +46 -45
- package/dist/SlopeChart.js.map +1 -1
- package/dist/SparkLine.cjs +1 -1
- package/dist/SparkLine.cjs.map +1 -1
- package/dist/SparkLine.js +12 -11
- package/dist/SparkLine.js.map +1 -1
- package/dist/StripChart.cjs +1 -1
- package/dist/StripChart.cjs.map +1 -1
- package/dist/StripChart.js +81 -79
- package/dist/StripChart.js.map +1 -1
- package/dist/ThreeDGlobe.cjs +1 -1
- package/dist/ThreeDGlobe.cjs.map +1 -1
- package/dist/ThreeDGlobe.js +1 -0
- package/dist/ThreeDGlobe.js.map +1 -1
- package/dist/TreeMapGraph.cjs +1 -1
- package/dist/TreeMapGraph.cjs.map +1 -1
- package/dist/TreeMapGraph.js +114 -113
- package/dist/TreeMapGraph.js.map +1 -1
- package/dist/Types.d.ts +1 -0
- package/dist/UnitChart.cjs +1 -1
- package/dist/UnitChart.cjs.map +1 -1
- package/dist/UnitChart.js +10 -9
- package/dist/UnitChart.js.map +1 -1
- package/dist/{index-CZLvTu6p.cjs → index-BbNoLJ_w.cjs} +2 -2
- package/dist/{index-CZLvTu6p.cjs.map → index-BbNoLJ_w.cjs.map} +1 -1
- package/dist/{index-DGAaLNu9.js → index-Bc5VF70V.js} +46 -45
- package/dist/{index-DGAaLNu9.js.map → index-Bc5VF70V.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/GraphEl-OzC-icbr.cjs +0 -2
- package/dist/GraphEl-OzC-icbr.cjs.map +0 -1
- package/dist/GraphEl-s3ctz7oA.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),d=require("react"),F=require("./parse-hMnG_lRV.cjs"),ke=require("./index-BzeLQvXk.cjs"),ne=require("./numberFormattingFunction-02t-wJta.cjs"),Ne=require("./Tooltip-n8z5bfav.cjs"),g=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Ie=require("./XTicksAndGridLines-CCzXIV8d.cjs"),pe=require("./Axis-DE7dSn1_.cjs"),ve=require("./AxisTitle-CK9YeovX.cjs"),Oe=require("./index-DNj994Pv.cjs"),Le=require("./time-Byw_jYQ7.cjs"),we=require("./linear-BVckp9RD.cjs"),ye=require("./line-DHV4JwCR.cjs"),re=require("./step-BZ3C8QFW.cjs"),qe=require("./select-Bnfk0lJx.cjs"),De=require("./init-DU0ybBc_.cjs"),Se=require("./pointer-Dkq5NV1q.cjs"),Me=require("./use-in-view-sQJZ_xDO.cjs"),b=require("./proxy-BHRoeZgd.cjs"),Te=require("./GraphFooter.cjs"),Ve=require("./GraphHeader.cjs"),$e=require("./ColorLegend.cjs"),Ee=require("./Colors.cjs"),Fe=require("./EmptyState-d8_8SxeW.cjs");function Ce(ae){const{data:k,width:R,height:S,lineColors:n,labels:h,sameAxes:c,dateFormat:j,showValues:G,noOfXTicks:oe,rightMargin:le,leftMargin:W,topMargin:X,bottomMargin:xe,tooltip:v,highlightAreaSettings:ce,onSeriesMouseOver:C,animate:s,strokeWidth:Y,showDots:P,noOfYTicks:B,lineSuffixes:M,linePrefixes:T,minDate:z,maxDate:N,curveType:V,styles:o,classNames:r,precision:A,customLayers:H}=ae,J=d.useRef(null),p=Me.useInView(J,{once:s.once,amount:s.amount}),[m,ue]=d.useState(!1);d.useEffect(()=>{if(p&&!m){const e=setTimeout(()=>{ue(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[p,m,s.duration]);const I=V==="linear"?ye.curveLinear:V==="step"?re.curveStep:V==="stepAfter"?re.stepAfter:V==="stepBefore"?re.stepBefore:re.monotoneX,[O,K]=d.useState(void 0),[Q,Z]=d.useState(void 0),[_,ee]=d.useState(void 0),f={top:X,bottom:xe,left:W+50,right:le+65},w=d.useRef(null),i=ke.sortBy(k.map(e=>({...e,date:F.parse(`${e.date}`,j,new Date)})),"date"),me=ce.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:F.parse(`${e.coordinates[0]}`,j,new Date),e.coordinates[1]===null?null:F.parse(`${e.coordinates[1]}`,j,new Date)]})),u=R-f.left-f.right,a=S-f.top-f.bottom,te=z?F.parse(`${z}`,j,new Date):i[0].date,ie=N?F.parse(`${N}`,j,new Date):i[i.length-1].date,$=Math.min(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y1).filter(e=>e!=null)):0,E=Math.min(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y2).filter(e=>e!=null)):0,L=Math.max(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y1).filter(e=>e!=null)):0,l=Math.max(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y2).filter(e=>e!=null)):0,U=$<E?$:E,se=L>l?L:l,x=Le.time().domain([te,ie]).range([0,u]),q=we.linear().domain([c?U:$,c?se>0?se:0:L>0?L:0]).range([a,0]).nice(),y=we.linear().domain([c?U:E,c?se>0?se:0:l>0?l:0]).range([a,0]).nice(),ge=ye.line().defined(e=>!g.checkIfNullOrUndefined(e.y1)).x(e=>x(e.date)).y(e=>q(e.y1)).curve(I),de=ye.line().defined(e=>!g.checkIfNullOrUndefined(e.y2)).x(e=>x(e.date)).y(e=>y(e.y2)).curve(I),Re=q.ticks(B),Ae=y.ticks(B),fe=x.ticks(oe);return d.useEffect(()=>{const e=he=>{const je=i[De.bisectCenter(i.map(be=>be.date),x.invert(Se.pointer(he)[0]),0)];K(je||i[i.length-1]),C?.(je||i[i.length-1]),ee(he.clientY),Z(he.clientX)},D=()=>{K(void 0),Z(void 0),ee(void 0),C?.(void 0)};qe.select(w.current).on("mousemove",e).on("mouseout",D)},[x,i,C]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(b.motion.svg,{width:`${R}px`,height:`${S}px`,viewBox:`0 0 ${R} ${S}`,direction:"ltr",ref:J,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${f.left},${f.top})`,children:[t.jsxRuntimeExports.jsx(Oe.HighlightArea,{areaSettings:me,width:u,height:a,scale:x,animate:s,isInView:p}),t.jsxRuntimeExports.jsxs("g",{children:[Re.map((e,D)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:q(e),y2:q(e),x1:-15,x2:-20,style:{stroke:n[0],strokeWidth:1,...o?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:-25,y:q(e),dy:"0.33em",className:t.mo("text-xs",r?.yAxis?.labels),style:{textAnchor:"end",fill:n[0],...o?.yAxis?.labels||{}},children:ne.numberFormattingFunction(e,"NA",A,T[0],M[0])})]},D)),t.jsxRuntimeExports.jsx(pe.Axis,{y1:0,y2:a,x1:-15,x2:-15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[0],...o?.xAxis?.axis||{}}}}),t.jsxRuntimeExports.jsx(ve.AxisTitle,{x:10-f.left,y:a/2,style:{fill:n[0],...o?.yAxis?.title||{}},className:r?.yAxis?.title,text:h[0].length>100?`${h[0].substring(0,100)}...`:h[0],rotate90:!0})]}),t.jsxRuntimeExports.jsxs("g",{children:[Ae.map((e,D)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:y(e),y2:y(e),x1:u+15,x2:u+20,style:{stroke:n[1],strokeWidth:1,...o?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:u+25,y:y(e),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:n[1],...o?.yAxis?.labels||{}},className:t.mo("text-xs",r?.yAxis?.labels),children:ne.numberFormattingFunction(e,"NA",A,T[1],M[1])})]},D)),t.jsxRuntimeExports.jsx(pe.Axis,{y1:0,y2:a,x1:u+15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[1],...o?.xAxis?.axis||{}}}}),t.jsxRuntimeExports.jsx(ve.AxisTitle,{x:u+f.right-15,y:a/2,style:{fill:n[1],...o?.yAxis?.title||{}},className:r?.yAxis?.title,text:h[1].length>100?`${h[1].substring(0,100)}...`:h[1],rotate90:!0})]}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(pe.Axis,{y1:a,y2:a,x1:-15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:o?.xAxis?.axis}}),t.jsxRuntimeExports.jsx(Ie.XTicksAndGridLines,{values:fe.map(e=>F.format(e,j)),x:fe.map(e=>x(e)),y1:0,y2:a,styles:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",r?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",r?.xAxis?.labels)},labelType:"primary",showGridLines:!0,precision:A})]}),H.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(b.motion.path,{style:{stroke:n[0],strokeWidth:Y,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:ge(i.filter(e=>!g.checkIfNullOrUndefined(e.y1)))||"",opacity:1},whileInView:{pathLength:1,d:ge(i.filter(e=>!g.checkIfNullOrUndefined(e.y1)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:p?"whileInView":"initial"}),t.jsxRuntimeExports.jsx(b.motion.path,{d:de(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",style:{stroke:n[1],strokeWidth:Y,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:de(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",opacity:1},whileInView:{pathLength:1,d:de(i.filter(e=>!g.checkIfNullOrUndefined(e.y2)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:p?"whileInView":"initial"}),O?t.jsxRuntimeExports.jsx("line",{y1:0,y2:a,x1:x(O.date),x2:x(O.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",r?.mouseOverLine),style:o?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,D)=>t.jsxRuntimeExports.jsxs(b.motion.g,{children:[g.checkIfNullOrUndefined(e.y1)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(b.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[0]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(e.date),cy:q(e.y1)},whileInView:{opacity:1,transition:{duration:m?s.duration:.5,delay:m?0:s.duration},cx:x(e.date),cy:q(e.y1)}},initial:"initial",animate:p?"whileInView":"initial"}):null,G?t.jsxRuntimeExports.jsx(b.motion.text,{dy:g.checkIfNullOrUndefined(e.y2)||e.y2<e.y1?-8:"1em",style:{fill:n[0],textAnchor:"middle",...o?.graphObjectValues||{}},className:t.mo("graph-value graph-value-line-1 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(e.date),y:y(e.y1)},whileInView:{opacity:1,x:x(e.date),y:y(e.y1),transition:{duration:m?s.duration:.5,delay:m?0:s.duration}}},initial:"initial",animate:p?"whileInView":"initial",children:ne.numberFormattingFunction(e.y1,"NA",A,T[0],M[0])}):null]}),g.checkIfNullOrUndefined(e.y2)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(b.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[1]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:x(e.date),cy:y(e.y2)},whileInView:{opacity:1,transition:{duration:m?s.duration:.5,delay:m?0:s.duration},cx:x(e.date),cy:y(e.y2)}},initial:"initial",animate:p?"whileInView":"initial"}):null,G?t.jsxRuntimeExports.jsx(b.motion.text,{dy:g.checkIfNullOrUndefined(e.y1)||e.y1<e.y2?-8:"1em",style:{fill:n[1],textAnchor:"middle",...o?.graphObjectValues||{}},className:t.mo("graph-value graph-value-line-2 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:x(e.date),y:y(e.y2)},whileInView:{opacity:1,x:x(e.date),y:y(e.y2),transition:{duration:m?s.duration:.5,delay:m?0:s.duration}}},initial:"initial",animate:p?"whileInView":"initial",children:ne.numberFormattingFunction(e.y2,"NA",A,T[1],M[1])}):null]})]},D))}),H.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:w,style:{fill:"none",pointerEvents:"all"},width:u,height:a})]})}),O&&v&&Q&&_?t.jsxRuntimeExports.jsx(Ne.Tooltip,{data:O,body:v,xPos:Q,yPos:_,backgroundStyle:o?.tooltip,className:r?.tooltip}):null]})}function Pe(ae){const{data:k,graphTitle:R,sources:S,graphDescription:n,height:h,width:c,footNote:j,noOfXTicks:G=10,dateFormat:oe="yyyy",showValues:le=!1,padding:W,lineColors:X=[Ee.Colors.light.categoricalColors.colors[0],Ee.Colors.light.categoricalColors.colors[1]],sameAxes:xe=!1,backgroundColor:v=!1,leftMargin:ce=80,rightMargin:C=80,topMargin:s=20,bottomMargin:Y=25,labels:P,lineSuffixes:B=["",""],linePrefixes:M=["",""],tooltip:T,highlightAreaSettings:z=[],relativeHeight:N,onSeriesMouseOver:V,graphID:o,graphDownload:r=!1,dataDownload:A=!1,animate:H=!1,strokeWidth:J=2,showDots:p=!0,language:m="en",showColorScale:ue=!0,minHeight:I=0,colorLegendTitle:O,theme:K="light",ariaLabel:Q,noOfYTicks:Z=5,maxDate:_,minDate:ee,curveType:f="curve",styles:w,classNames:i,precision:me=2,customLayers:u=[]}=ae,[a,te]=d.useState(0),[ie,$]=d.useState(0),E=d.useRef(null),L=d.useRef(null);return d.useEffect(()=>{const l=new ResizeObserver(U=>{te(c||U[0].target.clientWidth||620),$(h||U[0].target.clientHeight||480)});return E.current&&($(E.current.clientHeight||480),te(E.current.clientWidth||620),c||l.observe(E.current)),()=>l.disconnect()},[c,h]),t.jsxRuntimeExports.jsx("div",{className:`${K||"light"} flex ${c?"w-fit grow-0":"w-full grow"}`,dir:m==="he"||m==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${m||"en"}`,i?.graphContainer),style:{...w?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:o,ref:L,"aria-label":Q||`${R?`The graph shows ${R}. `:""}This is a line chart that show trends for two datasets over time.${n?` ${n}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?W||"1rem":W||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||n||r||A?t.jsxRuntimeExports.jsx(Ve.GraphHeader,{styles:{title:w?.title,description:w?.description},classNames:{title:i?.title,description:i?.description},graphTitle:R,graphDescription:n,width:c,graphDownload:r?L.current:void 0,dataDownload:A?k.map(l=>l.data).filter(l=>l!==void 0).length>0?k.map(l=>l.data).filter(l=>l!==void 0):k.filter(l=>l!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:k.length===0?t.jsxRuntimeExports.jsx(Fe.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[ue?null:t.jsxRuntimeExports.jsx($e.ColorLegend,{colorDomain:P,colorLegendTitle:O,colors:X,showNAColor:!1}),t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:E,"aria-label":"Graph area",children:(c||a)&&(h||ie)?t.jsxRuntimeExports.jsx(Ce,{data:k,sameAxes:xe,lineColors:X,width:c||a,height:Math.max(I,h||(N?I?(c||a)*N>I?(c||a)*N:I:(c||a)*N:ie)),dateFormat:oe,showValues:le,noOfXTicks:G,leftMargin:ce,rightMargin:C,topMargin:s,bottomMargin:Y,labels:P,highlightAreaSettings:z,tooltip:T,onSeriesMouseOver:V,animate:H===!0?{duration:.5,once:!0,amount:.5}:H||{duration:0,once:!0,amount:0},strokeWidth:J,showDots:p,noOfYTicks:Z,lineSuffixes:B,linePrefixes:M,minDate:ee,maxDate:_,curveType:f,styles:w,classNames:i,precision:me,customLayers:u}):null})]})}),S||j?t.jsxRuntimeExports.jsx(Te.GraphFooter,{styles:{footnote:w?.footnote,source:w?.source},classNames:{footnote:i?.footnote,source:i?.source},sources:S,footNote:j,width:c}):null]})})})})}exports.DualAxisLineChart=Pe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CHPV5EwG-DDoeWRVt.cjs"),h=require("react"),F=require("./parse-hMnG_lRV.cjs"),Ne=require("./index-BzeLQvXk.cjs"),ae=require("./numberFormattingFunction-02t-wJta.cjs"),Ie=require("./Tooltip-n8z5bfav.cjs"),f=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./XTicksAndGridLines-CCzXIV8d.cjs"),ye=require("./Axis-DE7dSn1_.cjs"),we=require("./AxisTitle-CK9YeovX.cjs"),Le=require("./index-DNj994Pv.cjs"),qe=require("./time-Byw_jYQ7.cjs"),Ee=require("./linear-BVckp9RD.cjs"),ge=require("./line-DHV4JwCR.cjs"),oe=require("./step-BZ3C8QFW.cjs"),De=require("./select-Bnfk0lJx.cjs"),Se=require("./init-DU0ybBc_.cjs"),Me=require("./pointer-Dkq5NV1q.cjs"),Te=require("./use-in-view-sQJZ_xDO.cjs"),b=require("./proxy-BHRoeZgd.cjs"),Ve=require("./GraphFooter.cjs"),$e=require("./GraphHeader.cjs"),Fe=require("./ColorLegend.cjs"),Re=require("./Colors.cjs"),Ce=require("./EmptyState-d8_8SxeW.cjs");function Pe(le){const{data:k,width:R,height:D,lineColors:n,labels:y,sameAxes:o,dateFormat:j,showValues:G,noOfXTicks:xe,rightMargin:ce,leftMargin:W,topMargin:X,bottomMargin:ue,tooltip:v,highlightAreaSettings:me,onSeriesMouseOver:C,animate:s,strokeWidth:Y,showDots:P,noOfYTicks:B,lineSuffixes:S,linePrefixes:M,minDate:z,maxDate:N,curveType:T,styles:l,classNames:r,precision:A,customLayers:H,showAxisLabels:J}=le,K=h.useRef(null),d=Te.useInView(K,{once:s.once,amount:s.amount}),[p,V]=h.useState(!1);h.useEffect(()=>{if(d&&!p){const e=setTimeout(()=>{V(!0)},(s.duration+.5)*1e3);return()=>clearTimeout(e)}},[d,p,s.duration]);const Q=T==="linear"?ge.curveLinear:T==="step"?oe.curveStep:T==="stepAfter"?oe.stepAfter:T==="stepBefore"?oe.stepBefore:oe.monotoneX,[I,Z]=h.useState(void 0),[_,ee]=h.useState(void 0),[te,ie]=h.useState(void 0),m={top:X,bottom:ue,left:W+50,right:ce+65},w=h.useRef(null),i=Ne.sortBy(k.map(e=>({...e,date:F.parse(`${e.date}`,j,new Date)})),"date"),de=me.map(e=>({...e,coordinates:[e.coordinates[0]===null?null:F.parse(`${e.coordinates[0]}`,j,new Date),e.coordinates[1]===null?null:F.parse(`${e.coordinates[1]}`,j,new Date)]})),u=R-m.left-m.right,a=D-m.top-m.bottom,se=z?F.parse(`${z}`,j,new Date):i[0].date,ne=N?F.parse(`${N}`,j,new Date):i[i.length-1].date,$=Math.min(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y1).filter(e=>e!=null)):0,E=Math.min(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.min(...i.map(e=>e.y2).filter(e=>e!=null))>0?0:Math.min(...i.map(e=>e.y2).filter(e=>e!=null)):0,O=Math.max(...i.map(e=>e.y1).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y1).filter(e=>e!=null)):0,x=Math.max(...i.map(e=>e.y2).filter(e=>e!=null))!==1/0?Math.max(...i.map(e=>e.y2).filter(e=>e!=null)):0,U=$<E?$:E,re=O>x?O:x,c=qe.time().domain([se,ne]).range([0,u]),L=Ee.linear().domain([o?U:$,o?re>0?re:0:O>0?O:0]).range([a,0]).nice(),g=Ee.linear().domain([o?U:E,o?re>0?re:0:x>0?x:0]).range([a,0]).nice(),fe=ge.line().defined(e=>!f.checkIfNullOrUndefined(e.y1)).x(e=>c(e.date)).y(e=>L(e.y1)).curve(Q),he=ge.line().defined(e=>!f.checkIfNullOrUndefined(e.y2)).x(e=>c(e.date)).y(e=>g(e.y2)).curve(Q),Ae=L.ticks(B),be=g.ticks(B),je=c.ticks(xe);return h.useEffect(()=>{const e=pe=>{const ve=i[Se.bisectCenter(i.map(ke=>ke.date),c.invert(Me.pointer(pe)[0]),0)];Z(ve||i[i.length-1]),C?.(ve||i[i.length-1]),ie(pe.clientY),ee(pe.clientX)},q=()=>{Z(void 0),ee(void 0),ie(void 0),C?.(void 0)};De.select(w.current).on("mousemove",e).on("mouseout",q)},[c,i,C]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(b.motion.svg,{width:`${R}px`,height:`${D}px`,viewBox:`0 0 ${R} ${D}`,direction:"ltr",ref:K,children:t.jsxRuntimeExports.jsxs("g",{transform:`translate(${m.left},${m.top})`,children:[t.jsxRuntimeExports.jsx(Le.HighlightArea,{areaSettings:de,width:u,height:a,scale:c,animate:s,isInView:d}),t.jsxRuntimeExports.jsxs("g",{children:[Ae.map((e,q)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:L(e),y2:L(e),x1:-15,x2:-20,style:{stroke:n[0],strokeWidth:1,...l?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:-25,y:L(e),dy:"0.33em",className:t.mo("text-xs",r?.yAxis?.labels),style:{textAnchor:"end",fill:n[0],...l?.yAxis?.labels||{}},children:ae.numberFormattingFunction(e,"NA",A,M[0],S[0])})]},q)),t.jsxRuntimeExports.jsx(ye.Axis,{y1:0,y2:a,x1:-15,x2:-15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[0],...l?.xAxis?.axis||{}}}}),J?t.jsxRuntimeExports.jsx(we.AxisTitle,{x:10-m.left,y:a/2,style:{fill:n[0],...l?.yAxis?.title||{}},className:r?.yAxis?.title,text:y[0].length>100?`${y[0].substring(0,100)}...`:y[0],rotate90:!0}):null]}),t.jsxRuntimeExports.jsxs("g",{children:[be.map((e,q)=>t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx("line",{y1:g(e),y2:g(e),x1:u+15,x2:u+20,style:{stroke:n[1],strokeWidth:1,...l?.yAxis?.gridLines||{}},className:r?.yAxis?.gridLines}),t.jsxRuntimeExports.jsx("text",{x:u+25,y:g(e),dy:"0.33em",dx:-2,style:{textAnchor:"start",fill:n[1],...l?.yAxis?.labels||{}},className:t.mo("text-xs",r?.yAxis?.labels),children:ae.numberFormattingFunction(e,"NA",A,M[1],S[1])})]},q)),t.jsxRuntimeExports.jsx(ye.Axis,{y1:0,y2:a,x1:u+15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:{stroke:n[1],...l?.xAxis?.axis||{}}}}),J?t.jsxRuntimeExports.jsx(we.AxisTitle,{x:u+m.right-15,y:a/2,style:{fill:n[1],...l?.yAxis?.title||{}},className:r?.yAxis?.title,text:y[1].length>100?`${y[1].substring(0,100)}...`:y[1],rotate90:!0}):null]}),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(ye.Axis,{y1:a,y2:a,x1:-15,x2:u+15,classNames:{axis:r?.xAxis?.axis},styles:{axis:l?.xAxis?.axis}}),t.jsxRuntimeExports.jsx(Oe.XTicksAndGridLines,{values:je.map(e=>F.format(e,j)),x:je.map(e=>c(e)),y1:0,y2:a,styles:{gridLines:l?.xAxis?.gridLines,labels:l?.xAxis?.labels},classNames:{gridLines:t.mo("opacity-0",r?.xAxis?.gridLines),labels:t.mo("fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs",r?.xAxis?.labels)},labelType:"primary",showGridLines:!0,precision:A})]}),H.filter(e=>e.position==="before").map(e=>e.layer),t.jsxRuntimeExports.jsxs("g",{children:[t.jsxRuntimeExports.jsx(b.motion.path,{style:{stroke:n[0],strokeWidth:Y,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:fe(i.filter(e=>!f.checkIfNullOrUndefined(e.y1)))||"",opacity:1},whileInView:{pathLength:1,d:fe(i.filter(e=>!f.checkIfNullOrUndefined(e.y1)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),t.jsxRuntimeExports.jsx(b.motion.path,{d:he(i.filter(e=>!f.checkIfNullOrUndefined(e.y2)))||"",style:{stroke:n[1],strokeWidth:Y,fill:"none"},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{pathLength:0,d:he(i.filter(e=>!f.checkIfNullOrUndefined(e.y2)))||"",opacity:1},whileInView:{pathLength:1,d:he(i.filter(e=>!f.checkIfNullOrUndefined(e.y2)))||"",opacity:1,transition:{duration:s.duration}}},initial:"initial",animate:d?"whileInView":"initial"}),I?t.jsxRuntimeExports.jsx("line",{y1:0,y2:a,x1:c(I.date),x2:c(I.date),className:t.mo("undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100",r?.mouseOverLine),style:l?.mouseOverLine}):null]}),t.jsxRuntimeExports.jsx("g",{children:i.map((e,q)=>t.jsxRuntimeExports.jsxs(b.motion.g,{children:[f.checkIfNullOrUndefined(e.y1)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(b.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[0]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:c(e.date),cy:L(e.y1)},whileInView:{opacity:1,transition:{duration:p?s.duration:.5,delay:p?0:s.duration},cx:c(e.date),cy:L(e.y1)}},initial:"initial",animate:d?"whileInView":"initial"}):null,G?t.jsxRuntimeExports.jsx(b.motion.text,{dy:f.checkIfNullOrUndefined(e.y2)||e.y2<e.y1?-8:"1em",style:{fill:n[0],textAnchor:"middle",...l?.graphObjectValues||{}},className:t.mo("graph-value graph-value-line-1 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:c(e.date),y:g(e.y1)},whileInView:{opacity:1,x:c(e.date),y:g(e.y1),transition:{duration:p?s.duration:.5,delay:p?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(e.y1,"NA",A,M[0],S[0])}):null]}),f.checkIfNullOrUndefined(e.y2)?null:t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[P?t.jsxRuntimeExports.jsx(b.motion.circle,{r:u/i.length<5?0:u/i.length<20?2:4,style:{fill:n[1]},exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,cx:c(e.date),cy:g(e.y2)},whileInView:{opacity:1,transition:{duration:p?s.duration:.5,delay:p?0:s.duration},cx:c(e.date),cy:g(e.y2)}},initial:"initial",animate:d?"whileInView":"initial"}):null,G?t.jsxRuntimeExports.jsx(b.motion.text,{dy:f.checkIfNullOrUndefined(e.y1)||e.y1<e.y2?-8:"1em",style:{fill:n[1],textAnchor:"middle",...l?.graphObjectValues||{}},className:t.mo("graph-value graph-value-line-2 text-xs font-bold",r?.graphObjectValues),exit:{opacity:0,transition:{duration:s.duration}},variants:{initial:{opacity:0,x:c(e.date),y:g(e.y2)},whileInView:{opacity:1,x:c(e.date),y:g(e.y2),transition:{duration:p?s.duration:.5,delay:p?0:s.duration}}},initial:"initial",animate:d?"whileInView":"initial",children:ae.numberFormattingFunction(e.y2,"NA",A,M[1],S[1])}):null]})]},q))}),H.filter(e=>e.position==="after").map(e=>e.layer),t.jsxRuntimeExports.jsx("rect",{ref:w,style:{fill:"none",pointerEvents:"all"},width:u,height:a})]})}),I&&v&&_&&te?t.jsxRuntimeExports.jsx(Ie.Tooltip,{data:I,body:v,xPos:_,yPos:te,backgroundStyle:l?.tooltip,className:r?.tooltip}):null]})}function He(le){const{data:k,graphTitle:R,sources:D,graphDescription:n,height:y,width:o,footNote:j,noOfXTicks:G=10,dateFormat:xe="yyyy",showValues:ce=!1,padding:W,lineColors:X=[Re.Colors.light.categoricalColors.colors[0],Re.Colors.light.categoricalColors.colors[1]],sameAxes:ue=!1,backgroundColor:v=!1,leftMargin:me=80,rightMargin:C=80,topMargin:s=20,bottomMargin:Y=25,labels:P,lineSuffixes:B=["",""],linePrefixes:S=["",""],tooltip:M,highlightAreaSettings:z=[],relativeHeight:N,onSeriesMouseOver:T,graphID:l,graphDownload:r=!1,dataDownload:A=!1,animate:H=!1,strokeWidth:J=2,showDots:K=!0,language:d="en",showColorScale:p=!0,minHeight:V=0,colorLegendTitle:Q,theme:I="light",ariaLabel:Z,noOfYTicks:_=5,maxDate:ee,minDate:te,curveType:ie="curve",styles:m,classNames:w,precision:i=2,customLayers:de=[],showAxisLabels:u=!0}=le,[a,se]=h.useState(0),[ne,$]=h.useState(0),E=h.useRef(null),O=h.useRef(null);return h.useEffect(()=>{const x=new ResizeObserver(U=>{se(o||U[0].target.clientWidth||620),$(y||U[0].target.clientHeight||480)});return E.current&&($(E.current.clientHeight||480),se(E.current.clientWidth||620),o||x.observe(E.current)),()=>x.disconnect()},[o,y]),t.jsxRuntimeExports.jsx("div",{className:`${I||"light"} flex ${o?"w-fit grow-0":"w-full grow"}`,dir:d==="he"||d==="ar"?"rtl":void 0,children:t.jsxRuntimeExports.jsx("div",{className:t.mo(`${v?v===!0?"bg-primary-gray-200 dark:bg-primary-gray-650 ":"":"bg-transparent "}ml-auto mr-auto flex flex-col grow h-inherit ${d||"en"}`,o?"w-fit":"w-full",w?.graphContainer),style:{...m?.graphContainer||{},...v&&v!==!0?{backgroundColor:v}:{}},id:l,ref:O,"aria-label":Z||`${R?`The graph shows ${R}. `:""}This is a line chart that show trends for two datasets over time.${n?` ${n}`:""}`,children:t.jsxRuntimeExports.jsx("div",{className:"flex grow",style:{padding:v?W||"1rem":W||0},children:t.jsxRuntimeExports.jsxs("div",{className:"flex flex-col w-full gap-4 grow justify-between",children:[R||n||r||A?t.jsxRuntimeExports.jsx($e.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:w?.title,description:w?.description},graphTitle:R,graphDescription:n,width:o,graphDownload:r?O.current:void 0,dataDownload:A?k.map(x=>x.data).filter(x=>x!==void 0).length>0?k.map(x=>x.data).filter(x=>x!==void 0):k.filter(x=>x!==void 0):null}):null,t.jsxRuntimeExports.jsx("div",{className:"grow flex flex-col justify-center gap-3 w-full",children:k.length===0?t.jsxRuntimeExports.jsx(Ce.EmptyState,{}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[p?null:t.jsxRuntimeExports.jsx(Fe.ColorLegend,{colorDomain:P,colorLegendTitle:Q,colors:X,showNAColor:!1}),t.jsxRuntimeExports.jsx("div",{className:"flex flex-col grow justify-center leading-0",ref:E,"aria-label":"Graph area",children:(o||a)&&(y||ne)?t.jsxRuntimeExports.jsx(Pe,{data:k,sameAxes:ue,lineColors:X,width:o||a,height:Math.max(V,y||(N?V?(o||a)*N>V?(o||a)*N:V:(o||a)*N:ne)),dateFormat:xe,showValues:ce,noOfXTicks:G,leftMargin:me,rightMargin:C,topMargin:s,bottomMargin:Y,labels:P,highlightAreaSettings:z,tooltip:M,onSeriesMouseOver:T,animate:H===!0?{duration:.5,once:!0,amount:.5}:H||{duration:0,once:!0,amount:0},strokeWidth:J,showDots:K,noOfYTicks:_,lineSuffixes:B,linePrefixes:S,minDate:te,maxDate:ee,curveType:ie,styles:m,classNames:w,precision:i,customLayers:de,showAxisLabels:u}):null})]})}),D||j?t.jsxRuntimeExports.jsx(Ve.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:w?.footnote,source:w?.source},sources:D,footNote:j,width:o}):null]})})})})}exports.DualAxisLineChart=He;
|
|
2
2
|
//# sourceMappingURL=DualAxisLineChart.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DualAxisLineChart.cjs","sources":["../src/Components/Graphs/LineCharts/DualAxisLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DualAxisLineChart/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport sortBy from 'lodash.sortby';\r\nimport { motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n DualAxisLineChartDataType,\r\n HighlightAreaSettingsDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: DualAxisLineChartDataType[];\r\n lineColors: [string, string];\r\n labels: [string, string];\r\n width: number;\r\n height: number;\r\n dateFormat: string;\r\n showValues: boolean;\r\n noOfXTicks: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n animate: AnimateDataType;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n noOfYTicks: number;\r\n lineSuffixes: [string, string];\r\n linePrefixes: [string, string];\r\n minDate?: string | number;\r\n maxDate?: string | number;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n}\r\n\r\ninterface FormattedDataType {\r\n y1: number;\r\n y2: number;\r\n date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColors,\r\n labels,\r\n sameAxes,\r\n dateFormat,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n highlightAreaSettings,\r\n onSeriesMouseOver,\r\n animate,\r\n strokeWidth,\r\n showDots,\r\n noOfYTicks,\r\n lineSuffixes,\r\n linePrefixes,\r\n minDate,\r\n maxDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const [hasAnimatedOnce, setHasAnimatedOnce] = useState(false);\r\n\r\n useEffect(() => {\r\n if (isInView && !hasAnimatedOnce) {\r\n const timeout = setTimeout(\r\n () => {\r\n setHasAnimatedOnce(true);\r\n },\r\n (animate.duration + 0.5) * 1000,\r\n );\r\n return () => clearTimeout(timeout);\r\n }\r\n }, [isInView, hasAnimatedOnce, animate.duration]);\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted = sortBy(\r\n data.map(d => ({\r\n ...d,\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n })),\r\n 'date',\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minYear = minDate ? parse(`${minDate}`, dateFormat, new Date()) : dataFormatted[0].date;\r\n const maxYear = maxDate\r\n ? parse(`${maxDate}`, dateFormat, new Date())\r\n : dataFormatted[dataFormatted.length - 1].date;\r\n const minParam1 =\r\n Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape1 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y1))\r\n .x(d => x(d.date))\r\n .y(d => y1(d.y1))\r\n .curve(curve);\r\n\r\n const lineShape2 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y2))\r\n .x(d => x(d.date))\r\n .y(d => y2(d.y2))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfYTicks);\r\n const y2Ticks = y2.ticks(noOfYTicks);\r\n const xTicks = x.ticks(noOfXTicks);\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mousemove = (event: any) => {\r\n const selectedData =\r\n dataFormatted[\r\n bisectCenter(\r\n dataFormatted.map(d => d.date),\r\n x.invert(pointer(event)[0]),\r\n 0,\r\n )\r\n ];\r\n setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n };\r\n const mouseout = () => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n };\r\n select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n }, [x, dataFormatted, onSeriesMouseOver]);\r\n\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <HighlightArea\r\n areaSettings={highlightAreaSettingsFormatted}\r\n width={graphWidth}\r\n height={graphHeight}\r\n scale={x}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: lineColors[0],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[0], lineSuffixes[0])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[0], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[0], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[0].length > 100 ? `${labels[0].substring(0, 100)}...` : labels[0]}\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColors[1],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[1], lineSuffixes[1])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[1], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[1], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[1].length > 100 ? `${labels[1].substring(0, 100)}...` : labels[1]}\r\n rotate90\r\n />\r\n </g>\r\n <g>\r\n <Axis\r\n y1={graphHeight}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n <XTicksAndGridLines\r\n values={xTicks.map(d => format(d, dateFormat))}\r\n x={xTicks.map(d => x(d))}\r\n y1={0}\r\n y2={graphHeight}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n labels: cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs',\r\n classNames?.xAxis?.labels,\r\n ),\r\n }}\r\n labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g>\r\n <motion.path\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n <motion.path\r\n d={\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || ''\r\n }\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {mouseOverData ? (\r\n <line\r\n y1={0}\r\n y2={graphHeight}\r\n x1={x(mouseOverData.date)}\r\n x2={x(mouseOverData.date)}\r\n className={cn(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y1) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y1(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y1(d.y1 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y2)\r\n ? -8\r\n : (d.y2 as number) < (d.y1 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[0],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-1 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y1 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y1,\r\n 'NA',\r\n precision,\r\n linePrefixes[0],\r\n lineSuffixes[0],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n {!checkIfNullOrUndefined(d.y2) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y2(d.y2 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y1)\r\n ? -8\r\n : (d.y1 as number) < (d.y2 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[1],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-2 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y2,\r\n 'NA',\r\n precision,\r\n linePrefixes[1],\r\n lineSuffixes[1],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n <rect\r\n ref={MouseoverRectRef}\r\n style={{\r\n fill: 'none',\r\n pointerEvents: 'all',\r\n }}\r\n width={graphWidth}\r\n height={graphHeight}\r\n />\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n DualAxisLineChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DualAxisLineChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for the 2 lines */\r\n lineColors?: [string, string];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values of the lines */\r\n linePrefixes?: [string, string];\r\n /** Suffix for values of the lines */\r\n lineSuffixes?: [string, string];\r\n /** Maximum value of the date for the chart */\r\n maxDate?: string | number;\r\n /** Minimum value of the date for the chart */\r\n minDate?: string | number;\r\n /** No. of ticks on the x-axis */\r\n noOfXTicks?: number;\r\n /** No. of ticks on the y-axis */\r\n noOfYTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of dots on the line */\r\n showDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Enables same axis for the 2 lines */\r\n sameAxes?: boolean;\r\n /** Toggle visibility of color scale. This is only applicable if the data props hae color parameter */\r\n showColorScale?: boolean;\r\n /** Labels for the lines */\r\n labels: [string, string];\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DualAxisLineChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n lineColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n labels,\r\n lineSuffixes = ['', ''],\r\n linePrefixes = ['', ''],\r\n tooltip,\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n strokeWidth = 2,\r\n showDots = true,\r\n language = 'en',\r\n showColorScale = true,\r\n minHeight = 0,\r\n colorLegendTitle,\r\n theme = 'light',\r\n ariaLabel,\r\n noOfYTicks = 5,\r\n maxDate,\r\n minDate,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a line chart that show trends for two datasets over time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? null : (\r\n <ColorLegend\r\n colorDomain={labels}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={lineColors}\r\n showNAColor={false}\r\n />\r\n )}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n sameAxes={sameAxes}\r\n lineColors={lineColors}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\r\n noOfXTicks={noOfXTicks}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n labels={labels}\r\n highlightAreaSettings={highlightAreaSettings}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n noOfYTicks={noOfYTicks}\r\n lineSuffixes={lineSuffixes}\r\n linePrefixes={linePrefixes}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n curveType={curveType}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n customLayers={customLayers}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","lineColors","labels","sameAxes","dateFormat","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","highlightAreaSettings","onSeriesMouseOver","animate","strokeWidth","showDots","noOfYTicks","lineSuffixes","linePrefixes","minDate","maxDate","curveType","styles","classNames","precision","customLayers","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","sortBy","d","parse","highlightAreaSettingsFormatted","graphWidth","graphHeight","minYear","maxYear","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","scaleTime","y1","scaleLinear","y2","lineShape1","line","checkIfNullOrUndefined","lineShape2","y1Ticks","y2Ticks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","jsxs","Fragment","jsx","motion","HighlightArea","i","cn","numberFormattingFunction","Axis","AxisTitle","XTicksAndGridLines","format","el","Tooltip","DualAxisLineChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","showColorScale","minHeight","colorLegendTitle","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":"s+BA2EO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,WAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,EACA,WAAAC,GACA,YAAAC,GACA,WAAAC,EACA,UAAAC,EACA,aAAAC,GACA,QAAAC,EACA,sBAAAC,GACA,kBAAAC,EACA,QAAAC,EACA,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,QAAAC,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,EACA,aAAAC,CAAA,EACE7B,GACE8B,EAASC,EAAAA,OAAO,IAAI,EACpBC,EAAWC,GAAAA,UAAUH,EAAQ,CACjC,KAAMb,EAAQ,KACd,OAAQA,EAAQ,MAAA,CACjB,EACK,CAACiB,EAAiBC,EAAkB,EAAIC,EAAAA,SAAS,EAAK,EAE5DC,EAAAA,UAAU,IAAM,CACd,GAAIL,GAAY,CAACE,EAAiB,CAChC,MAAMI,EAAU,W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,kBAAAA,IAAC,MAAA,CACC,UAAU,8CACV,IAAKkC,EACL,aAAW,aAET,UAAAxH,GAASoH,KAAcnH,GAAUqH,IACjChC,EAAAA,kBAAAA,IAACzF,GAAA,CACC,KAAAE,EACA,SAAAK,GACA,WAAAF,EACA,MAAOF,GAASoH,EAChB,OAAQ,KAAK,IACXJ,EACA/G,IACGyG,EACGM,GACGhH,GAASoH,GAAYV,EAAiBM,GACpChH,GAASoH,GAAYV,EACtBM,GACDhH,GAASoH,GAAYV,EACxBY,GAAA,EAER,WAAAjH,GACA,WAAAC,GACA,WAAAC,EACA,WAAAE,GACA,YAAAD,EACA,UAAAE,EACA,aAAAC,EACA,OAAAR,EACA,sBAAAU,EACA,QAAAD,EACA,kBAAAE,EACA,QACEC,IAAY,GACR,CAAE,SAAU,GAAK,KAAM,GAAM,OAAQ,EAAA,EACrCA,GAAW,CAAE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,QAAAC,GACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,GACA,aAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAEJ,EACCyE,GAAWE,EACVhB,EAAAA,kBAAAA,IAACyC,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAUvG,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAA2E,EACA,SAAAE,EACA,MAAAtG,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"DualAxisLineChart.cjs","sources":["../src/Components/Graphs/LineCharts/DualAxisLineChart/Graph.tsx","../src/Components/Graphs/LineCharts/DualAxisLineChart/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\r\nimport {\r\n line,\r\n curveMonotoneX,\r\n curveLinear,\r\n curveStep,\r\n curveStepAfter,\r\n curveStepBefore,\r\n} from 'd3-shape';\r\nimport { scaleLinear, scaleTime } from 'd3-scale';\r\nimport { format } from 'date-fns/format';\r\nimport { parse } from 'date-fns/parse';\r\nimport { bisectCenter } from 'd3-array';\r\nimport { pointer, select } from 'd3-selection';\r\nimport sortBy from 'lodash.sortby';\r\nimport { motion, useInView } from 'motion/react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport {\r\n AnimateDataType,\r\n ClassNameObject,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n DualAxisLineChartDataType,\r\n HighlightAreaSettingsDataType,\r\n StyleObject,\r\n} from '@/Types';\r\nimport { numberFormattingFunction } from '@/Utils/numberFormattingFunction';\r\nimport { Tooltip } from '@/Components/Elements/Tooltip';\r\nimport { checkIfNullOrUndefined } from '@/Utils/checkIfNullOrUndefined';\r\nimport { XTicksAndGridLines } from '@/Components/Elements/Axes/XTicksAndGridLines';\r\nimport { Axis } from '@/Components/Elements/Axes/Axis';\r\nimport { AxisTitle } from '@/Components/Elements/Axes/AxisTitle';\r\nimport { HighlightArea } from '@/Components/Elements/HighlightArea';\r\n\r\ninterface Props {\r\n data: DualAxisLineChartDataType[];\r\n lineColors: [string, string];\r\n labels: [string, string];\r\n width: number;\r\n height: number;\r\n dateFormat: string;\r\n showValues: boolean;\r\n noOfXTicks: number;\r\n rightMargin: number;\r\n leftMargin: number;\r\n topMargin: number;\r\n bottomMargin: number;\r\n sameAxes: boolean;\r\n highlightAreaSettings: HighlightAreaSettingsDataType[];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n animate: AnimateDataType;\r\n strokeWidth: number;\r\n showDots: boolean;\r\n noOfYTicks: number;\r\n lineSuffixes: [string, string];\r\n linePrefixes: [string, string];\r\n minDate?: string | number;\r\n maxDate?: string | number;\r\n curveType: CurveTypes;\r\n styles?: StyleObject;\r\n classNames?: ClassNameObject;\r\n precision: number;\r\n customLayers: CustomLayerDataType[];\r\n showAxisLabels: boolean;\r\n}\r\n\r\ninterface FormattedDataType {\r\n y1: number;\r\n y2: number;\r\n date: Date;\r\n}\r\n\r\nexport function Graph(props: Props) {\r\n const {\r\n data,\r\n width,\r\n height,\r\n lineColors,\r\n labels,\r\n sameAxes,\r\n dateFormat,\r\n showValues,\r\n noOfXTicks,\r\n rightMargin,\r\n leftMargin,\r\n topMargin,\r\n bottomMargin,\r\n tooltip,\r\n highlightAreaSettings,\r\n onSeriesMouseOver,\r\n animate,\r\n strokeWidth,\r\n showDots,\r\n noOfYTicks,\r\n lineSuffixes,\r\n linePrefixes,\r\n minDate,\r\n maxDate,\r\n curveType,\r\n styles,\r\n classNames,\r\n precision,\r\n customLayers,\r\n showAxisLabels,\r\n } = props;\r\n const svgRef = useRef(null);\r\n const isInView = useInView(svgRef, {\r\n once: animate.once,\r\n amount: animate.amount,\r\n });\r\n const [hasAnimatedOnce, setHasAnimatedOnce] = useState(false);\r\n\r\n useEffect(() => {\r\n if (isInView && !hasAnimatedOnce) {\r\n const timeout = setTimeout(\r\n () => {\r\n setHasAnimatedOnce(true);\r\n },\r\n (animate.duration + 0.5) * 1000,\r\n );\r\n return () => clearTimeout(timeout);\r\n }\r\n }, [isInView, hasAnimatedOnce, animate.duration]);\r\n const curve =\r\n curveType === 'linear'\r\n ? curveLinear\r\n : curveType === 'step'\r\n ? curveStep\r\n : curveType === 'stepAfter'\r\n ? curveStepAfter\r\n : curveType === 'stepBefore'\r\n ? curveStepBefore\r\n : curveMonotoneX;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const [mouseOverData, setMouseOverData] = useState<any>(undefined);\r\n const [eventX, setEventX] = useState<number | undefined>(undefined);\r\n const [eventY, setEventY] = useState<number | undefined>(undefined);\r\n const margin = {\r\n top: topMargin,\r\n bottom: bottomMargin,\r\n left: leftMargin + 50,\r\n right: rightMargin + 65,\r\n };\r\n const MouseoverRectRef = useRef(null);\r\n const dataFormatted = sortBy(\r\n data.map(d => ({\r\n ...d,\r\n date: parse(`${d.date}`, dateFormat, new Date()),\r\n })),\r\n 'date',\r\n );\r\n const highlightAreaSettingsFormatted = highlightAreaSettings.map(d => ({\r\n ...d,\r\n coordinates: [\r\n d.coordinates[0] === null ? null : parse(`${d.coordinates[0]}`, dateFormat, new Date()),\r\n d.coordinates[1] === null ? null : parse(`${d.coordinates[1]}`, dateFormat, new Date()),\r\n ],\r\n }));\r\n const graphWidth = width - margin.left - margin.right;\r\n const graphHeight = height - margin.top - margin.bottom;\r\n const minYear = minDate ? parse(`${minDate}`, dateFormat, new Date()) : dataFormatted[0].date;\r\n const maxYear = maxDate\r\n ? parse(`${maxDate}`, dateFormat, new Date())\r\n : dataFormatted[dataFormatted.length - 1].date;\r\n const minParam1 =\r\n Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const minParam2 =\r\n Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) > 0\r\n ? 0\r\n : Math.min(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam1 =\r\n Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y1).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n const maxParam2 =\r\n Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null)) !==\r\n Infinity\r\n ? Math.max(...dataFormatted.map(d => d.y2).filter(d => d !== undefined && d !== null))\r\n : 0;\r\n\r\n const minParam = minParam1 < minParam2 ? minParam1 : minParam2;\r\n const maxParam = maxParam1 > maxParam2 ? maxParam1 : maxParam2;\r\n const x = scaleTime().domain([minYear, maxYear]).range([0, graphWidth]);\r\n\r\n const y1 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam1,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam1 > 0 ? maxParam1 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n const y2 = scaleLinear()\r\n .domain([\r\n sameAxes ? minParam : minParam2,\r\n sameAxes ? (maxParam > 0 ? maxParam : 0) : maxParam2 > 0 ? maxParam2 : 0,\r\n ])\r\n .range([graphHeight, 0])\r\n .nice();\r\n\r\n const lineShape1 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y1))\r\n .x(d => x(d.date))\r\n .y(d => y1(d.y1))\r\n .curve(curve);\r\n\r\n const lineShape2 = line<FormattedDataType>()\r\n .defined(d => !checkIfNullOrUndefined(d.y2))\r\n .x(d => x(d.date))\r\n .y(d => y2(d.y2))\r\n .curve(curve);\r\n const y1Ticks = y1.ticks(noOfYTicks);\r\n const y2Ticks = y2.ticks(noOfYTicks);\r\n const xTicks = x.ticks(noOfXTicks);\r\n useEffect(() => {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const mousemove = (event: any) => {\r\n const selectedData =\r\n dataFormatted[\r\n bisectCenter(\r\n dataFormatted.map(d => d.date),\r\n x.invert(pointer(event)[0]),\r\n 0,\r\n )\r\n ];\r\n setMouseOverData(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n onSeriesMouseOver?.(selectedData || dataFormatted[dataFormatted.length - 1]);\r\n setEventY(event.clientY);\r\n setEventX(event.clientX);\r\n };\r\n const mouseout = () => {\r\n setMouseOverData(undefined);\r\n setEventX(undefined);\r\n setEventY(undefined);\r\n onSeriesMouseOver?.(undefined);\r\n };\r\n select(MouseoverRectRef.current).on('mousemove', mousemove).on('mouseout', mouseout);\r\n }, [x, dataFormatted, onSeriesMouseOver]);\r\n\r\n return (\r\n <>\r\n <motion.svg\r\n width={`${width}px`}\r\n height={`${height}px`}\r\n viewBox={`0 0 ${width} ${height}`}\r\n direction='ltr'\r\n ref={svgRef}\r\n >\r\n <g transform={`translate(${margin.left},${margin.top})`}>\r\n <HighlightArea\r\n areaSettings={highlightAreaSettingsFormatted}\r\n width={graphWidth}\r\n height={graphHeight}\r\n scale={x}\r\n animate={animate}\r\n isInView={isInView}\r\n />\r\n <g>\r\n {y1Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y1(d)}\r\n y2={y1(d)}\r\n x1={-15}\r\n x2={-20}\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={0 - 25}\r\n y={y1(d)}\r\n dy='0.33em'\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n style={{\r\n textAnchor: 'end',\r\n fill: lineColors[0],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[0], lineSuffixes[0])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={-15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[0], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={10 - margin.left}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[0], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[0].length > 100 ? `${labels[0].substring(0, 100)}...` : labels[0]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {y2Ticks.map((d, i) => (\r\n <g key={i}>\r\n <line\r\n y1={y2(d)}\r\n y2={y2(d)}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 20}\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth: 1,\r\n ...(styles?.yAxis?.gridLines || {}),\r\n }}\r\n className={classNames?.yAxis?.gridLines}\r\n />\r\n <text\r\n x={graphWidth + 25}\r\n y={y2(d)}\r\n dy='0.33em'\r\n dx={-2}\r\n style={{\r\n textAnchor: 'start',\r\n fill: lineColors[1],\r\n ...(styles?.yAxis?.labels || {}),\r\n }}\r\n className={cn('text-xs', classNames?.yAxis?.labels)}\r\n >\r\n {numberFormattingFunction(d, 'NA', precision, linePrefixes[1], lineSuffixes[1])}\r\n </text>\r\n </g>\r\n ))}\r\n <Axis\r\n y1={0}\r\n y2={graphHeight}\r\n x1={graphWidth + 15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: { stroke: lineColors[1], ...(styles?.xAxis?.axis || {}) } }}\r\n />\r\n {showAxisLabels ? (\r\n <AxisTitle\r\n x={graphWidth + margin.right - 15}\r\n y={graphHeight / 2}\r\n style={{ fill: lineColors[1], ...(styles?.yAxis?.title || {}) }}\r\n className={classNames?.yAxis?.title}\r\n text={labels[1].length > 100 ? `${labels[1].substring(0, 100)}...` : labels[1]}\r\n rotate90\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n <Axis\r\n y1={graphHeight}\r\n y2={graphHeight}\r\n x1={-15}\r\n x2={graphWidth + 15}\r\n classNames={{ axis: classNames?.xAxis?.axis }}\r\n styles={{ axis: styles?.xAxis?.axis }}\r\n />\r\n <XTicksAndGridLines\r\n values={xTicks.map(d => format(d, dateFormat))}\r\n x={xTicks.map(d => x(d))}\r\n y1={0}\r\n y2={graphHeight}\r\n styles={{\r\n gridLines: styles?.xAxis?.gridLines,\r\n labels: styles?.xAxis?.labels,\r\n }}\r\n classNames={{\r\n gridLines: cn('opacity-0', classNames?.xAxis?.gridLines),\r\n labels: cn(\r\n 'fill-primary-gray-700 dark:fill-primary-gray-300 xs:max-[360px]:hidden text-[9px] md:text-[10px] lg:text-xs',\r\n classNames?.xAxis?.labels,\r\n ),\r\n }}\r\n labelType='primary'\r\n showGridLines\r\n precision={precision}\r\n />\r\n </g>\r\n {customLayers.filter(d => d.position === 'before').map(d => d.layer)}\r\n <g>\r\n <motion.path\r\n style={{\r\n stroke: lineColors[0],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape1(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y1),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n <motion.path\r\n d={\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || ''\r\n }\r\n style={{\r\n stroke: lineColors[1],\r\n strokeWidth,\r\n fill: 'none',\r\n }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: {\r\n pathLength: 0,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n },\r\n whileInView: {\r\n pathLength: 1,\r\n d:\r\n lineShape2(\r\n dataFormatted.filter(\r\n (el): el is FormattedDataType => !checkIfNullOrUndefined(el.y2),\r\n ),\r\n ) || '',\r\n opacity: 1,\r\n transition: { duration: animate.duration },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n {mouseOverData ? (\r\n <line\r\n y1={0}\r\n y2={graphHeight}\r\n x1={x(mouseOverData.date)}\r\n x2={x(mouseOverData.date)}\r\n className={cn(\r\n 'undp-tick-line stroke-primary-gray-700 dark:stroke-primary-gray-100',\r\n classNames?.mouseOverLine,\r\n )}\r\n style={styles?.mouseOverLine}\r\n />\r\n ) : null}\r\n </g>\r\n <g>\r\n {dataFormatted.map((d, i) => (\r\n <motion.g key={i}>\r\n {!checkIfNullOrUndefined(d.y1) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[0] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y1(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y1(d.y1 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y2)\r\n ? -8\r\n : (d.y2 as number) < (d.y1 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[0],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-1 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y1 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y1 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y1,\r\n 'NA',\r\n precision,\r\n linePrefixes[0],\r\n lineSuffixes[0],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n {!checkIfNullOrUndefined(d.y2) ? (\r\n <>\r\n {showDots ? (\r\n <motion.circle\r\n r={\r\n graphWidth / dataFormatted.length < 5\r\n ? 0\r\n : graphWidth / dataFormatted.length < 20\r\n ? 2\r\n : 4\r\n }\r\n style={{ fill: lineColors[1] }}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, cx: x(d.date), cy: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n cx: x(d.date),\r\n cy: y2(d.y2 as number),\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n />\r\n ) : null}\r\n {showValues ? (\r\n <motion.text\r\n dy={\r\n checkIfNullOrUndefined(d.y1)\r\n ? -8\r\n : (d.y1 as number) < (d.y2 as number)\r\n ? -8\r\n : '1em'\r\n }\r\n style={{\r\n fill: lineColors[1],\r\n textAnchor: 'middle',\r\n ...(styles?.graphObjectValues || {}),\r\n }}\r\n className={cn(\r\n 'graph-value graph-value-line-2 text-xs font-bold',\r\n classNames?.graphObjectValues,\r\n )}\r\n exit={{ opacity: 0, transition: { duration: animate.duration } }}\r\n variants={{\r\n initial: { opacity: 0, x: x(d.date), y: y2(d.y2 as number) },\r\n whileInView: {\r\n opacity: 1,\r\n x: x(d.date),\r\n y: y2(d.y2 as number),\r\n transition: {\r\n duration: hasAnimatedOnce ? animate.duration : 0.5,\r\n delay: hasAnimatedOnce ? 0 : animate.duration,\r\n },\r\n },\r\n }}\r\n initial='initial'\r\n animate={isInView ? 'whileInView' : 'initial'}\r\n >\r\n {numberFormattingFunction(\r\n d.y2,\r\n 'NA',\r\n precision,\r\n linePrefixes[1],\r\n lineSuffixes[1],\r\n )}\r\n </motion.text>\r\n ) : null}\r\n </>\r\n ) : null}\r\n </motion.g>\r\n ))}\r\n </g>\r\n {customLayers.filter(d => d.position === 'after').map(d => d.layer)}\r\n <rect\r\n ref={MouseoverRectRef}\r\n style={{\r\n fill: 'none',\r\n pointerEvents: 'all',\r\n }}\r\n width={graphWidth}\r\n height={graphHeight}\r\n />\r\n </g>\r\n </motion.svg>\r\n {mouseOverData && tooltip && eventX && eventY ? (\r\n <Tooltip\r\n data={mouseOverData}\r\n body={tooltip}\r\n xPos={eventX}\r\n yPos={eventY}\r\n backgroundStyle={styles?.tooltip}\r\n className={classNames?.tooltip}\r\n />\r\n ) : null}\r\n </>\r\n );\r\n}\r\n","import { useState, useRef, useEffect } from 'react';\r\nimport { cn } from '@undp/design-system-react/cn';\r\n\r\nimport { Graph } from './Graph';\r\n\r\nimport { GraphFooter } from '@/Components/Elements/GraphFooter';\r\nimport { GraphHeader } from '@/Components/Elements/GraphHeader';\r\nimport { ColorLegend } from '@/Components/Elements/ColorLegend';\r\nimport {\r\n DualAxisLineChartDataType,\r\n Languages,\r\n SourcesDataType,\r\n StyleObject,\r\n ClassNameObject,\r\n HighlightAreaSettingsDataType,\r\n CurveTypes,\r\n CustomLayerDataType,\r\n AnimateDataType,\r\n} from '@/Types';\r\nimport { Colors } from '@/Components/ColorPalette';\r\nimport { EmptyState } from '@/Components/Elements/EmptyState';\r\n\r\ninterface Props {\r\n // Data\r\n /** Array of data objects */\r\n data: DualAxisLineChartDataType[];\r\n\r\n // Titles, Labels, and Sources\r\n /** Title of the graph */\r\n graphTitle?: string | React.ReactNode;\r\n /** Description of the graph */\r\n graphDescription?: string | React.ReactNode;\r\n /** Footnote for the graph */\r\n footNote?: string | React.ReactNode;\r\n /** Source data for the graph */\r\n sources?: SourcesDataType[];\r\n /** Accessibility label */\r\n ariaLabel?: string;\r\n\r\n // Colors and Styling\r\n /** Array of colors for the 2 lines */\r\n lineColors?: [string, string];\r\n /** Title for the color legend */\r\n colorLegendTitle?: string;\r\n /** Background color of the graph */\r\n backgroundColor?: string | boolean;\r\n /** Custom styles for the graph. Each object should be a valid React CSS style object. */\r\n styles?: StyleObject;\r\n /** Custom class names */\r\n classNames?: ClassNameObject;\r\n\r\n // Size and Spacing\r\n /** Width of the graph */\r\n width?: number;\r\n /** Height of the graph */\r\n height?: number;\r\n /** Minimum height of the graph */\r\n minHeight?: number;\r\n /** Relative height scaling factor. This overwrites the height props */\r\n relativeHeight?: number;\r\n /** Padding around the graph. Defaults to 0 if no backgroundColor is mentioned else defaults to 1rem */\r\n padding?: string;\r\n /** Left margin of the graph */\r\n leftMargin?: number;\r\n /** Right margin of the graph */\r\n rightMargin?: number;\r\n /** Top margin of the graph */\r\n topMargin?: number;\r\n /** Bottom margin of the graph */\r\n bottomMargin?: number;\r\n\r\n // Values and Ticks\r\n /** Prefix for values of the lines */\r\n linePrefixes?: [string, string];\r\n /** Suffix for values of the lines */\r\n lineSuffixes?: [string, string];\r\n /** Maximum value of the date for the chart */\r\n maxDate?: string | number;\r\n /** Minimum value of the date for the chart */\r\n minDate?: string | number;\r\n /** No. of ticks on the x-axis */\r\n noOfXTicks?: number;\r\n /** No. of ticks on the y-axis */\r\n noOfYTicks?: number;\r\n\r\n // Graph Parameters\r\n /** Toggle visibility of values */\r\n showValues?: boolean;\r\n /** Toggle visibility of dots on the line */\r\n showDots?: boolean;\r\n /** Stroke width of the line */\r\n strokeWidth?: number;\r\n /** Toggle the initial animation of the line. If the type is number then it uses the number as the time in seconds for animation. */\r\n animate?: boolean | AnimateDataType;\r\n /** Enables same axis for the 2 lines */\r\n sameAxes?: boolean;\r\n /** Toggle visibility of color scale. */\r\n showColorScale?: boolean;\r\n /** Toggle visibility of labels of the axis. */\r\n showAxisLabels?: boolean;\r\n /** Labels for the lines */\r\n labels: [string, string];\r\n /** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */\r\n dateFormat?: string;\r\n /** Highlighted area(square) on the chart */\r\n highlightAreaSettings?: HighlightAreaSettingsDataType[];\r\n /** Curve type for the line */\r\n curveType?: CurveTypes;\r\n /** Specifies the number of decimal places to display in the value. */\r\n precision?: number;\r\n /** Optional SVG <g> element or function that renders custom content behind or in front of the graph. */\r\n customLayers?: CustomLayerDataType[];\r\n /** Enable graph download option as png */\r\n graphDownload?: boolean;\r\n /** Enable data download option as a csv */\r\n dataDownload?: boolean;\r\n\r\n // Interactions and Callbacks\r\n /** Tooltip content. If the type is string then this uses the [handlebar](../?path=/docs/misc-handlebars-templates-and-custom-helpers--docs) template to display the data */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n tooltip?: string | ((_d: any) => React.ReactNode);\r\n /** Callback for mouse over event */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n onSeriesMouseOver?: (_d: any) => void;\r\n\r\n // Configuration and Options\r\n /** Language setting */\r\n language?: Languages;\r\n /** Color theme */\r\n theme?: 'light' | 'dark';\r\n /** Unique ID for the graph */\r\n graphID?: string;\r\n}\r\n\r\nexport function DualAxisLineChart(props: Props) {\r\n const {\r\n data,\r\n graphTitle,\r\n sources,\r\n graphDescription,\r\n height,\r\n width,\r\n footNote,\r\n noOfXTicks = 10,\r\n dateFormat = 'yyyy',\r\n showValues = false,\r\n padding,\r\n lineColors = [\r\n Colors.light.categoricalColors.colors[0],\r\n Colors.light.categoricalColors.colors[1],\r\n ],\r\n sameAxes = false,\r\n backgroundColor = false,\r\n leftMargin = 80,\r\n rightMargin = 80,\r\n topMargin = 20,\r\n bottomMargin = 25,\r\n labels,\r\n lineSuffixes = ['', ''],\r\n linePrefixes = ['', ''],\r\n tooltip,\r\n highlightAreaSettings = [],\r\n relativeHeight,\r\n onSeriesMouseOver,\r\n graphID,\r\n graphDownload = false,\r\n dataDownload = false,\r\n animate = false,\r\n strokeWidth = 2,\r\n showDots = true,\r\n language = 'en',\r\n showColorScale = true,\r\n minHeight = 0,\r\n colorLegendTitle,\r\n theme = 'light',\r\n ariaLabel,\r\n noOfYTicks = 5,\r\n maxDate,\r\n minDate,\r\n curveType = 'curve',\r\n styles,\r\n classNames,\r\n precision = 2,\r\n customLayers = [],\r\n showAxisLabels = true,\r\n } = props;\r\n\r\n const [svgWidth, setSvgWidth] = useState(0);\r\n const [svgHeight, setSvgHeight] = useState(0);\r\n\r\n const graphDiv = useRef<HTMLDivElement>(null);\r\n const graphParentDiv = useRef<HTMLDivElement>(null);\r\n useEffect(() => {\r\n const resizeObserver = new ResizeObserver(entries => {\r\n setSvgWidth(width || entries[0].target.clientWidth || 620);\r\n setSvgHeight(height || entries[0].target.clientHeight || 480);\r\n });\r\n if (graphDiv.current) {\r\n setSvgHeight(graphDiv.current.clientHeight || 480);\r\n setSvgWidth(graphDiv.current.clientWidth || 620);\r\n if (!width) resizeObserver.observe(graphDiv.current);\r\n }\r\n return () => resizeObserver.disconnect();\r\n }, [width, height]);\r\n\r\n return (\r\n <div\r\n className={`${theme || 'light'} flex ${width ? 'w-fit grow-0' : 'w-full grow'}`}\r\n dir={language === 'he' || language === 'ar' ? 'rtl' : undefined}\r\n >\r\n <div\r\n className={cn(\r\n `${\r\n !backgroundColor\r\n ? 'bg-transparent '\r\n : backgroundColor === true\r\n ? 'bg-primary-gray-200 dark:bg-primary-gray-650 '\r\n : ''\r\n }ml-auto mr-auto flex flex-col grow h-inherit ${language || 'en'}`,\r\n width ? 'w-fit' : 'w-full',\r\n classNames?.graphContainer,\r\n )}\r\n style={{\r\n ...(styles?.graphContainer || {}),\r\n ...(backgroundColor && backgroundColor !== true ? { backgroundColor } : {}),\r\n }}\r\n id={graphID}\r\n ref={graphParentDiv}\r\n aria-label={\r\n ariaLabel ||\r\n `${\r\n graphTitle ? `The graph shows ${graphTitle}. ` : ''\r\n }This is a line chart that show trends for two datasets over time.${\r\n graphDescription ? ` ${graphDescription}` : ''\r\n }`\r\n }\r\n >\r\n <div\r\n className='flex grow'\r\n style={{ padding: backgroundColor ? padding || '1rem' : padding || 0 }}\r\n >\r\n <div className='flex flex-col w-full gap-4 grow justify-between'>\r\n {graphTitle || graphDescription || graphDownload || dataDownload ? (\r\n <GraphHeader\r\n styles={{\r\n title: styles?.title,\r\n description: styles?.description,\r\n }}\r\n classNames={{\r\n title: classNames?.title,\r\n description: classNames?.description,\r\n }}\r\n graphTitle={graphTitle}\r\n graphDescription={graphDescription}\r\n width={width}\r\n graphDownload={graphDownload ? graphParentDiv.current : undefined}\r\n dataDownload={\r\n dataDownload\r\n ? data.map(d => d.data).filter(d => d !== undefined).length > 0\r\n ? data.map(d => d.data).filter(d => d !== undefined)\r\n : data.filter(d => d !== undefined)\r\n : null\r\n }\r\n />\r\n ) : null}\r\n <div className='grow flex flex-col justify-center gap-3 w-full'>\r\n {data.length === 0 ? (\r\n <EmptyState />\r\n ) : (\r\n <>\r\n {showColorScale ? null : (\r\n <ColorLegend\r\n colorDomain={labels}\r\n colorLegendTitle={colorLegendTitle}\r\n colors={lineColors}\r\n showNAColor={false}\r\n />\r\n )}\r\n <div\r\n className='flex flex-col grow justify-center leading-0'\r\n ref={graphDiv}\r\n aria-label='Graph area'\r\n >\r\n {(width || svgWidth) && (height || svgHeight) ? (\r\n <Graph\r\n data={data}\r\n sameAxes={sameAxes}\r\n lineColors={lineColors}\r\n width={width || svgWidth}\r\n height={Math.max(\r\n minHeight,\r\n height ||\r\n (relativeHeight\r\n ? minHeight\r\n ? (width || svgWidth) * relativeHeight > minHeight\r\n ? (width || svgWidth) * relativeHeight\r\n : minHeight\r\n : (width || svgWidth) * relativeHeight\r\n : svgHeight),\r\n )}\r\n dateFormat={dateFormat}\r\n showValues={showValues}\r\n noOfXTicks={noOfXTicks}\r\n leftMargin={leftMargin}\r\n rightMargin={rightMargin}\r\n topMargin={topMargin}\r\n bottomMargin={bottomMargin}\r\n labels={labels}\r\n highlightAreaSettings={highlightAreaSettings}\r\n tooltip={tooltip}\r\n onSeriesMouseOver={onSeriesMouseOver}\r\n animate={\r\n animate === true\r\n ? { duration: 0.5, once: true, amount: 0.5 }\r\n : animate || { duration: 0, once: true, amount: 0 }\r\n }\r\n strokeWidth={strokeWidth}\r\n showDots={showDots}\r\n noOfYTicks={noOfYTicks}\r\n lineSuffixes={lineSuffixes}\r\n linePrefixes={linePrefixes}\r\n minDate={minDate}\r\n maxDate={maxDate}\r\n curveType={curveType}\r\n styles={styles}\r\n classNames={classNames}\r\n precision={precision}\r\n customLayers={customLayers}\r\n showAxisLabels={showAxisLabels}\r\n />\r\n ) : null}\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n {sources || footNote ? (\r\n <GraphFooter\r\n styles={{ footnote: styles?.footnote, source: styles?.source }}\r\n classNames={{\r\n footnote: classNames?.footnote,\r\n source: classNames?.source,\r\n }}\r\n sources={sources}\r\n footNote={footNote}\r\n width={width}\r\n />\r\n ) : null}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"names":["Graph","props","data","width","height","lineColors","labels","sameAxes","dateFormat","showValues","noOfXTicks","rightMargin","leftMargin","topMargin","bottomMargin","tooltip","highlightAreaSettings","onSeriesMouseOver","animate","strokeWidth","showDots","noOfYTicks","lineSuffixes","linePrefixes","minDate","maxDate","curveType","styles","classNames","precision","customLayers","showAxisLabels","svgRef","useRef","isInView","useInView","hasAnimatedOnce","setHasAnimatedOnce","useState","useEffect","timeout","curve","curveLinear","curveStep","curveStepAfter","curveStepBefore","curveMonotoneX","mouseOverData","setMouseOverData","eventX","setEventX","eventY","setEventY","margin","MouseoverRectRef","dataFormatted","sortBy","d","parse","highlightAreaSettingsFormatted","graphWidth","graphHeight","minYear","maxYear","minParam1","minParam2","maxParam1","maxParam2","minParam","maxParam","x","scaleTime","y1","scaleLinear","y2","lineShape1","line","checkIfNullOrUndefined","lineShape2","y1Ticks","y2Ticks","xTicks","mousemove","event","selectedData","bisectCenter","pointer","mouseout","select","jsxs","Fragment","jsx","motion","HighlightArea","i","cn","numberFormattingFunction","Axis","AxisTitle","XTicksAndGridLines","format","el","Tooltip","DualAxisLineChart","graphTitle","sources","graphDescription","footNote","padding","Colors","backgroundColor","relativeHeight","graphID","graphDownload","dataDownload","language","showColorScale","minHeight","colorLegendTitle","theme","ariaLabel","svgWidth","setSvgWidth","svgHeight","setSvgHeight","graphDiv","graphParentDiv","resizeObserver","entries","GraphHeader","EmptyState","ColorLegend","GraphFooter"],"mappings":"s+BA4EO,SAASA,GAAMC,GAAc,CAClC,KAAM,CACJ,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,WAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,EACA,WAAAC,GACA,YAAAC,GACA,WAAAC,EACA,UAAAC,EACA,aAAAC,GACA,QAAAC,EACA,sBAAAC,GACA,kBAAAC,EACA,QAAAC,EACA,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,QAAAC,EACA,QAAAC,EACA,UAAAC,EACA,OAAAC,EACA,WAAAC,EACA,UAAAC,EACA,aAAAC,EACA,eAAAC,CAAA,EACE9B,GACE+B,EAASC,EAAAA,OAAO,IAAI,EACpBC,EAAWC,GAAAA,UAAUH,EAAQ,CACjC,KAAMd,EAAQ,KACd,OAAQA,EAAQ,MAAA,CACjB,EACK,CAACkB,EAAiBC,CAAkB,EAAIC,EAAAA,SAAS,EAAK,EAE5DC,EAAAA,UAAU,IAAM,CACd,GAAIL,GAAY,CAACE,EAAiB,CAChC,MAAMI,EAAU,WACd,IAAM,CACJH,EAAmB,EAAI,CACzB,GACCnB,EAAQ,SAAW,IAAO,GAAA,EAE7B,MAAO,IAAM,aAAasB,C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AAAA,kBAAAA,IAAC,MAAA,CACC,UAAU,8CACV,IAAKkC,EACL,aAAW,aAET,UAAA1H,GAASsH,KAAcrH,GAAUuH,IACjChC,EAAAA,kBAAAA,IAAC3F,GAAA,CACC,KAAAE,EACA,SAAAK,GACA,WAAAF,EACA,MAAOF,GAASsH,EAChB,OAAQ,KAAK,IACXJ,EACAjH,IACG2G,EACGM,GACGlH,GAASsH,GAAYV,EAAiBM,GACpClH,GAASsH,GAAYV,EACtBM,GACDlH,GAASsH,GAAYV,EACxBY,GAAA,EAER,WAAAnH,GACA,WAAAC,GACA,WAAAC,EACA,WAAAE,GACA,YAAAD,EACA,UAAAE,EACA,aAAAC,EACA,OAAAR,EACA,sBAAAU,EACA,QAAAD,EACA,kBAAAE,EACA,QACEC,IAAY,GACR,CAAE,SAAU,GAAK,KAAM,GAAM,OAAQ,EAAA,EACrCA,GAAW,CAAE,SAAU,EAAG,KAAM,GAAM,OAAQ,CAAA,EAEpD,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,QAAAC,GACA,QAAAC,GACA,UAAAC,GACA,OAAAC,EACA,WAAAC,EACA,UAAAC,EACA,aAAAC,GACA,eAAAC,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CACF,CAAA,CAEJ,EACC0E,GAAWE,EACVhB,EAAAA,kBAAAA,IAACyC,GAAAA,YAAA,CACC,OAAQ,CAAE,SAAUzG,GAAQ,SAAU,OAAQA,GAAQ,MAAA,EACtD,WAAY,CACV,SAAUC,GAAY,SACtB,OAAQA,GAAY,MAAA,EAEtB,QAAA6E,EACA,SAAAE,EACA,MAAAxG,CAAA,CAAA,EAEA,IAAA,CAAA,CACN,CAAA,CAAA,CACF,CAAA,CACF,CAAA,CAGN"}
|
|
@@ -126,8 +126,10 @@ declare interface Props {
|
|
|
126
126
|
animate?: boolean | AnimateDataType;
|
|
127
127
|
/** Enables same axis for the 2 lines */
|
|
128
128
|
sameAxes?: boolean;
|
|
129
|
-
/** Toggle visibility of color scale.
|
|
129
|
+
/** Toggle visibility of color scale. */
|
|
130
130
|
showColorScale?: boolean;
|
|
131
|
+
/** Toggle visibility of labels of the axis. */
|
|
132
|
+
showAxisLabels?: boolean;
|
|
131
133
|
/** Labels for the lines */
|
|
132
134
|
labels: [string, string];
|
|
133
135
|
/** Format of the date in the data object. Available formats can be found [here](https://date-fns.org/docs/format) */
|