Test speed

This commit is contained in:
Ruben van de Ven 2024-04-26 13:40:26 +02:00
parent b2f49645e8
commit 37569ff644
2 changed files with 11 additions and 3 deletions

View file

@ -132,6 +132,10 @@
fill: white;
font-size: 30pt;
}
path:not(.selected){
opacity:0;
}
</style>
<script>
function scaleToFit() {

View file

@ -124,6 +124,7 @@ function start(parsed_requests) {
// filter nodes with only having both Latitude and Longitude.
// then map these coordinates to the canvas space
const valid_nodes = nodes.filter((n) => n.lat && n.lon).map((node) => {
// const { x: x1, y: y1 } = latLonToOffsets(node.lat, node.lon, 100000, 100000)
const { x: x1, y: y1 } = latLonToOffsets(node.lat, node.lon, 100000, 100000)
console.log(x1, y1)
const x2 = inverse_lerp(1358, 1380, x1);
@ -333,9 +334,12 @@ function start(parsed_requests) {
const edgeToSelect = edges.filter(e => e.Barcode == "0133040931")[0]
edgesToHighlight = edges.filter(e => e.Barcode == edgeToSelect.Barcode)
highlightTrajectory(edgesToHighlight);
const tl = anime.timeline({})
console.log(tl)
// console.log(tl)
for(const edge of edgesToHighlight) {
// document.getElementById(`#linkpath_${edge.nr}`).dataset.length = document.getElementById(`#linkpath_${edge.nr}`).getTotalLength
tl.add({
targets: `#linkpath_${edge.nr}`,
stroke: ['rgb(255, 0, 0)', 'rgb(0, 255, 255)'],
@ -410,8 +414,8 @@ function highlightTrajectory(edges: Array<Object>) {
console.log(`#linkpath_${edge.nr}`)
const selection = d3.select(`#linkpath_${edge.nr}`);
// console.log(selection);
selection.style("stroke", "red");
selection.style("stroke-width", "5");
// selection.style("stroke", "red");
// selection.style("stroke-width", "5");
selection.classed("selected", true);
}
}