No data provided
;\r\n }\r\n\r\n const values = data.map((d) => d.value);\r\n const value = Math.min(...values);\r\n const maxValue = Math.max(...values);\r\n const minValue = Math.min(...values) - value;\r\n const binWidth = (width - 2 * padding) / data.length;\r\n\r\n const yAxisTickValues = Array.from({ length: yAxisTickCount }, (_, i) => minValue + (i * (maxValue - minValue)) / (yAxisTickCount - 1));\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default Histogram;\r\n","import React, { useEffect, useRef } from 'react';\r\n\r\nconst PieChart = ({ objData, colorMapping }) => {\r\n\tconst { data } = objData;\r\n\r\n\tconst canvasRef = useRef(null);\r\n\r\n\tconst drawChart = () => {\r\n\t\tconst ctx = canvasRef.current.getContext('2d');\r\n\t\tconst totalValue = data.reduce((acc, curr) => acc + parseFloat(curr.value), 0);\r\n\t\tlet startAngle = 0;\r\n\r\n\t\tdata.forEach((item) => {\r\n\t\t\tconst value = parseFloat(item.value);\r\n\t\t\tconst sliceAngle = (2 * Math.PI * value) / totalValue;\r\n\r\n\t\t\tctx.beginPath();\r\n\t\t\tctx.moveTo(canvasRef.current.width / 2, canvasRef.current.height / 2);\r\n\t\t\tctx.arc(\r\n\t\t\t\tcanvasRef.current.width / 2,\r\n\t\t\t\tcanvasRef.current.height / 2,\r\n\t\t\t\tMath.min(canvasRef.current.width / 2, canvasRef.current.height / 2),\r\n\t\t\t\tstartAngle,\r\n\t\t\t\tstartAngle + sliceAngle\r\n\t\t\t);\r\n\t\t\tctx.closePath();\r\n\r\n\t\t\tctx.fillStyle = colorMapping?.[item.x];\r\n\t\t\tctx.fill();\r\n\r\n\t\t\t// Draw label\r\n\t\t\tconst labelX =\r\n\t\t\t\tcanvasRef.current.width / 2 +\r\n\t\t\t\t(Math.min(canvasRef.current.width / 2, canvasRef.current.height / 2) / 2) * Math.cos(startAngle + sliceAngle / 2);\r\n\t\t\tconst labelY =\r\n\t\t\t\tcanvasRef.current.height / 2 +\r\n\t\t\t\t(Math.min(canvasRef.current.width / 2, canvasRef.current.height / 2) / 2) * Math.sin(startAngle + sliceAngle / 2);\r\n\r\n\t\t\tctx.fillStyle = 'white';\r\n\t\t\tctx.font = '16px Arial';\r\n\t\t\tctx.textAlign = 'center';\r\n\t\t\tctx.textBaseline = 'middle';\r\n\t\t\tctx.fillText(item.x, labelX, labelY);\r\n\r\n\t\t\tstartAngle += sliceAngle;\r\n\t\t});\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tdrawChart();\r\n\t}, []);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t\r\n\t\t>\r\n\t);\r\n};\r\n\r\nexport default PieChart;\r\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","import React from \"react\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nconst BoxPlot = ({\r\n data = [1, 6, 2, 3, 5],\r\n width,\r\n height,\r\n paddingLeft,\r\n paddingRight,\r\n paddingTop,\r\n paddingBottom,\r\n xLabels = [1, \"B\", \"C\", \"D\", \"E\", \"5\", \"9\"],\r\n}) => {\r\n // Sort the data\r\n const sortedData = data.slice().sort((a, b) => a - b);\r\n\r\n // Calculate quartiles\r\n const q1 = sortedData[Math.floor(sortedData.length * 0.25)];\r\n const q2 = sortedData[Math.floor(sortedData.length * 0.5)];\r\n const q3 = sortedData[Math.floor(sortedData.length * 0.75)];\r\n\r\n // Calculate interquartile range\r\n const iqr = q3 - q1;\r\n\r\n // Calculate whiskers\r\n const lowerWhisker = q1 - 1.5 * iqr;\r\n const upperWhisker = q3 + 1.5 * iqr;\r\n\r\n const innerWidth = width - paddingLeft - paddingRight;\r\n const innerHeight = height - paddingTop - paddingBottom;\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nBoxPlot.propTypes = {\r\n data: PropTypes.arrayOf(PropTypes.number).isRequired,\r\n width: PropTypes.number,\r\n height: PropTypes.number,\r\n paddingLeft: PropTypes.number,\r\n paddingRight: PropTypes.number,\r\n paddingTop: PropTypes.number,\r\n paddingBottom: PropTypes.number,\r\n xLabels: PropTypes.arrayOf(PropTypes.string).isRequired,\r\n};\r\n\r\nBoxPlot.defaultProps = {\r\n width: 400,\r\n height: 200,\r\n paddingLeft: 40,\r\n paddingRight: 20,\r\n paddingTop: 20,\r\n paddingBottom: 40,\r\n};\r\n\r\nexport default BoxPlot;\r\n","import React from 'react';\r\nimport HeatMap from './section/HeatMap/HeatMap';\r\nimport BulletChart from './section/bulletCharts/BulletChart';\r\nimport Histogram from './section/Histogram/Histogram';\r\nimport Pie from './section/Pie/Pie';\r\nimport BoxPlot from './section/BoxPlot/BoxPlot';\r\n\r\nexport default function Charts({ mode, ...rest }) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{mode === 'heat-map' &&setOpenMenuSidebar(true)}>\r\n \r\n \r\n \r\n
\r\n )}\r\n\r\n