@tetrascience-npm/tetrascience-react-ui 0.6.0-beta.81.1 → 0.6.0-beta.83.1
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/components/charts/AreaGraph/AreaGraph.cjs +1 -1
- package/dist/components/charts/AreaGraph/AreaGraph.cjs.map +1 -1
- package/dist/components/charts/AreaGraph/AreaGraph.js +79 -75
- package/dist/components/charts/AreaGraph/AreaGraph.js.map +1 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs +1 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs.map +1 -1
- package/dist/components/charts/BarGraph/BarGraph.js +37 -36
- package/dist/components/charts/BarGraph/BarGraph.js.map +1 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs +1 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs.map +1 -1
- package/dist/components/charts/Boxplot/Boxplot.js +84 -80
- package/dist/components/charts/Boxplot/Boxplot.js.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.js +51 -46
- package/dist/components/charts/Chromatogram/Chromatogram.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +47 -47
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/annotations.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/annotations.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/annotations.js +32 -32
- package/dist/components/charts/ChromatogramChart/annotations.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js +6 -6
- package/dist/components/charts/ChromatogramChart/boundaryMarkers.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/constants.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/constants.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/constants.js +11 -5
- package/dist/components/charts/ChromatogramChart/constants.js.map +1 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs +1 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs.map +1 -1
- package/dist/components/charts/DotPlot/DotPlot.js +49 -59
- package/dist/components/charts/DotPlot/DotPlot.js.map +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs.map +1 -1
- package/dist/components/charts/Histogram/Histogram.js +53 -63
- package/dist/components/charts/Histogram/Histogram.js.map +1 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs +1 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs.map +1 -1
- package/dist/components/charts/LineGraph/LineGraph.js +87 -83
- package/dist/components/charts/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs.map +1 -1
- package/dist/components/charts/PieChart/PieChart.js +41 -48
- package/dist/components/charts/PieChart/PieChart.js.map +1 -1
- package/dist/components/charts/PlateMap/constants.cjs +1 -1
- package/dist/components/charts/PlateMap/constants.cjs.map +1 -1
- package/dist/components/charts/PlateMap/constants.js +20 -29
- package/dist/components/charts/PlateMap/constants.js.map +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs.map +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.js +40 -39
- package/dist/components/charts/ScatterGraph/ScatterGraph.js.map +1 -1
- package/dist/hooks/use-plotly-theme.cjs +1 -1
- package/dist/hooks/use-plotly-theme.cjs.map +1 -1
- package/dist/hooks/use-plotly-theme.js +4 -2
- package/dist/hooks/use-plotly-theme.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +26 -76
- package/dist/index.js +37 -36
- package/dist/index.tailwind.css +1 -1
- package/dist/utils/colors.cjs +1 -1
- package/dist/utils/colors.cjs.map +1 -1
- package/dist/utils/colors.js +38 -93
- package/dist/utils/colors.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,35 +1,28 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { usePlotlyTheme as
|
|
5
|
-
import {
|
|
6
|
-
const
|
|
7
|
-
t.BLUE,
|
|
8
|
-
t.GREEN,
|
|
9
|
-
t.ORANGE,
|
|
10
|
-
t.RED,
|
|
11
|
-
t.YELLOW,
|
|
12
|
-
t.PURPLE
|
|
13
|
-
], j = ({
|
|
1
|
+
import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import y from "plotly.js-dist";
|
|
3
|
+
import N, { useRef as x, useMemo as P, useEffect as R } from "react";
|
|
4
|
+
import { usePlotlyTheme as _ } from "../../../hooks/use-plotly-theme.js";
|
|
5
|
+
import { CHART_COLORS as L } from "../../../utils/colors.js";
|
|
6
|
+
const C = L, k = ({
|
|
14
7
|
dataSeries: e,
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
17
|
-
title:
|
|
18
|
-
textInfo:
|
|
19
|
-
hole:
|
|
20
|
-
rotation:
|
|
8
|
+
width: a = 400,
|
|
9
|
+
height: f = 400,
|
|
10
|
+
title: p = "Pie Chart",
|
|
11
|
+
textInfo: u = "percent",
|
|
12
|
+
hole: g = 0,
|
|
13
|
+
rotation: h = 0
|
|
21
14
|
}) => {
|
|
22
|
-
const
|
|
15
|
+
const c = x(null), i = _(), m = P(() => {
|
|
23
16
|
if (e.colors && e.colors.length >= e.labels.length)
|
|
24
17
|
return e.colors;
|
|
25
18
|
const o = [...e.colors || []], s = e.labels.length - o.length;
|
|
26
19
|
if (s <= 0) return o;
|
|
27
20
|
for (let n = 0; n < s; n++)
|
|
28
|
-
o.push(
|
|
21
|
+
o.push(C[n % C.length]);
|
|
29
22
|
return o;
|
|
30
23
|
}, [e.colors, e.labels.length]);
|
|
31
|
-
return
|
|
32
|
-
if (!
|
|
24
|
+
return R(() => {
|
|
25
|
+
if (!c.current) return;
|
|
33
26
|
const o = [
|
|
34
27
|
{
|
|
35
28
|
type: "pie",
|
|
@@ -37,45 +30,45 @@ const E = [
|
|
|
37
30
|
values: e.values,
|
|
38
31
|
name: e.name,
|
|
39
32
|
marker: {
|
|
40
|
-
colors:
|
|
33
|
+
colors: m
|
|
41
34
|
},
|
|
42
|
-
textinfo:
|
|
35
|
+
textinfo: u,
|
|
43
36
|
hoverinfo: "label+text+value",
|
|
44
37
|
insidetextfont: {
|
|
45
38
|
size: 0,
|
|
46
39
|
family: "Inter, sans-serif",
|
|
47
40
|
color: "transparent"
|
|
48
41
|
},
|
|
49
|
-
hole:
|
|
50
|
-
rotation:
|
|
42
|
+
hole: g,
|
|
43
|
+
rotation: h
|
|
51
44
|
}
|
|
52
45
|
], s = {
|
|
53
|
-
width:
|
|
54
|
-
height:
|
|
46
|
+
width: a,
|
|
47
|
+
height: f,
|
|
55
48
|
font: {
|
|
56
49
|
family: "Inter, sans-serif",
|
|
57
|
-
color:
|
|
50
|
+
color: i.textColor
|
|
58
51
|
},
|
|
59
52
|
showlegend: !1,
|
|
60
53
|
margin: { l: 40, r: 40, b: 40, t: 40 },
|
|
61
|
-
paper_bgcolor:
|
|
62
|
-
plot_bgcolor:
|
|
54
|
+
paper_bgcolor: i.paperBg,
|
|
55
|
+
plot_bgcolor: i.plotBg
|
|
63
56
|
}, n = {
|
|
64
57
|
responsive: !0,
|
|
65
58
|
displayModeBar: !1,
|
|
66
59
|
displaylogo: !1
|
|
67
60
|
};
|
|
68
|
-
|
|
69
|
-
const
|
|
61
|
+
y.newPlot(c.current, o, s, n);
|
|
62
|
+
const t = c.current;
|
|
70
63
|
return () => {
|
|
71
|
-
|
|
64
|
+
t && y.purge(t);
|
|
72
65
|
};
|
|
73
|
-
}, [
|
|
74
|
-
|
|
66
|
+
}, [m, e.labels, e.name, e.values, a, f, u, g, h, i]), /* @__PURE__ */ l("div", { className: "card-container", style: { width: a }, children: /* @__PURE__ */ b("div", { className: "chart-container", children: [
|
|
67
|
+
p && /* @__PURE__ */ l("div", { className: "title-container", children: /* @__PURE__ */ l("h2", { className: "title", children: p }) }),
|
|
75
68
|
/* @__PURE__ */ l(
|
|
76
69
|
"div",
|
|
77
70
|
{
|
|
78
|
-
ref:
|
|
71
|
+
ref: c,
|
|
79
72
|
style: {
|
|
80
73
|
width: "100%",
|
|
81
74
|
height: "100%",
|
|
@@ -87,20 +80,20 @@ const E = [
|
|
|
87
80
|
labels: o,
|
|
88
81
|
colors: s
|
|
89
82
|
}) => {
|
|
90
|
-
const n = o.map((r,
|
|
91
|
-
/* @__PURE__ */ l("span", { className: "color-box", style: { background: s[
|
|
83
|
+
const n = o.map((r, v) => /* @__PURE__ */ l(N.Fragment, { children: /* @__PURE__ */ b("div", { className: "legend-item", children: [
|
|
84
|
+
/* @__PURE__ */ l("span", { className: "color-box", style: { background: s[v] } }),
|
|
92
85
|
r,
|
|
93
|
-
|
|
94
|
-
] }) }, r)),
|
|
95
|
-
for (let r = 0; r < n.length; r +=
|
|
96
|
-
|
|
97
|
-
/* @__PURE__ */ l("div", { className: "legend-row", children: n.slice(r, r +
|
|
86
|
+
v < o.length - 1 && /* @__PURE__ */ l("span", { className: "divider" })
|
|
87
|
+
] }) }, r)), t = 6, d = [];
|
|
88
|
+
for (let r = 0; r < n.length; r += t)
|
|
89
|
+
d.push(
|
|
90
|
+
/* @__PURE__ */ l("div", { className: "legend-row", children: n.slice(r, r + t) }, r)
|
|
98
91
|
);
|
|
99
|
-
return /* @__PURE__ */ l("div", { className: "legend-container", children:
|
|
100
|
-
}, { labels: e.labels, colors:
|
|
92
|
+
return /* @__PURE__ */ l("div", { className: "legend-container", children: d });
|
|
93
|
+
}, { labels: e.labels, colors: m })
|
|
101
94
|
] }) });
|
|
102
95
|
};
|
|
103
96
|
export {
|
|
104
|
-
|
|
97
|
+
k as PieChart
|
|
105
98
|
};
|
|
106
99
|
//# sourceMappingURL=PieChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PieChart.js","sources":["../../../../src/components/charts/PieChart/PieChart.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport {
|
|
1
|
+
{"version":3,"file":"PieChart.js","sources":["../../../../src/components/charts/PieChart/PieChart.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { CHART_COLORS } from \"@/utils/colors\";\n\ninterface PieDataSeries {\n labels: string[];\n values: number[];\n name: string;\n colors?: string[];\n}\n\ntype PieTextInfo =\n | \"none\"\n | \"label\"\n | \"percent\"\n | \"value\"\n | \"label+percent\"\n | \"label+value\"\n | \"value+percent\"\n | \"label+value+percent\";\n\ntype PieChartProps = {\n dataSeries: PieDataSeries;\n width?: number;\n height?: number;\n title?: string;\n textInfo?: PieTextInfo;\n hole?: number;\n rotation?: number;\n};\n\nconst DEFAULT_COLORS = CHART_COLORS;\n\nconst PieChart: React.FC<PieChartProps> = ({\n dataSeries,\n width = 400,\n height = 400,\n title = \"Pie Chart\",\n textInfo = \"percent\",\n hole = 0,\n rotation = 0,\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n\n const colors = useMemo(() => {\n if (\n dataSeries.colors &&\n dataSeries.colors.length >= dataSeries.labels.length\n ) {\n return dataSeries.colors;\n }\n\n const result = [...(dataSeries.colors || [])];\n const missingColors = dataSeries.labels.length - result.length;\n\n if (missingColors <= 0) return result;\n\n for (let i = 0; i < missingColors; i++) {\n result.push(DEFAULT_COLORS[i % DEFAULT_COLORS.length]);\n }\n\n return result;\n }, [dataSeries.colors, dataSeries.labels.length]);\n\n useEffect(() => {\n if (!plotRef.current) return;\n\n const plotData = [\n {\n type: \"pie\" as const,\n labels: dataSeries.labels,\n values: dataSeries.values,\n name: dataSeries.name,\n marker: {\n colors: colors,\n },\n textinfo: textInfo,\n hoverinfo: \"label+text+value\" as const,\n insidetextfont: {\n size: 0,\n family: \"Inter, sans-serif\",\n color: \"transparent\",\n },\n hole: hole,\n rotation: rotation,\n },\n ];\n\n const layout = {\n width,\n height,\n font: {\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n },\n showlegend: false,\n margin: { l: 40, r: 40, b: 40, t: 40 },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n };\n\n const config = {\n responsive: true,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, layout, config);\n\n // Capture ref value for cleanup\n const plotElement = plotRef.current;\n\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n }\n };\n }, [colors, dataSeries.labels, dataSeries.name, dataSeries.values, width, height, textInfo, hole, rotation, theme]);\n\n const PieChartLegend: React.FC<{ labels: string[]; colors: string[] }> = ({\n labels,\n colors,\n }) => {\n const items = labels.map((label, i) => (\n <React.Fragment key={label}>\n <div className=\"legend-item\">\n <span className=\"color-box\" style={{ background: colors[i] }} />\n {label}\n {i < labels.length - 1 && <span className=\"divider\" />}\n </div>\n </React.Fragment>\n ));\n\n const rowSize = 6;\n const rows = [];\n for (let i = 0; i < items.length; i += rowSize) {\n rows.push(\n <div className=\"legend-row\" key={i}>\n {items.slice(i, i + rowSize)}\n </div>\n );\n }\n return <div className=\"legend-container\">{rows}</div>;\n };\n\n return (\n <div className=\"card-container\" style={{ width: width }}>\n <div className=\"chart-container\">\n {title && (\n <div className=\"title-container\">\n <h2 className=\"title\">{title}</h2>\n </div>\n )}\n <div\n ref={plotRef}\n style={{\n width: \"100%\",\n height: \"100%\",\n margin: \"0\",\n }}\n />\n <PieChartLegend labels={dataSeries.labels} colors={colors} />\n </div>\n </div>\n );\n};\n\nexport { PieChart };\nexport type { PieDataSeries, PieTextInfo, PieChartProps };\n"],"names":["DEFAULT_COLORS","CHART_COLORS","PieChart","dataSeries","width","height","title","textInfo","hole","rotation","plotRef","useRef","theme","usePlotlyTheme","colors","useMemo","result","missingColors","i","useEffect","plotData","layout","config","Plotly","plotElement","jsx","jsxs","labels","items","label","React","rowSize","rows"],"mappings":";;;;;AAiCA,MAAMA,IAAiBC,GAEjBC,IAAoC,CAAC;AAAA,EACzC,YAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,OAAAC,IAAQ;AAAA,EACR,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AACb,MAAM;AACJ,QAAMC,IAAUC,EAAuB,IAAI,GACrCC,IAAQC,EAAA,GAERC,IAASC,EAAQ,MAAM;AAC3B,QACEZ,EAAW,UACXA,EAAW,OAAO,UAAUA,EAAW,OAAO;AAE9C,aAAOA,EAAW;AAGpB,UAAMa,IAAS,CAAC,GAAIb,EAAW,UAAU,CAAA,CAAG,GACtCc,IAAgBd,EAAW,OAAO,SAASa,EAAO;AAExD,QAAIC,KAAiB,EAAG,QAAOD;AAE/B,aAASE,IAAI,GAAGA,IAAID,GAAeC;AACjC,MAAAF,EAAO,KAAKhB,EAAekB,IAAIlB,EAAe,MAAM,CAAC;AAGvD,WAAOgB;AAAA,EACT,GAAG,CAACb,EAAW,QAAQA,EAAW,OAAO,MAAM,CAAC;AAEhD,SAAAgB,EAAU,MAAM;AACd,QAAI,CAACT,EAAQ,QAAS;AAEtB,UAAMU,IAAW;AAAA,MACf;AAAA,QACE,MAAM;AAAA,QACN,QAAQjB,EAAW;AAAA,QACnB,QAAQA,EAAW;AAAA,QACnB,MAAMA,EAAW;AA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ACR,QAAQ;AAAA,QAAA;AAAA,MACV;AAAA,IAAA;AAAA,IAEF,gBAAAe,EA1CmE,CAAC;AAAA,MACxE,QAAAE;AAAA,MACA,QAAAb;AAAAA,IAAA,MACI;AACJ,YAAMc,IAAQD,EAAO,IAAI,CAACE,GAAOX,MAC/B,gBAAAO,EAACK,EAAM,UAAN,EACC,UAAA,gBAAAJ,EAAC,OAAA,EAAI,WAAU,eACb,UAAA;AAAA,QAAA,gBAAAD,EAAC,QAAA,EAAK,WAAU,aAAY,OAAO,EAAE,YAAYX,EAAOI,CAAC,EAAA,GAAK;AAAA,QAC7DW;AAAA,QACAX,IAAIS,EAAO,SAAS,KAAK,gBAAAF,EAAC,QAAA,EAAK,WAAU,UAAA,CAAU;AAAA,MAAA,GACtD,EAAA,GALmBI,CAMrB,CACD,GAEKE,IAAU,GACVC,IAAO,CAAA;AACb,eAASd,IAAI,GAAGA,IAAIU,EAAM,QAAQV,KAAKa;AACrC,QAAAC,EAAK;AAAA,UACH,gBAAAP,EAAC,OAAA,EAAI,WAAU,cACZ,UAAAG,EAAM,MAAMV,GAAGA,IAAIa,CAAO,EAAA,GADIb,CAEjC;AAAA,QAAA;AAGJ,aAAO,gBAAAO,EAAC,OAAA,EAAI,WAAU,oBAAoB,UAAAO,GAAK;AAAA,IACjD,GAkBO,EAAe,QAAQ7B,EAAW,QAAQ,QAAAW,EAAA,CAAgB;AAAA,EAAA,EAAA,CAC7D,EAAA,CACF;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./types.cjs"),O={sample:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./types.cjs"),O=require("../../../utils/colors.cjs"),A={sample:O.CHART_COLORS[0],control:O.CHART_COLORS[3],empty:"#f0f0f0"},_={[f.PLATE_FORMAT_96]:{rows:8,columns:12},[f.PLATE_FORMAT_384]:{rows:16,columns:24},[f.PLATE_FORMAT_1536]:{rows:32,columns:48}},R=O.toPlotlyColorscale(O.CHART_DIVERGING.blueOrange),L={primary:O.CHART_COLORS[0],textDark:"#333",regionBorder:"#000",emptyWell:"#f0f0f0"},T={Viridis:[[0,"#440154"],[.25,"#414487"],[.5,"#2a788e"],[.75,"#22a884"],[1,"#7ad151"]],Blues:[[0,"#f7fbff"],[.25,"#c6dbef"],[.5,"#6baed6"],[.75,"#2171b5"],[1,"#08306b"]],RdBu:[[0,"#67001f"],[.25,"#d6604d"],[.5,"#f7f7f7"],[.75,"#4393c3"],[1,"#053061"]],Greens:[[0,"#f7fcf5"],[.25,"#c7e9c0"],[.5,"#74c476"],[.75,"#238b45"],[1,"#00441b"]],Reds:[[0,"#fff5f0"],[.25,"#fcbba1"],[.5,"#fb6a4a"],[.75,"#cb181d"],[1,"#67000d"]],Greys:[[0,"#ffffff"],[.25,"#d9d9d9"],[.5,"#969696"],[.75,"#525252"],[1,"#000000"]],Hot:[[0,"#000000"],[.33,"#e60000"],[.66,"#ffff00"],[1,"#ffffff"]],YlGnBu:[[0,"#ffffd9"],[.25,"#c7e9b4"],[.5,"#41b6c4"],[.75,"#225ea8"],[1,"#081d58"]],YlOrRd:[[0,"#ffffcc"],[.25,"#fed976"],[.5,"#fd8d3c"],[.75,"#e31a1c"],[1,"#800026"]],Plasma:[[0,"#0d0887"],[.25,"#7e03a8"],[.5,"#cc4778"],[.75,"#f89540"],[1,"#f0f921"]]},E={MAX_RANDOM_VALUE:5e4,SENTINEL_RATIO:.01,COLOR_SCALE_THRESHOLD:.99,COLOR_SCALE_EPSILON:.001,MULTI_VALUE_PRIMARY_RATIO:.575,MULTI_VALUE_SECONDARY_RATIO:.425,FONT_SIZE_LARGE:11,LABEL_CENTER_OFFSET:-.5,MARGIN_TOP:70,MARGIN_RIGHT:50,MARGIN_BOTTOM:40,MARGIN_LEFT:80,COLORBAR_LENGTH:130,DOMAIN_COLORBAR_OFFSET:.15,DOMAIN_COLORBAR_END:.85};exports.COLORS=L;exports.DEFAULT_CATEGORY_COLORS=A;exports.DEFAULT_COLOR_SCALE=R;exports.NAMED_COLORSCALES=T;exports.PLATEMAP_CONSTANTS=E;exports.PLATE_CONFIGS=_;
|
|
2
2
|
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","sources":["../../../../src/components/charts/PlateMap/constants.ts"],"sourcesContent":["import {\n PLATE_FORMAT_96,\n PLATE_FORMAT_384,\n PLATE_FORMAT_1536,\n} from \"./types\";\n\n/**\n * Default category colors for well types in categorical visualization mode.\n * Override these by passing custom colors via the `categoryColors` prop.\n */\nexport const DEFAULT_CATEGORY_COLORS: Record<string, string> = {\n sample:
|
|
1
|
+
{"version":3,"file":"constants.cjs","sources":["../../../../src/components/charts/PlateMap/constants.ts"],"sourcesContent":["import {\n PLATE_FORMAT_96,\n PLATE_FORMAT_384,\n PLATE_FORMAT_1536,\n} from \"./types\";\n\nimport {\n CHART_COLORS,\n CHART_DIVERGING,\n toPlotlyColorscale,\n} from \"@/utils/colors\";\n\n/**\n * Default category colors for well types in categorical visualization mode.\n * Override these by passing custom colors via the `categoryColors` prop.\n */\nexport const DEFAULT_CATEGORY_COLORS: Record<string, string> = {\n sample: CHART_COLORS[0], // Blue\n control: CHART_COLORS[3], // Red\n empty: \"#f0f0f0\", // Light gray\n};\n\n/**\n * Plate dimension configurations\n */\nexport const PLATE_CONFIGS: Record<\n typeof PLATE_FORMAT_96 | typeof PLATE_FORMAT_384 | typeof PLATE_FORMAT_1536,\n { rows: number; columns: number }\n> = {\n [PLATE_FORMAT_96]: { rows: 8, columns: 12 },\n [PLATE_FORMAT_384]: { rows: 16, columns: 24 },\n [PLATE_FORMAT_1536]: { rows: 32, columns: 48 },\n};\n\n/**\n * Default color scale (CVD-friendly blue → orange diverging ramp\n * suitable for plate data)\n */\nexport const DEFAULT_COLOR_SCALE: Array<[number, string]> =\n toPlotlyColorscale(CHART_DIVERGING.blueOrange);\n\n/**\n * UI color constants for PlateMap component styling\n */\nexport const COLORS = {\n /** Primary blue color for active states */\n primary: CHART_COLORS[0],\n /** White background */\n white: \"#fff\",\n /** Light gray for borders */\n borderLight: \"#ccc\",\n /** Dark gray for text */\n textDark: \"#333\",\n /** Default region border color */\n regionBorder: \"#000\",\n /** Default empty well color (light gray) */\n emptyWell: \"#f0f0f0\",\n} as const;\n\n/**\n * Named Plotly colorscales converted to array format.\n * Used to extend colorscales with emptyWellColor when there are null values.\n * Reference: https://plotly.com/javascript/colorscales/\n */\nexport const NAMED_COLORSCALES: Record<string, Array<[number, string]>> = {\n Viridis: [\n [0, \"#440154\"],\n [0.25, \"#414487\"],\n [0.5, \"#2a788e\"],\n [0.75, \"#22a884\"],\n [1, \"#7ad151\"],\n ],\n Blues: [\n [0, \"#f7fbff\"],\n [0.25, \"#c6dbef\"],\n [0.5, \"#6baed6\"],\n [0.75, \"#2171b5\"],\n [1, \"#08306b\"],\n ],\n RdBu: [\n [0, \"#67001f\"],\n [0.25, \"#d6604d\"],\n [0.5, \"#f7f7f7\"],\n [0.75, \"#4393c3\"],\n [1, \"#053061\"],\n ],\n Greens: [\n [0, \"#f7fcf5\"],\n [0.25, \"#c7e9c0\"],\n [0.5, \"#74c476\"],\n [0.75, \"#238b45\"],\n [1, \"#00441b\"],\n ],\n Reds: [\n [0, \"#fff5f0\"],\n [0.25, \"#fcbba1\"],\n [0.5, \"#fb6a4a\"],\n [0.75, \"#cb181d\"],\n [1, \"#67000d\"],\n ],\n Greys: [\n [0, \"#ffffff\"],\n [0.25, \"#d9d9d9\"],\n [0.5, \"#969696\"],\n [0.75, \"#525252\"],\n [1, \"#000000\"],\n ],\n Hot: [\n [0, \"#000000\"],\n [0.33, \"#e60000\"],\n [0.66, \"#ffff00\"],\n [1, \"#ffffff\"],\n ],\n YlGnBu: [\n [0, \"#ffffd9\"],\n [0.25, \"#c7e9b4\"],\n [0.5, \"#41b6c4\"],\n [0.75, \"#225ea8\"],\n [1, \"#081d58\"],\n ],\n YlOrRd: [\n [0, \"#ffffcc\"],\n [0.25, \"#fed976\"],\n [0.5, \"#fd8d3c\"],\n [0.75, \"#e31a1c\"],\n [1, \"#800026\"],\n ],\n Plasma: [\n [0, \"#0d0887\"],\n [0.25, \"#7e03a8\"],\n [0.5, \"#cc4778\"],\n [0.75, \"#f89540\"],\n [1, \"#f0f921\"],\n ],\n};\n\n/**\n * Numeric constants for PlateMap calculations and layout\n */\nexport const PLATEMAP_CONSTANTS = {\n /** Maximum random data value for demonstration */\n MAX_RANDOM_VALUE: 50000,\n /** Sentinel value ratio for empty wells below data range */\n SENTINEL_RATIO: 0.01,\n /** Color scale data start ratio for extended scales */\n COLOR_SCALE_THRESHOLD: 0.99,\n /** Small epsilon for color scale band calculations */\n COLOR_SCALE_EPSILON: 0.001,\n /** Proportions for multi-value well display */\n MULTI_VALUE_PRIMARY_RATIO: 0.575,\n MULTI_VALUE_SECONDARY_RATIO: 0.425,\n /** Font sizes */\n FONT_SIZE_LARGE: 11,\n /** Offset for centering labels */\n LABEL_CENTER_OFFSET: -0.5,\n /** Opacity values */\n HOVER_OPACITY_FAINT: 0.15,\n HOVER_OPACITY_VISIBLE: 0.85,\n /** Layout margins */\n MARGIN_TOP: 70,\n MARGIN_RIGHT: 50,\n MARGIN_BOTTOM: 40,\n MARGIN_LEFT: 80,\n /** Colorbar dimensions */\n COLORBAR_LENGTH: 130,\n COLORBAR_X_OFFSET: 70,\n /** Domain position constants for legend placement */\n DOMAIN_COLORBAR_OFFSET: 0.15,\n DOMAIN_COLORBAR_END: 0.85,\n} as const;\n"],"names":["DEFAULT_CATEGORY_COLORS","CHART_COLORS","PLATE_CONFIGS","PLATE_FORMAT_96","PLATE_FORMAT_384","PLATE_FORMAT_1536","DEFAULT_COLOR_SCALE","toPlotlyColorscale","CHART_DIVERGING","COLORS","NAMED_COLORSCALES","PLATEMAP_CONSTANTS"],"mappings":"sJAgBaA,EAAkD,CAC7D,OAAQC,EAAAA,aAAa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AEf,IAAK,CACH,CAAC,EAAG,SAAS,EACb,CAAC,IAAM,SAAS,EAChB,CAAC,IAAM,SAAS,EAChB,CAAC,EAAG,SAAS,CAAA,EAEf,OAAQ,CACN,CAAC,EAAG,SAAS,EACb,CAAC,IAAM,SAAS,EAChB,CAAC,GAAK,SAAS,EACf,CAAC,IAAM,SAAS,EAChB,CAAC,EAAG,SAAS,CAAA,EAEf,OAAQ,CACN,CAAC,EAAG,SAAS,EACb,CAAC,IAAM,SAAS,EAChB,CAAC,GAAK,SAAS,EACf,CAAC,IAAM,SAAS,EAChB,CAAC,EAAG,SAAS,CAAA,EAEf,OAAQ,CACN,CAAC,EAAG,SAAS,EACb,CAAC,IAAM,SAAS,EAChB,CAAC,GAAK,SAAS,EACf,CAAC,IAAM,SAAS,EAChB,CAAC,EAAG,SAAS,CAAA,CAEjB,EAKaC,EAAqB,CAEhC,iBAAkB,IAElB,eAAgB,IAEhB,sBAAuB,IAEvB,oBAAqB,KAErB,0BAA2B,KAC3B,4BAA6B,KAE7B,gBAAiB,GAEjB,oBAAqB,IAKrB,WAAY,GACZ,aAAc,GACd,cAAe,GACf,YAAa,GAEb,gBAAiB,IAGjB,uBAAwB,IACxB,oBAAqB,GACvB"}
|
|
@@ -1,35 +1,26 @@
|
|
|
1
|
-
import { PLATE_FORMAT_1536 as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PLATE_FORMAT_1536 as O, PLATE_FORMAT_384 as A, PLATE_FORMAT_96 as _ } from "./types.js";
|
|
2
|
+
import { CHART_COLORS as f, toPlotlyColorscale as R, CHART_DIVERGING as L } from "../../../utils/colors.js";
|
|
3
|
+
const e = {
|
|
4
|
+
sample: f[0],
|
|
4
5
|
// Blue
|
|
5
|
-
control:
|
|
6
|
+
control: f[3],
|
|
6
7
|
// Red
|
|
7
8
|
empty: "#f0f0f0"
|
|
8
9
|
// Light gray
|
|
9
|
-
},
|
|
10
|
-
[
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
[0
|
|
16
|
-
[0.2, "#74add1"],
|
|
17
|
-
[0.3, "#abd9e9"],
|
|
18
|
-
[0.4, "#e0f3f8"],
|
|
19
|
-
[0.5, "#ffffbf"],
|
|
20
|
-
[0.6, "#fee090"],
|
|
21
|
-
[0.7, "#fdae61"],
|
|
22
|
-
[0.8, "#f46d43"],
|
|
23
|
-
[0.9, "#d73027"],
|
|
24
|
-
[1, "#a50026"]
|
|
25
|
-
], e = {
|
|
10
|
+
}, c = {
|
|
11
|
+
[_]: { rows: 8, columns: 12 },
|
|
12
|
+
[A]: { rows: 16, columns: 24 },
|
|
13
|
+
[O]: { rows: 32, columns: 48 }
|
|
14
|
+
}, o = R(L.blueOrange), C = {
|
|
15
|
+
/** Primary blue color for active states */
|
|
16
|
+
primary: f[0],
|
|
26
17
|
/** Dark gray for text */
|
|
27
18
|
textDark: "#333",
|
|
28
19
|
/** Default region border color */
|
|
29
20
|
regionBorder: "#000",
|
|
30
21
|
/** Default empty well color (light gray) */
|
|
31
22
|
emptyWell: "#f0f0f0"
|
|
32
|
-
},
|
|
23
|
+
}, d = {
|
|
33
24
|
Viridis: [
|
|
34
25
|
[0, "#440154"],
|
|
35
26
|
[0.25, "#414487"],
|
|
@@ -99,7 +90,7 @@ const R = {
|
|
|
99
90
|
[0.75, "#f89540"],
|
|
100
91
|
[1, "#f0f921"]
|
|
101
92
|
]
|
|
102
|
-
},
|
|
93
|
+
}, r = {
|
|
103
94
|
/** Maximum random data value for demonstration */
|
|
104
95
|
MAX_RANDOM_VALUE: 5e4,
|
|
105
96
|
/** Sentinel value ratio for empty wells below data range */
|
|
@@ -127,11 +118,11 @@ const R = {
|
|
|
127
118
|
DOMAIN_COLORBAR_END: 0.85
|
|
128
119
|
};
|
|
129
120
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
121
|
+
C as COLORS,
|
|
122
|
+
e as DEFAULT_CATEGORY_COLORS,
|
|
123
|
+
o as DEFAULT_COLOR_SCALE,
|
|
124
|
+
d as NAMED_COLORSCALES,
|
|
125
|
+
r as PLATEMAP_CONSTANTS,
|
|
126
|
+
c as PLATE_CONFIGS
|
|
136
127
|
};
|
|
137
128
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../src/components/charts/PlateMap/constants.ts"],"sourcesContent":["import {\n PLATE_FORMAT_96,\n PLATE_FORMAT_384,\n PLATE_FORMAT_1536,\n} from \"./types\";\n\n/**\n * Default category colors for well types in categorical visualization mode.\n * Override these by passing custom colors via the `categoryColors` prop.\n */\nexport const DEFAULT_CATEGORY_COLORS: Record<string, string> = {\n sample:
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../src/components/charts/PlateMap/constants.ts"],"sourcesContent":["import {\n PLATE_FORMAT_96,\n PLATE_FORMAT_384,\n PLATE_FORMAT_1536,\n} from \"./types\";\n\nimport {\n CHART_COLORS,\n CHART_DIVERGING,\n toPlotlyColorscale,\n} from \"@/utils/colors\";\n\n/**\n * Default category colors for well types in categorical visualization mode.\n * Override these by passing custom colors via the `categoryColors` prop.\n */\nexport const DEFAULT_CATEGORY_COLORS: Record<string, string> = {\n sample: CHART_COLORS[0], // Blue\n control: CHART_COLORS[3], // Red\n empty: \"#f0f0f0\", // Light gray\n};\n\n/**\n * Plate dimension configurations\n */\nexport const PLATE_CONFIGS: Record<\n typeof PLATE_FORMAT_96 | typeof PLATE_FORMAT_384 | typeof PLATE_FORMAT_1536,\n { rows: number; columns: number }\n> = {\n [PLATE_FORMAT_96]: { rows: 8, columns: 12 },\n [PLATE_FORMAT_384]: { rows: 16, columns: 24 },\n [PLATE_FORMAT_1536]: { rows: 32, columns: 48 },\n};\n\n/**\n * Default color scale (CVD-friendly blue → orange diverging ramp\n * suitable for plate data)\n */\nexport const DEFAULT_COLOR_SCALE: Array<[number, string]> =\n toPlotlyColorscale(CHART_DIVERGING.blueOrange);\n\n/**\n * UI color constants for PlateMap component styling\n */\nexport const COLORS = {\n /** Primary blue color for active states */\n primary: CHART_COLORS[0],\n /** White background */\n white: \"#fff\",\n /** Light gray for borders */\n borderLight: \"#ccc\",\n /** Dark gray for text */\n textDark: \"#333\",\n /** Default region border color */\n regionBorder: \"#000\",\n /** Default empty well color (light gray) */\n emptyWell: \"#f0f0f0\",\n} as const;\n\n/**\n * Named Plotly colorscales converted to array format.\n * Used to extend colorscales with emptyWellColor when there are null values.\n * Reference: https://plotly.com/javascript/colorscales/\n */\nexport const NAMED_COLORSCALES: Record<string, Array<[number, string]>> = {\n Viridis: [\n [0, \"#440154\"],\n [0.25, \"#414487\"],\n [0.5, \"#2a788e\"],\n [0.75, \"#22a884\"],\n [1, \"#7ad151\"],\n ],\n Blues: [\n [0, \"#f7fbff\"],\n [0.25, \"#c6dbef\"],\n [0.5, \"#6baed6\"],\n [0.75, \"#2171b5\"],\n [1, \"#08306b\"],\n ],\n RdBu: [\n [0, \"#67001f\"],\n [0.25, \"#d6604d\"],\n [0.5, \"#f7f7f7\"],\n [0.75, \"#4393c3\"],\n [1, \"#053061\"],\n ],\n Greens: [\n [0, \"#f7fcf5\"],\n [0.25, \"#c7e9c0\"],\n [0.5, \"#74c476\"],\n [0.75, \"#238b45\"],\n [1, \"#00441b\"],\n ],\n Reds: [\n [0, \"#fff5f0\"],\n [0.25, \"#fcbba1\"],\n [0.5, \"#fb6a4a\"],\n [0.75, \"#cb181d\"],\n [1, \"#67000d\"],\n ],\n Greys: [\n [0, \"#ffffff\"],\n [0.25, \"#d9d9d9\"],\n [0.5, \"#969696\"],\n [0.75, \"#525252\"],\n [1, \"#000000\"],\n ],\n Hot: [\n [0, \"#000000\"],\n [0.33, \"#e60000\"],\n [0.66, \"#ffff00\"],\n [1, \"#ffffff\"],\n ],\n YlGnBu: [\n [0, \"#ffffd9\"],\n [0.25, \"#c7e9b4\"],\n [0.5, \"#41b6c4\"],\n [0.75, \"#225ea8\"],\n [1, \"#081d58\"],\n ],\n YlOrRd: [\n [0, \"#ffffcc\"],\n [0.25, \"#fed976\"],\n [0.5, \"#fd8d3c\"],\n [0.75, \"#e31a1c\"],\n [1, \"#800026\"],\n ],\n Plasma: [\n [0, \"#0d0887\"],\n [0.25, \"#7e03a8\"],\n [0.5, \"#cc4778\"],\n [0.75, \"#f89540\"],\n [1, \"#f0f921\"],\n ],\n};\n\n/**\n * Numeric constants for PlateMap calculations and layout\n */\nexport const PLATEMAP_CONSTANTS = {\n /** Maximum random data value for demonstration */\n MAX_RANDOM_VALUE: 50000,\n /** Sentinel value ratio for empty wells below data range */\n SENTINEL_RATIO: 0.01,\n /** Color scale data start ratio for extended scales */\n COLOR_SCALE_THRESHOLD: 0.99,\n /** Small epsilon for color scale band calculations */\n COLOR_SCALE_EPSILON: 0.001,\n /** Proportions for multi-value well display */\n MULTI_VALUE_PRIMARY_RATIO: 0.575,\n MULTI_VALUE_SECONDARY_RATIO: 0.425,\n /** Font sizes */\n FONT_SIZE_LARGE: 11,\n /** Offset for centering labels */\n LABEL_CENTER_OFFSET: -0.5,\n /** Opacity values */\n HOVER_OPACITY_FAINT: 0.15,\n HOVER_OPACITY_VISIBLE: 0.85,\n /** Layout margins */\n MARGIN_TOP: 70,\n MARGIN_RIGHT: 50,\n MARGIN_BOTTOM: 40,\n MARGIN_LEFT: 80,\n /** Colorbar dimensions */\n COLORBAR_LENGTH: 130,\n COLORBAR_X_OFFSET: 70,\n /** Domain position constants for legend placement */\n DOMAIN_COLORBAR_OFFSET: 0.15,\n DOMAIN_COLORBAR_END: 0.85,\n} as const;\n"],"names":["DEFAULT_CATEGORY_COLORS","CHART_COLORS","PLATE_CONFIGS","PLATE_FORMAT_96","PLATE_FORMAT_384","PLATE_FORMAT_1536","DEFAULT_COLOR_SCALE","toPlotlyColorscale","CHART_DIVERGING","COLORS","NAMED_COLORSCALES","PLATEMAP_CONSTANTS"],"mappings":";;AAgBO,MAAMA,IAAkD;AAAA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AA;AAAA,EAKrB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,eAAe;AAAA,EACf,aAAa;AAAA;AAAA,EAEb,iBAAiB;AAAA;AAAA,EAGjB,wBAAwB;AAAA,EACxB,qBAAqB;AACvB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),A=require("plotly.js-dist"),n=require("react"),_=require("../../../hooks/use-plotly-theme.cjs"),S=({dataSeries:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),A=require("plotly.js-dist"),n=require("react"),_=require("../../../hooks/use-plotly-theme.cjs"),q=require("../../../utils/colors.cjs"),S=({dataSeries:f,width:k=1e3,height:w=600,xRange:a,yRange:m,xTitle:d="Columns",yTitle:M="Rows",title:b="Scatter Plot"})=>{const h=n.useRef(null),t=_.usePlotlyTheme(),{xMin:v,xMax:C,yMin:E,yMax:I}=n.useMemo(()=>{let r=Number.MAX_VALUE,e=Number.MIN_VALUE,s=Number.MAX_VALUE,o=Number.MIN_VALUE;f.forEach(z=>{z.x.forEach(u=>{r=Math.min(r,u),e=Math.max(e,u)}),z.y.forEach(u=>{s=Math.min(s,u),o=Math.max(o,u)})});const i=(e-r)*.1,p=(o-s)*.1;return{xMin:r-i,xMax:e+i,yMin:s-p,yMax:o+p}},[f]),c=n.useMemo(()=>a||[v,C],[a,v,C]),l=n.useMemo(()=>m||[E,I],[m,E,I]),g=n.useMemo(()=>{const r=c[1]-c[0];let e=Math.pow(10,Math.floor(Math.log10(r)));r/e>10&&(e=e*2),r/e<4&&(e=e/2);const s=[];let o=Math.ceil(c[0]/e)*e;for(;o<=c[1];)s.push(o),o+=e;return s},[c]),P=n.useMemo(()=>{const r=l[1]-l[0];let e=Math.pow(10,Math.floor(Math.log10(r)));r/e>10&&(e=e*2),r/e<4&&(e=e/2);const s=[];let o=Math.ceil(l[0]/e)*e;for(;o<=l[1];)s.push(o),o+=e;return s},[l]),x=n.useMemo(()=>({tickcolor:t.tickColor,ticklen:12,tickwidth:1,ticks:"outside",tickfont:{size:16,color:t.textColor,family:"Inter, sans-serif",weight:400},linecolor:t.lineColor,linewidth:1,position:0,zeroline:!1}),[t]),y=n.useMemo(()=>({showspikes:!0,spikemode:"across",spikedash:"solid",spikecolor:t.spikeColor,spikethickness:2}),[t]);return n.useEffect(()=>{if(!h.current)return;const r=f.map((i,p)=>({x:i.x,y:i.y,type:"scatter",mode:"markers",name:i.name,marker:{color:q.seriesColor(p,i.color),size:10,symbol:"circle"},hovertemplate:`${d}: %{x}<br>${M}: %{y}<extra>${i.name}</extra>`})),e={title:{text:b,font:{size:32,family:"Inter, sans-serif",color:t.textColor}},width:k,height:w,margin:{l:80,r:30,b:80,t:60,pad:10},paper_bgcolor:t.paperBg,plot_bgcolor:t.plotBg,font:{family:"Inter, sans-serif"},dragmode:!1,xaxis:{title:{text:d,font:{size:16,color:t.textSecondary,family:"Inter, sans-serif",weight:400},standoff:32},gridcolor:t.gridColor,range:a,autorange:!a,tickmode:"array",tickvals:g,ticktext:g.map(String),showgrid:!0,...y,...x},yaxis:{title:{text:M,font:{size:16,color:t.textSecondary,family:"Inter, sans-serif",weight:400},standoff:30},gridcolor:t.gridColor,range:m,autorange:!m,tickmode:"array",tickvals:P,showgrid:!0,...y,...x},legend:{x:.5,y:-.2,xanchor:"center",yanchor:"top",orientation:"h",font:{size:16,color:t.legendColor,family:"Inter, sans-serif",weight:500}},showlegend:!0,hovermode:"closest"},s={responsive:!0,displayModeBar:!1,displaylogo:!1};A.newPlot(h.current,r,e,s);const o=h.current;return()=>{o&&A.purge(o)}},[f,k,w,a,m,d,M,b,c,l,g,P,x,y,t]),N.jsx("div",{className:"chart-container",children:N.jsx("div",{ref:h,style:{width:"100%",height:"100%"}})})};exports.ScatterGraph=S;
|
|
2
2
|
//# sourceMappingURL=ScatterGraph.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScatterGraph.cjs","sources":["../../../../src/components/charts/ScatterGraph/ScatterGraph.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\n\ninterface ScatterDataPoint {\n x: number;\n y: number;\n additionalInfo?: Record<string, string | number>;\n}\n\ninterface ScatterDataSeries {\n x: number[];\n y: number[];\n name: string;\n color: string;\n}\n\ninterface ScatterGraphProps {\n dataSeries: ScatterDataSeries[];\n width?: number;\n height?: number;\n xRange?: [number, number];\n yRange?: [number, number];\n xTitle?: string;\n yTitle?: string;\n title?: string;\n}\n\nconst ScatterGraph: React.FC<ScatterGraphProps> = ({\n dataSeries,\n width = 1000,\n height = 600,\n xRange,\n yRange,\n xTitle = \"Columns\",\n yTitle = \"Rows\",\n title = \"Scatter Plot\",\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n\n const { xMin, xMax, yMin, yMax } = useMemo(() => {\n let minX = Number.MAX_VALUE;\n let maxX = Number.MIN_VALUE;\n let minY = Number.MAX_VALUE;\n let maxY = Number.MIN_VALUE;\n\n dataSeries.forEach((series) => {\n series.x.forEach((x) => {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n });\n series.y.forEach((y) => {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n });\n });\n\n const xPadding = (maxX - minX) * 0.1;\n const yPadding = (maxY - minY) * 0.1;\n\n return {\n xMin: minX - xPadding,\n xMax: maxX + xPadding,\n yMin: minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries]);\n\n const effectiveXRange = useMemo(\n () => xRange || [xMin, xMax],\n [xRange, xMin, xMax],\n );\n\n const effectiveYRange = useMemo(\n () => yRange || [yMin, yMax],\n [yRange, yMin, yMax],\n );\n\n const xTicks = useMemo(() => {\n const range = effectiveXRange[1] - effectiveXRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveXRange[0] / step) * step;\n while (current <= effectiveXRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveXRange]);\n\n const yTicks = useMemo(() => {\n const range = effectiveYRange[1] - effectiveYRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveYRange[0] / step) * step;\n while (current <= effectiveYRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveYRange]);\n\n const tickOptions = useMemo(\n () => ({\n tickcolor: theme.tickColor,\n ticklen: 12,\n tickwidth: 1,\n ticks: \"outside\" as const,\n tickfont: {\n size: 16,\n color: theme.textColor,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n linecolor: theme.lineColor,\n linewidth: 1,\n position: 0,\n zeroline: false,\n }),\n [theme],\n );\n\n const spikeOptions = useMemo(\n () => ({\n showspikes: true,\n spikemode: \"across\" as const,\n spikedash: \"solid\" as const,\n spikecolor: theme.spikeColor,\n spikethickness: 2,\n }),\n [theme],\n );\n\n useEffect(() => {\n if (!plotRef.current) return;\n\n const plotData = dataSeries.map((series) => ({\n x: series.x,\n y: series.y,\n type: \"scatter\" as const,\n mode: \"markers\" as const,\n name: series.name,\n marker: {\n color: series.color,\n size: 10,\n symbol: \"circle\" as const,\n },\n hovertemplate: `${xTitle}: %{x}<br>${yTitle}: %{y}<extra>${series.name}</extra>`,\n }));\n\n const layout = {\n title: {\n text: title,\n font: {\n size: 32,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n },\n },\n width,\n height,\n margin: { l: 80, r: 30, b: 80, t: 60, pad: 10 },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n font: {\n family: \"Inter, sans-serif\",\n },\n dragmode: false as const,\n xaxis: {\n title: {\n text: xTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 32,\n },\n gridcolor: theme.gridColor,\n range: xRange,\n autorange: !xRange,\n tickmode: \"array\" as const,\n tickvals: xTicks,\n ticktext: xTicks.map(String),\n showgrid: true,\n ...spikeOptions,\n ...tickOptions,\n },\n yaxis: {\n title: {\n text: yTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 30,\n },\n gridcolor: theme.gridColor,\n range: yRange,\n autorange: !yRange,\n tickmode: \"array\" as const,\n tickvals: yTicks,\n showgrid: true,\n ...spikeOptions,\n ...tickOptions,\n },\n legend: {\n x: 0.5,\n y: -0.2,\n xanchor: \"center\" as const,\n yanchor: \"top\" as const,\n orientation: \"h\" as const,\n font: {\n size: 16,\n color: theme.legendColor,\n family: \"Inter, sans-serif\",\n weight: 500,\n },\n },\n showlegend: true,\n hovermode: \"closest\" as const,\n };\n\n const config = {\n responsive: true,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, layout, config);\n\n // Capture ref value for cleanup\n const plotElement = plotRef.current;\n\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n }\n };\n }, [dataSeries, width, height, xRange, yRange, xTitle, yTitle, title, effectiveXRange, effectiveYRange, xTicks, yTicks, tickOptions, spikeOptions, theme]);\n\n return (\n <div className=\"chart-container\">\n <div ref={plotRef} style={{ width: \"100%\", height: \"100%\" }} />\n </div>\n );\n};\n\nexport { ScatterGraph };\nexport type { ScatterDataPoint, ScatterDataSeries, ScatterGraphProps };\n"],"names":["ScatterGraph","dataSeries","width","height","xRange","yRange","xTitle","yTitle","title","plotRef","useRef","theme","usePlotlyTheme","xMin","xMax","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveXRange","effectiveYRange","xTicks","range","step","ticks","current","yTicks","tick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,GAAA,CACV,EAEF,WAAY,GACZ,UAAW,SAAA,EAGP6B,EAAS,CACb,WAAY,GACZ,eAAgB,GAChB,YAAa,EAAA,EAGfC,EAAO,QAAQhC,EAAQ,QAAS6B,EAAUC,EAAQC,CAAM,EAGxD,MAAME,EAAcjC,EAAQ,QAE5B,MAAO,IAAM,CACPiC,GACFD,EAAO,MAAMC,CAAW,CAE5B,CACF,EAAG,CAACzC,EAAYC,EAAOC,EAAQC,EAAQC,EAAQC,EAAQC,EAAQC,EAAOmB,EAAiBC,EAAiBC,EAAQK,EAAQC,EAAaC,EAAczB,CAAK,CAAC,EAGvJgC,EAAAA,IAAC,MAAA,CAAI,UAAU,kBACb,eAAC,MAAA,CAAI,IAAKlC,EAAS,MAAO,CAAE,MAAO,OAAQ,OAAQ,MAAA,EAAU,EAC/D,CAEJ"}
|
|
1
|
+
{"version":3,"file":"ScatterGraph.cjs","sources":["../../../../src/components/charts/ScatterGraph/ScatterGraph.tsx"],"sourcesContent":["import Plotly from \"plotly.js-dist\";\nimport React, { useEffect, useRef, useMemo } from \"react\";\n\nimport { usePlotlyTheme } from \"@/hooks/use-plotly-theme\";\nimport { seriesColor } from \"@/utils/colors\";\n\ninterface ScatterDataPoint {\n x: number;\n y: number;\n additionalInfo?: Record<string, string | number>;\n}\n\ninterface ScatterDataSeries {\n x: number[];\n y: number[];\n name: string;\n /** Optional color override (auto-assigned from CHART_COLORS if not provided) */\n color?: string;\n}\n\ninterface ScatterGraphProps {\n dataSeries: ScatterDataSeries[];\n width?: number;\n height?: number;\n xRange?: [number, number];\n yRange?: [number, number];\n xTitle?: string;\n yTitle?: string;\n title?: string;\n}\n\nconst ScatterGraph: React.FC<ScatterGraphProps> = ({\n dataSeries,\n width = 1000,\n height = 600,\n xRange,\n yRange,\n xTitle = \"Columns\",\n yTitle = \"Rows\",\n title = \"Scatter Plot\",\n}) => {\n const plotRef = useRef<HTMLDivElement>(null);\n const theme = usePlotlyTheme();\n\n const { xMin, xMax, yMin, yMax } = useMemo(() => {\n let minX = Number.MAX_VALUE;\n let maxX = Number.MIN_VALUE;\n let minY = Number.MAX_VALUE;\n let maxY = Number.MIN_VALUE;\n\n dataSeries.forEach((series) => {\n series.x.forEach((x) => {\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n });\n series.y.forEach((y) => {\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n });\n });\n\n const xPadding = (maxX - minX) * 0.1;\n const yPadding = (maxY - minY) * 0.1;\n\n return {\n xMin: minX - xPadding,\n xMax: maxX + xPadding,\n yMin: minY - yPadding,\n yMax: maxY + yPadding,\n };\n }, [dataSeries]);\n\n const effectiveXRange = useMemo(\n () => xRange || [xMin, xMax],\n [xRange, xMin, xMax],\n );\n\n const effectiveYRange = useMemo(\n () => yRange || [yMin, yMax],\n [yRange, yMin, yMax],\n );\n\n const xTicks = useMemo(() => {\n const range = effectiveXRange[1] - effectiveXRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveXRange[0] / step) * step;\n while (current <= effectiveXRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveXRange]);\n\n const yTicks = useMemo(() => {\n const range = effectiveYRange[1] - effectiveYRange[0];\n let step = Math.pow(10, Math.floor(Math.log10(range)));\n\n if (range / step > 10) step = step * 2;\n if (range / step < 4) step = step / 2;\n\n const ticks = [];\n let current = Math.ceil(effectiveYRange[0] / step) * step;\n while (current <= effectiveYRange[1]) {\n ticks.push(current);\n current += step;\n }\n return ticks;\n }, [effectiveYRange]);\n\n const tickOptions = useMemo(\n () => ({\n tickcolor: theme.tickColor,\n ticklen: 12,\n tickwidth: 1,\n ticks: \"outside\" as const,\n tickfont: {\n size: 16,\n color: theme.textColor,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n linecolor: theme.lineColor,\n linewidth: 1,\n position: 0,\n zeroline: false,\n }),\n [theme],\n );\n\n const spikeOptions = useMemo(\n () => ({\n showspikes: true,\n spikemode: \"across\" as const,\n spikedash: \"solid\" as const,\n spikecolor: theme.spikeColor,\n spikethickness: 2,\n }),\n [theme],\n );\n\n useEffect(() => {\n if (!plotRef.current) return;\n\n const plotData = dataSeries.map((series, index) => ({\n x: series.x,\n y: series.y,\n type: \"scatter\" as const,\n mode: \"markers\" as const,\n name: series.name,\n marker: {\n color: seriesColor(index, series.color),\n size: 10,\n symbol: \"circle\" as const,\n },\n hovertemplate: `${xTitle}: %{x}<br>${yTitle}: %{y}<extra>${series.name}</extra>`,\n }));\n\n const layout = {\n title: {\n text: title,\n font: {\n size: 32,\n family: \"Inter, sans-serif\",\n color: theme.textColor,\n },\n },\n width,\n height,\n margin: { l: 80, r: 30, b: 80, t: 60, pad: 10 },\n paper_bgcolor: theme.paperBg,\n plot_bgcolor: theme.plotBg,\n font: {\n family: \"Inter, sans-serif\",\n },\n dragmode: false as const,\n xaxis: {\n title: {\n text: xTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 32,\n },\n gridcolor: theme.gridColor,\n range: xRange,\n autorange: !xRange,\n tickmode: \"array\" as const,\n tickvals: xTicks,\n ticktext: xTicks.map(String),\n showgrid: true,\n ...spikeOptions,\n ...tickOptions,\n },\n yaxis: {\n title: {\n text: yTitle,\n font: {\n size: 16,\n color: theme.textSecondary,\n family: \"Inter, sans-serif\",\n weight: 400,\n },\n standoff: 30,\n },\n gridcolor: theme.gridColor,\n range: yRange,\n autorange: !yRange,\n tickmode: \"array\" as const,\n tickvals: yTicks,\n showgrid: true,\n ...spikeOptions,\n ...tickOptions,\n },\n legend: {\n x: 0.5,\n y: -0.2,\n xanchor: \"center\" as const,\n yanchor: \"top\" as const,\n orientation: \"h\" as const,\n font: {\n size: 16,\n color: theme.legendColor,\n family: \"Inter, sans-serif\",\n weight: 500,\n },\n },\n showlegend: true,\n hovermode: \"closest\" as const,\n };\n\n const config = {\n responsive: true,\n displayModeBar: false,\n displaylogo: false,\n };\n\n Plotly.newPlot(plotRef.current, plotData, layout, config);\n\n // Capture ref value for cleanup\n const plotElement = plotRef.current;\n\n return () => {\n if (plotElement) {\n Plotly.purge(plotElement);\n }\n };\n }, [dataSeries, width, height, xRange, yRange, xTitle, yTitle, title, effectiveXRange, effectiveYRange, xTicks, yTicks, tickOptions, spikeOptions, theme]);\n\n return (\n <div className=\"chart-container\">\n <div ref={plotRef} style={{ width: \"100%\", height: \"100%\" }} />\n </div>\n );\n};\n\nexport { ScatterGraph };\nexport type { ScatterDataPoint, ScatterDataSeries, ScatterGraphProps };\n"],"names":["ScatterGraph","dataSeries","width","height","xRange","yRange","xTitle","yTitle","title","plotRef","useRef","theme","usePlotlyTheme","xMin","xMax","yMin","yMax","useMemo","minX","maxX","minY","maxY","series","x","y","xPadding","yPadding","effectiveXRange","effectiveYRange","xTicks","range","step","ticks","current","yTicks","tickOptions","spikeOptions","useEffect","plotData","index","seriesColor","layout","config","Plotly","plotElement","jsx"],"mappings":"4PA+BMA,EAA4C,CAAC,CACjD,WAAAC,EACA,MAAAC,EAAQ,IACR,OAAAC,EAAS,IACT,OAAAC,EACA,OAAAC,EACA,OAAAC,EAAS,UACT,OAAAC,EAAS,OACT,MAAAC,EAAQ,cACV,IAAM,CACJ,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCC,EAAQC,EAAAA,eAAA,EAER,CAAE,KAAAC,EAAM,KAAAC,EAAM,KAAAC,EAAM,KAAAC,CAAA,EAASC,EAAAA,QAAQ,IAAM,CAC/C,IAAIC,EAAO,OAAO,UACdC,EAAO,OAAO,UACdC,EAAO,OAAO,UACdC,EAAO,OAAO,UAElBpB,EAAW,QAASqB,GAAW,CAC7BA,EAAO,EAAE,QAASC,GAAM,CACtBL,EAAO,KAAK,IAAIA,EAAMK,CAAC,EACvBJ,EAAO,KAAK,IAAIA,EAAMI,CAAC,CACzB,CAAC,EACDD,EAAO,EA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
|
import P from "plotly.js-dist";
|
|
3
3
|
import { useRef as _, useMemo as s, useEffect as X } from "react";
|
|
4
4
|
import { usePlotlyTheme as L } from "../../../hooks/use-plotly-theme.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import { seriesColor as U } from "../../../utils/colors.js";
|
|
6
|
+
const S = ({
|
|
7
|
+
dataSeries: p,
|
|
8
|
+
width: y = 1e3,
|
|
9
|
+
height: w = 600,
|
|
9
10
|
xRange: c,
|
|
10
11
|
yRange: f,
|
|
11
|
-
xTitle:
|
|
12
|
-
yTitle:
|
|
13
|
-
title:
|
|
12
|
+
xTitle: u = "Columns",
|
|
13
|
+
yTitle: x = "Rows",
|
|
14
|
+
title: C = "Scatter Plot"
|
|
14
15
|
}) => {
|
|
15
|
-
const
|
|
16
|
+
const h = _(null), o = L(), { xMin: b, xMax: v, yMin: E, yMax: I } = s(() => {
|
|
16
17
|
let r = Number.MAX_VALUE, t = Number.MIN_VALUE, i = Number.MAX_VALUE, e = Number.MIN_VALUE;
|
|
17
|
-
|
|
18
|
+
p.forEach((N) => {
|
|
18
19
|
N.x.forEach((m) => {
|
|
19
20
|
r = Math.min(r, m), t = Math.max(t, m);
|
|
20
21
|
}), N.y.forEach((m) => {
|
|
21
22
|
i = Math.min(i, m), e = Math.max(e, m);
|
|
22
23
|
});
|
|
23
24
|
});
|
|
24
|
-
const n = (t - r) * 0.1,
|
|
25
|
+
const n = (t - r) * 0.1, d = (e - i) * 0.1;
|
|
25
26
|
return {
|
|
26
27
|
xMin: r - n,
|
|
27
28
|
xMax: t + n,
|
|
28
|
-
yMin: i -
|
|
29
|
-
yMax: e +
|
|
29
|
+
yMin: i - d,
|
|
30
|
+
yMax: e + d
|
|
30
31
|
};
|
|
31
|
-
}, [
|
|
32
|
+
}, [p]), l = s(
|
|
32
33
|
() => c || [b, v],
|
|
33
34
|
[c, b, v]
|
|
34
35
|
), a = s(
|
|
35
|
-
() => f || [
|
|
36
|
-
[f,
|
|
37
|
-
),
|
|
36
|
+
() => f || [E, I],
|
|
37
|
+
[f, E, I]
|
|
38
|
+
), g = s(() => {
|
|
38
39
|
const r = l[1] - l[0];
|
|
39
40
|
let t = Math.pow(10, Math.floor(Math.log10(r)));
|
|
40
41
|
r / t > 10 && (t = t * 2), r / t < 4 && (t = t / 2);
|
|
@@ -43,7 +44,7 @@ const $ = ({
|
|
|
43
44
|
for (; e <= l[1]; )
|
|
44
45
|
i.push(e), e += t;
|
|
45
46
|
return i;
|
|
46
|
-
}, [l]),
|
|
47
|
+
}, [l]), z = s(() => {
|
|
47
48
|
const r = a[1] - a[0];
|
|
48
49
|
let t = Math.pow(10, Math.floor(Math.log10(r)));
|
|
49
50
|
r / t > 10 && (t = t * 2), r / t < 4 && (t = t / 2);
|
|
@@ -52,7 +53,7 @@ const $ = ({
|
|
|
52
53
|
for (; e <= a[1]; )
|
|
53
54
|
i.push(e), e += t;
|
|
54
55
|
return i;
|
|
55
|
-
}, [a]),
|
|
56
|
+
}, [a]), k = s(
|
|
56
57
|
() => ({
|
|
57
58
|
tickcolor: o.tickColor,
|
|
58
59
|
ticklen: 12,
|
|
@@ -70,7 +71,7 @@ const $ = ({
|
|
|
70
71
|
zeroline: !1
|
|
71
72
|
}),
|
|
72
73
|
[o]
|
|
73
|
-
),
|
|
74
|
+
), M = s(
|
|
74
75
|
() => ({
|
|
75
76
|
showspikes: !0,
|
|
76
77
|
spikemode: "across",
|
|
@@ -81,30 +82,30 @@ const $ = ({
|
|
|
81
82
|
[o]
|
|
82
83
|
);
|
|
83
84
|
return X(() => {
|
|
84
|
-
if (!
|
|
85
|
-
const r =
|
|
85
|
+
if (!h.current) return;
|
|
86
|
+
const r = p.map((n, d) => ({
|
|
86
87
|
x: n.x,
|
|
87
88
|
y: n.y,
|
|
88
89
|
type: "scatter",
|
|
89
90
|
mode: "markers",
|
|
90
91
|
name: n.name,
|
|
91
92
|
marker: {
|
|
92
|
-
color: n.color,
|
|
93
|
+
color: U(d, n.color),
|
|
93
94
|
size: 10,
|
|
94
95
|
symbol: "circle"
|
|
95
96
|
},
|
|
96
|
-
hovertemplate: `${
|
|
97
|
+
hovertemplate: `${u}: %{x}<br>${x}: %{y}<extra>${n.name}</extra>`
|
|
97
98
|
})), t = {
|
|
98
99
|
title: {
|
|
99
|
-
text:
|
|
100
|
+
text: C,
|
|
100
101
|
font: {
|
|
101
102
|
size: 32,
|
|
102
103
|
family: "Inter, sans-serif",
|
|
103
104
|
color: o.textColor
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
|
-
width:
|
|
107
|
-
height:
|
|
107
|
+
width: y,
|
|
108
|
+
height: w,
|
|
108
109
|
margin: { l: 80, r: 30, b: 80, t: 60, pad: 10 },
|
|
109
110
|
paper_bgcolor: o.paperBg,
|
|
110
111
|
plot_bgcolor: o.plotBg,
|
|
@@ -114,7 +115,7 @@ const $ = ({
|
|
|
114
115
|
dragmode: !1,
|
|
115
116
|
xaxis: {
|
|
116
117
|
title: {
|
|
117
|
-
text:
|
|
118
|
+
text: u,
|
|
118
119
|
font: {
|
|
119
120
|
size: 16,
|
|
120
121
|
color: o.textSecondary,
|
|
@@ -127,15 +128,15 @@ const $ = ({
|
|
|
127
128
|
range: c,
|
|
128
129
|
autorange: !c,
|
|
129
130
|
tickmode: "array",
|
|
130
|
-
tickvals:
|
|
131
|
-
ticktext:
|
|
131
|
+
tickvals: g,
|
|
132
|
+
ticktext: g.map(String),
|
|
132
133
|
showgrid: !0,
|
|
133
|
-
...
|
|
134
|
-
...
|
|
134
|
+
...M,
|
|
135
|
+
...k
|
|
135
136
|
},
|
|
136
137
|
yaxis: {
|
|
137
138
|
title: {
|
|
138
|
-
text:
|
|
139
|
+
text: x,
|
|
139
140
|
font: {
|
|
140
141
|
size: 16,
|
|
141
142
|
color: o.textSecondary,
|
|
@@ -148,10 +149,10 @@ const $ = ({
|
|
|
148
149
|
range: f,
|
|
149
150
|
autorange: !f,
|
|
150
151
|
tickmode: "array",
|
|
151
|
-
tickvals:
|
|
152
|
+
tickvals: z,
|
|
152
153
|
showgrid: !0,
|
|
153
|
-
...
|
|
154
|
-
...
|
|
154
|
+
...M,
|
|
155
|
+
...k
|
|
155
156
|
},
|
|
156
157
|
legend: {
|
|
157
158
|
x: 0.5,
|
|
@@ -173,14 +174,14 @@ const $ = ({
|
|
|
173
174
|
displayModeBar: !1,
|
|
174
175
|
displaylogo: !1
|
|
175
176
|
};
|
|
176
|
-
P.newPlot(
|
|
177
|
-
const e =
|
|
177
|
+
P.newPlot(h.current, r, t, i);
|
|
178
|
+
const e = h.current;
|
|
178
179
|
return () => {
|
|
179
180
|
e && P.purge(e);
|
|
180
181
|
};
|
|
181
|
-
}, [
|
|
182
|
+
}, [p, y, w, c, f, u, x, C, l, a, g, z, k, M, o]), /* @__PURE__ */ A("div", { className: "chart-container", children: /* @__PURE__ */ A("div", { ref: h, style: { width: "100%", height: "100%" } }) });
|
|
182
183
|
};
|
|
183
184
|
export {
|
|
184
|
-
|
|
185
|
+
S as ScatterGraph
|
|
185
186
|
};
|
|
186
187
|
//# sourceMappingURL=ScatterGraph.js.map
|