Spaces:
Running
Running
File size: 1,280 Bytes
12c4198 67d5397 12c4198 1d17bb8 12c4198 1d17bb8 12c4198 1d17bb8 12c4198 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
export function plotHeatmap(sim, xLabels, yLabels) {
const data = [{ z: sim, type: "heatmap", colorscale: "Viridis", zmin: 0.8, zmax: 1, x: xLabels, y: yLabels }];
Plotly.newPlot("plot-heatmap", data, {
xaxis: { title: "Group" },
yaxis: { title: "Group" },
width: 500,
height: 500,
margin: { t: 40, l: 200, r: 10, b: 200 },
title: "Group Similarity Heatmap"
});
}
export function plotScatter(traces, k) {
Plotly.newPlot("plot-scatter", traces, {
xaxis: { title: "UMAP-1", scaleanchor: "y", scaleratio: 1 },
yaxis: { title: "UMAP-2" },
width: 1000,
height: 500,
margin: { t: 40, l: 40, r: 10, b: 40 },
title: `K-Means Clustering (k=${k})`,
legend: { x: 1.05, y: 0.5, orientation: "v", xanchor: "left", yanchor: "middle" }
});
}
export function updateScatter(traces, k) {
Plotly.react("plot-scatter", traces, {
xaxis: { title: "UMAP-1", scaleanchor: "y", scaleratio: 1 },
yaxis: { title: "UMAP-2" },
width: 1000,
height: 500,
margin: { t: 40, l: 40, r: 10, b: 40 },
title: `K-Means Clustering (k=${k})`,
legend: { x: 1.05, y: 0.5, orientation: "v", xanchor: "left", yanchor: "middle" }
});
}
|