changeset 3040:5b652438802c

#78 Implemented for discrete
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 26 Sep 2017 11:52:43 +0100
parents 91d923c51e90
children 0a5f34a5eec6
files interfaces/discrete.js
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/discrete.js	Tue Sep 26 11:51:42 2017 +0100
+++ b/interfaces/discrete.js	Tue Sep 26 11:52:43 2017 +0100
@@ -448,6 +448,14 @@
 function drawScale() {
     var interfaceObj = testState.currentStateMap.interfaces[0];
     var scales = testState.currentStateMap.interfaces[0].scales;
+    var ticks = specification.interfaces.options.concat(interfaceObj.options).find(function (a) {
+        return (a.type == "show" && a.name == "ticks");
+    });
+    if (ticks !== undefined) {
+        ticks = true;
+    } else {
+        ticks = false;
+    }
     scales = scales.sort(function (a, b) {
         return a.position - b.position;
     });
@@ -468,9 +476,11 @@
         if (posPix >= width) {
             posPix = width - 1;
         }
-        ctx.moveTo(posPix, 0);
-        ctx.lineTo(posPix, height);
-        ctx.stroke();
+        if (ticks) {
+            ctx.moveTo(posPix, 0);
+            ctx.lineTo(posPix, height);
+            ctx.stroke();
+        }
 
         var text = document.createElement('div');
         text.align = "center";