]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: upgrade d3 JS library to v4
authorPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 25 Aug 2017 08:36:29 +0000 (10:36 +0200)
committerPhilipp Klaus <klaus@physik.uni-frankfurt.de>
Fri, 25 Aug 2017 08:36:29 +0000 (10:36 +0200)
python_suite/dashboard/static/js/sparkline.js
python_suite/dashboard/views/pv_overview.jinja2

index 4ca9b2b894d03d857f17b45b6c8c4be6ee6fc827..6a0ba849f5d87f4059bd8efae701a73e8bf3d259 100644 (file)
@@ -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]); });
index cee4b1bec0f118618a8bbfa258ad67cef38667ca..c1f84bd3ba89e34ba86880f2e05b9a6be1dbb783 100644 (file)
@@ -20,7 +20,7 @@ path {
 }
 </style>
 
-<script src="http://d3js.org/d3.v3.min.js"></script>
+<script src="https://d3js.org/d3.v4.min.js"></script>
 <script src="/static/js/sparkline.js"></script>
 {% endblock %}