{"version":3,"file":"Chart-BdRV9bWk.js","sources":["../../../app/javascript/entrypoints/components/Chart.tsx"],"sourcesContent":["/* eslint-disable */\nimport Highcharts from 'highcharts';\nimport { Options } from 'highcharts';\nimport * as React from 'react';\nimport { useState } from 'react';\n\ninterface Props {\n idStr: string;\n config: Options;\n max?: number;\n}\n\nconst Chart: React.FC = ({ idStr, config, max }): JSX.Element => {\n const [chart, setChart] = useState();\n\n if (chart) {\n const prevMax = chart.options.yAxis[0].max;\n\n if (max ?? prevMax) {\n const options = { yAxis: { max: max } };\n chart.update(options);\n }\n }\n\n if (!chart && config) {\n const chartRef = Highcharts.chart(idStr, config);\n setChart(chartRef);\n }\n\n return
;\n};\n\nconst style = {\n width: '100%',\n height: '100%',\n fontSize: '14px',\n lineHeight: '1.2em',\n};\n\nexport default Chart;\n/* eslint-enable */\n"],"names":["Chart","idStr","config","max","chart","setChart","useState","prevMax","options","chartRef","Highcharts","jsx","style"],"mappings":"8KAYA,MAAMA,EAAyB,CAAC,CAAE,MAAAC,EAAO,OAAAC,EAAQ,IAAAC,KAAuB,CACtE,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAc,SAAA,EAExC,GAAIF,EAAO,CACT,MAAMG,EAAUH,EAAM,QAAQ,MAAM,CAAC,EAAE,IAEvC,GAAID,GAAOI,EAAS,CAClB,MAAMC,EAAU,CAAE,MAAO,CAAE,IAAAL,CAAW,CAAA,EACtCC,EAAM,OAAOI,CAAO,CACtB,CACF,CAEI,GAAA,CAACJ,GAASF,EAAQ,CACpB,MAAMO,EAAWC,EAAW,MAAMT,EAAOC,CAAM,EAC/CG,EAASI,CAAQ,CACnB,CAEA,OAAQE,EAAAA,IAAA,MAAA,CAAI,GAAIV,EAAO,MAAAW,CAAc,CAAA,CACvC,EAEMA,EAAQ,CACZ,MAAO,OACP,OAAQ,OACR,SAAU,OACV,WAAY,OACd"}