{"version":3,"file":"EpsChart-D4QltGcE.js","sources":["../../../app/javascript/entrypoints/components/EpsChart.jsx"],"sourcesContent":["/* eslint-disable */\nimport { dowConfig, n225Config, options } from './EpsChartConfig';\nimport Highcharts from 'highcharts';\nimport axios from 'axios';\nimport { useEffect } from 'react';\n\nconst EpsChart = ({ code }) => {\n const idStr = `${code}-highcharts`;\n\n useEffect(() => {\n getData(code).then((data) => {\n const config = getConfig(code, data);\n\n Highcharts.setOptions(options);\n Highcharts.chart(idStr, config);\n });\n });\n\n return
;\n};\n\nasync function getData(code) {\n const url = `/eps_estimates/${code}/chart`;\n const response = await axios.get(url);\n return response.data;\n}\n\nfunction getConfig(code, data) {\n const labels = data.x_label;\n const points = data.data_eps;\n const prices = data.data_price;\n\n switch (code) {\n case '998407':\n return n225Config(points, prices, labels, '予想EPS(日経)', 20);\n case '998407-r':\n return n225Config(points, prices, labels, '予想EPS(iMarket算出)', 10);\n case '^DJI':\n return dowConfig(points.current, points.next, prices, labels);\n }\n}\n\nconst style = {\n width: '100%',\n height: '100%',\n paddingRight: '15px',\n paddingLeft: '15px',\n fontSize: '14px',\n lineHeight: '1.2em',\n};\n\nexport default EpsChart;\n/* eslint-enable */\n"],"names":["EpsChart","code","idStr","useEffect","getData","data","config","getConfig","Highcharts","options","jsx","style","url","axios","labels","points","prices","n225Config","dowConfig"],"mappings":"iTAMA,MAAMA,EAAW,CAAC,CAAE,KAAAC,KAAW,CACvB,MAAAC,EAAQ,GAAGD,CAAI,cAErBE,OAAAA,EAAAA,UAAU,IAAM,CACdC,EAAQH,CAAI,EAAE,KAAMI,GAAS,CACrB,MAAAC,EAASC,EAAUN,EAAMI,CAAI,EAEnCG,EAAW,WAAWC,CAAO,EAClBD,EAAA,MAAMN,EAAOI,CAAM,CAAA,CAC/B,CAAA,CACF,EAEOI,EAAAA,IAAA,MAAA,CAAI,GAAIR,EAAO,MAAAS,CAAc,CAAA,CACvC,EAEA,eAAeP,EAAQH,EAAM,CACrB,MAAAW,EAAM,kBAAkBX,CAAI,SAElC,OADiB,MAAMY,EAAM,IAAID,CAAG,GACpB,IAClB,CAEA,SAASL,EAAUN,EAAMI,EAAM,CAC7B,MAAMS,EAAST,EAAK,QACdU,EAASV,EAAK,SACdW,EAASX,EAAK,WAEpB,OAAQJ,EAAM,CACZ,IAAK,SACH,OAAOgB,EAAWF,EAAQC,EAAQF,EAAQ,YAAa,EAAE,EAC3D,IAAK,WACH,OAAOG,EAAWF,EAAQC,EAAQF,EAAQ,mBAAoB,EAAE,EAClE,IAAK,OACH,OAAOI,EAAUH,EAAO,QAASA,EAAO,KAAMC,EAAQF,CAAM,CAChE,CACF,CAEA,MAAMH,EAAQ,CACZ,MAAO,OACP,OAAQ,OACR,aAAc,OACd,YAAa,OACb,SAAU,OACV,WAAY,OACd"}