aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/static/js/makeChart.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/app/static/js/makeChart.js b/app/static/js/makeChart.js
index 5d759bf..b6e3de2 100644
--- a/app/static/js/makeChart.js
+++ b/app/static/js/makeChart.js
@@ -50,13 +50,23 @@ function noZoom() {
d3.event.preventDefault();
}
-function baseChart(selector, data, clickFunction, annotations, annotationFunction) {
+function baseChart(
+ selector,
+ data,
+ clickFunction,
+ annotations,
+ annotationFunction,
+ divWidth,
+ divHeight
+) {
+ if (divWidth === null || typeof divWidth === 'undefined')
+ divWidth = 1000;
+ if (divHeight === null || typeof divHeight === 'undefined')
+ divHeight = 480;
+
// preprocess the data
data = preprocessData(data);
- var divWidth = 1000;
- var divHeight = 480;
-
var svg = d3.select(selector)
.on("touchstart", noZoom)
.on("touchmove", noZoom)
@@ -220,7 +230,7 @@ function viewAnnotations(selector, data, annotations) {
.attr("x2", xScale(ann.index))
.attr("class", "ann-line");
}
- baseChart(selector, data, function() {}, annotations, handleAnnotation);
+ baseChart(selector, data, function() {}, annotations, handleAnnotation, null, 300);
}
function adminViewAnnotations(selector, data, annotations) {