Make heatmap hover box more informative.

Closes #143.
This commit is contained in:
D. Berge
2021-09-20 00:17:35 +02:00
parent 09b45d5d65
commit 894877750e

View File

@@ -145,15 +145,16 @@ export default {
}
};
const hovertemplate = {
// Mode
Mode: "%{x}",
// Detect
Detect: "%{x}",
// Autofire
Autofire:
"x: %{x}<br>" +
"y: %{y}<br>" +
"z: %{meta.text[%{z}]}"
Filltime: "SP%{x}<br>%{y}<br>%{z} ms",
Volume: "SP%{x}<br>%{y}<br>%{z} in³",
Pressure: "SP%{x}<br>%{y}<br>%{z} psi",
Depth: "SP%{x}<br>%{y}<br>%{z} m",
Delay: "SP%{x}<br>%{y}<br>%{z} ms",
Firetime: "SP%{x}<br>%{y}<br>%{z} ms",
Aimpoint: "SP%{x}<br>%{y}<br>%{z} ms",
Autofire: "SP%{x}<br>%{y}<br>%{text}",
Detect: "SP%{x}<br>%{y}<br>%{text}",
Mode: "SP%{x}<br>%{y}<br>%{text}"
};
const guns = [...new Set(data.map( s => s.meta.guns.map( g => g[1] ) ).flat())];
const z = {};
@@ -193,7 +194,9 @@ export default {
z: z[aspect],
xaxis: "x",
yaxis: "y" + (idx > 0 ? idx+1 : ""),
text: meta[aspect]?.text ? z[aspect].map( row => row.map( v => meta[aspect].text[v] )) : undefined
text: meta[aspect]?.text ? z[aspect].map( row => row.map( v => meta[aspect].text[v] )) : undefined,
hovertemplate: hovertemplate[aspect],
meta: meta[aspect]
}
});
}