From ff06efd45d1b85e0a677e3207cb3ed887116db04 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 19 Nov 2019 11:11:32 +0100 Subject: [PATCH] Chart refinements --- rowers/interactiveplots.py | 12 ++++++++++++ rowers/templates/embedded_video.html | 8 +++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 9e8c2657..b3d059af 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -2986,6 +2986,9 @@ def interactive_chart_video(videodata): legend: { display: false, }, + animation: { + duration: 100, + }, scales: { yAxes: [{ scaleLabel: { @@ -2995,6 +2998,7 @@ def interactive_chart_video(videodata): }], xAxes: [{ scaleLabel: { + type: 'linear', display: true, labelString: 'Time (seconds)' } @@ -3013,6 +3017,14 @@ def interactive_chart_video(videodata): { label: 'spm', data: data, + backgroundColor: "#ff0000", + borderColor: "#ff0000", + fill: false, + borderDash: [0, 0], + pointRadius: 1, + pointHoverRadius: 1, + showLine: true, + tension: 0, }, ] diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html index 39ee9be0..98713a07 100644 --- a/rowers/templates/embedded_video.html +++ b/rowers/templates/embedded_video.html @@ -175,9 +175,11 @@ document.getElementById("{{ id }}").innerHTML = {{ id }}_now; {% endfor %} // gauge.set(catch_now); - var newLatLng = new L.LatLng(lat, lon); - // console.log(newLatLng); - marker.setLatLng(newLatLng); + try { + var newLatLng = new L.LatLng(lat, lon); + // console.log(newLatLng); + marker.setLatLng(newLatLng); + } catch (e) {} } if(videotime !== oldTime) { onProgress(videotime);