feat: render particle clouds for selected tags

This commit is contained in:
2026-05-16 22:07:18 +02:00
parent b3f199b431
commit 181dcdc30e
9 changed files with 171 additions and 43 deletions
+11 -8
View File
@@ -582,14 +582,17 @@ window.companion = {
updateCloud(particles) {
particlesLayer.destroyChildren();
particles.forEach(({ x, y, weight }) => {
particlesLayer.add(new Konva.Circle({
x: x * PPM, y: y * PPM,
radius: 2,
fill: `rgba(255,152,0,${Math.max(0, Math.min(1, weight))})`,
listening: false,
}));
});
if (particles.length > 0) {
const maxW = Math.max(...particles.map(p => p.weight));
particles.forEach(({ x, y, weight }) => {
particlesLayer.add(new Konva.Circle({
x: x * PPM, y: y * PPM,
radius: 2,
fill: `rgba(255,152,0,${maxW > 0 ? weight / maxW : 0})`,
listening: false,
}));
});
}
particlesLayer.batchDraw();
},