From: Philipp Klaus Date: Fri, 25 Aug 2017 08:36:29 +0000 (+0200) Subject: DASH: upgrade d3 JS library to v4 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=ca09563880b1c6372b4ce8a97fb637715bedae0e;p=mvd_epics.git DASH: upgrade d3 JS library to v4 --- diff --git a/python_suite/dashboard/static/js/sparkline.js b/python_suite/dashboard/static/js/sparkline.js index 4ca9b2b..6a0ba84 100644 --- a/python_suite/dashboard/static/js/sparkline.js +++ b/python_suite/dashboard/static/js/sparkline.js @@ -2,7 +2,7 @@ // Built to closely follow reusable charts best practices doc: http://bost.ocks.org/mike/chart/ -var parseDate = d3.time.format("%d-%b-%y").parse, +var parseDate = d3.timeFormat("%d-%b-%y").parse, bisectDate = d3.bisector(function(d) { return d[0]; }).left, formatValue = d3.format(",.3f"); @@ -72,11 +72,11 @@ function sparkline() { var height = chart.height(); var gradient; - var x = d3.time.scale().range([0, width]); - var y = d3.scale.linear().range([height, 0]); + var x = d3.scaleTime().range([0, width]); + var y = d3.scaleLinear().range([height, 0]); // Define the line - var valueline = d3.svg.line() + var valueline = d3.line() .defined(function (d) { return d[1] !== null; }) .x(function (d) { return x(d[0]); }) .y(function (d) { return y(d[1]); }); diff --git a/python_suite/dashboard/views/pv_overview.jinja2 b/python_suite/dashboard/views/pv_overview.jinja2 index cee4b1b..c1f84bd 100644 --- a/python_suite/dashboard/views/pv_overview.jinja2 +++ b/python_suite/dashboard/views/pv_overview.jinja2 @@ -20,7 +20,7 @@ path { } - + {% endblock %}