{"version":3,"file":"DilutionChart-CFNqsPl1.js","sources":["../../../app/javascript/components/Valuations/DilutionChart.tsx"],"sourcesContent":["import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Line } from '../../dashboards/components/common/chartjs-3';\n\ninterface IProps {\n data: any;\n labels: string[];\n minHeight: string;\n isEmbeded?: boolean;\n}\n\nconst getChartOptions = (isEmbeded: boolean) => ({\n responsive: true,\n maintainAspectRatio: false,\n plugins: {\n legend: {\n display: false,\n },\n tooltip: {\n callbacks: {\n label(tooltipItem: any) {\n return `${Number(tooltipItem.raw).toFixed(1)}%`;\n },\n },\n },\n },\n scales: {\n yAxes: {\n beginAtZero: true,\n ticks: {\n callback: (value: number) => `${value}%`,\n },\n title: {\n display: true,\n text: '% of Post Money',\n },\n },\n xAxes: {\n ticks: {\n display: !isEmbeded,\n autoSkip: true,\n maxRotation: 0,\n minRotation: 0,\n },\n },\n },\n});\n\nconst getChartData = (labels: string[], data: any) => {\n const commonOptions = {\n cubicInterpolationMode: 'linear',\n tension: 0.4,\n spanGaps: true,\n };\n\n const dataSets = [\n {\n label: '25% Percentile',\n ...commonOptions,\n backgroundColor: 'rgba(255, 206, 86, 1)',\n borderColor: 'rgba(255, 206, 86, 1)',\n data: data[0.25] || [],\n order: 0,\n },\n {\n label: '50% Percentile',\n ...commonOptions,\n backgroundColor: 'rgba(54, 162, 235, 1)',\n borderColor: 'rgba(54, 162, 235, 1)',\n data: data[0.5] || [],\n order: 1,\n },\n {\n label: '75% Percentile',\n ...commonOptions,\n backgroundColor: 'rgba(75, 192, 192, 1)',\n borderColor: 'rgba(75, 192, 192, 1)',\n data: data[0.75] || [],\n order: 2,\n },\n {\n label: '90% Percentile',\n ...commonOptions,\n backgroundColor: 'rgba(153, 102, 255, 1)',\n borderColor: 'rgba(153, 102, 255, 1)',\n data: data[0.9] || [],\n order: 3,\n },\n {\n label: '95% Percentile',\n ...commonOptions,\n backgroundColor: 'rgba(255, 159, 64, 1)',\n borderColor: 'rgba(255, 159, 64, 1)',\n data: data[0.95] || [],\n order: 4,\n },\n ];\n\n return {\n labels,\n datasets: dataSets.filter((n) => n.data.length > 0),\n };\n};\n\nconst DilutionChart = (props: IProps) => {\n const { labels, data, minHeight, isEmbeded } = props;\n const chartData = getChartData(labels, data);\n const options = getChartOptions(isEmbeded);\n\n return (\n