chart= Plotly.newPlot(
DOM.element("div", { style: "height: 500px;" }),
[
{
type: "scatter",
mode: "markers",
x: positions.map(p => p[0]),
y: positions.map(p => p[2]),
marker: {
size: 23,
sizemode: "diameter",
color: concentration.map(row => row[t_index]),
cmin: -1,
cmax: 1,
colorscale: [
[0, "blue"],
[0.5, "white"],
[1, "red"]
],
colorbar: { title: "Concentration [M] <br>(positive: material I; negative: material II)" },
opacity: 0.9,
line: { color: "black", width: 0.5 }
},
text: ["Particle 1", "Particle 2"],
hoverinfo: "text+marker.color"
}
],
{
xaxis: {
visible: false,
showgrid: false,
showticklabels: false,
zeroline: false,
showline: false
},
yaxis: { title: "Distance [cm]", range: [-1, 26] },
margin: { t: 50 }
}
);