# HG changeset patch # User Nicholas Jillings # Date 1506423163 -3600 # Node ID 5b652438802c5ffc7640c06cd5fd46266085c5e2 # Parent 91d923c51e90a866f8743a76a230551e23917da3 #78 Implemented for discrete diff -r 91d923c51e90 -r 5b652438802c interfaces/discrete.js --- 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";