Skip to content

Commit

Permalink
Added feature: Disable min and max value hotNipi#24
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenst committed Jun 2, 2020
1 parent 0c10dbb commit f4fe759
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions ui-level.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
textAnimations: { value: false },
hideValue: { value: false },
tickmode: { value: 'off' },
minmaxticks: { value: 'show' },
peakmode: { value: false },
peaktime: {
value: 3000, required: false, validate: function (v) {
Expand Down Expand Up @@ -122,6 +123,10 @@
this.tickmode = 'off';
$('#node-input-tickmode').val('off');
}
if (this.minmaxticks === undefined) {
this.minmaxticks = 'show';
$('#node-input-minmaxticks').val('show');
}
if (this.colorschema === undefined) {
this.colorschema = fixed;
$('#node-input-colorschema').val('Multiple segments');
Expand Down Expand Up @@ -357,6 +362,13 @@
<option value='auto'>Auto</option>
</select>
</div>
<div class='form-row'>
<label for='node-input-minmaxticks'><i class='fa fa-list'></i> MinMaxTicks </label>
<select id='node-input-minmaxticks' style='width:200px !important'>
<option value='show'>Show</option>
<option value='hide'>Hide</option>
</select>
</div>
<div class='form-row'>
<label for='node-input-animations'><i class='fa fa-list'></i> Animations</label>
<select id='node-input-animations' style='width:200px !important'>
Expand Down
8 changes: 4 additions & 4 deletions ui-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,11 @@ module.exports = function (RED) {
`+ config.unit + `
</tspan>
</text>
<text id=level_max_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="hanging" x="15" y="0">`+ config.max + `</text>
<text ng-if="${config.minmaxticks != 'hide'}" id=level_max_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="hanging" x="15" y="0">`+ config.max + `</text>
<text ng-if="${config.tickmode != 'off'}" ng-repeat="x in [].constructor(${config.interticks.length}) track by $index" id=level_tick_{{unique}}_{{$index}}
class="txt-{{unique}} small" text-anchor="start" dominant-baseline="middle"
x="15"></text>
<text id=level_min_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="baseline" x="15" ng-attr-y=`+ config.lastpos + `px>` + config.min + `</text>
<text ng-if="${config.minmaxticks != 'hide'}" id=level_min_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="baseline" x="15" ng-attr-y=`+ config.lastpos + `px>` + config.min + `</text>
</svg>`

var level_pair_h = String.raw`
Expand Down Expand Up @@ -276,11 +276,11 @@ module.exports = function (RED) {
{{msg.payload[1]}}
</text>
<text id=level_min_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="middle" x="0" y="50%">`+ config.min + `</text>
<text ng-if="${config.minmaxticks != 'hide'}" id=level_min_{{unique}} class="txt-{{unique}} small" text-anchor="start" dominant-baseline="middle" x="0" y="50%">`+ config.min + `</text>
<text ng-if="${config.tickmode != 'off'}" ng-repeat="x in [].constructor(${config.interticks.length}) track by $index" id=level_tick_{{unique}}_{{$index}}
class="txt-{{unique}} small" text-anchor="middle" dominant-baseline="middle"
y="50%"></text>
<text id=level_max_{{unique}} class="txt-{{unique}} small" text-anchor="end" dominant-baseline="middle" ng-attr-x=`+ config.lastpos + `px y="50%">` + config.max + `</text>
<text ng-if="${config.minmaxticks == 'hide'}" id=level_max_{{unique}} class="txt-{{unique}} small" text-anchor="end" dominant-baseline="middle" ng-attr-x=`+ config.lastpos + `px y="50%">` + config.max + `</text>
</svg>`
var layout;
Expand Down

0 comments on commit f4fe759

Please sign in to comment.