changeset 3037:be98bbeea41a

Implemented #78 for Mushra
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Tue, 26 Sep 2017 11:37:39 +0100
parents ae0950bc1c99
children 4927dc84e86d
files interfaces/mushra.js
diffstat 1 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/interfaces/mushra.js	Tue Sep 26 11:22:47 2017 +0100
+++ b/interfaces/mushra.js	Tue Sep 26 11:37:39 2017 +0100
@@ -470,6 +470,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;
     });
@@ -485,11 +493,13 @@
     scales.forEach(function (scale) {
         var posPercent = scale.position / 100.0;
         var posPix = (1 - posPercent) * (draw_heights[1] - draw_heights[0]) + draw_heights[0];
-        ctx.fillStyle = "#000000";
-        ctx.setLineDash([1, 2]);
-        ctx.moveTo(0, posPix);
-        ctx.lineTo(width, posPix);
-        ctx.stroke();
+        if (ticks) {
+            ctx.fillStyle = "#000000";
+            ctx.setLineDash([1, 2]);
+            ctx.moveTo(0, posPix);
+            ctx.lineTo(width, posPix);
+            ctx.stroke();
+        }
         var text = document.createElement('div');
         text.align = "right";
         var textC = document.createElement('span');