Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc1aaba

Browse files
committed
style fix
1 parent 2d8eb81 commit fc1aaba

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/traces/indicator/attributes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ module.exports = {
108108
target: {
109109
valType: 'number',
110110
editType: 'calc',
111+
dflt: 0,
111112
role: 'info',
112113
description: [
113114
'Sets a target value.'

src/traces/indicator/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
'use strict';
1010

11-
// TODO: turn those constants into attributes
1211
module.exports = {
1312
INCREASING_COLOR: '#3D9970',
1413
DECREASING_COLOR: '#FF4136',
14+
// TODO: DIRSYMBOL into attributes
1515
DIRSYMBOL: {
1616
increasing: '▲',
1717
decreasing: '▼'

src/traces/indicator/plot.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ var d3 = require('d3');
1212

1313
var Lib = require('../../lib');
1414
var Drawing = require('../../components/drawing');
15+
var cn = require('./constants');
1516
// var Plots = require('../../plots/plots');
1617
// var Axes = require('../../plots/cartesian/axes');
1718
// var svgTextUtils = require('../../lib/svg_text_utils');
1819
//
1920
// // arc cotangent
2021
// function arcctg(x) { return Math.PI / 2 - Math.atan(x); }
21-
var cn = require('./constants');
2222
// var barPlot = require('../bar/plot').plot;
2323

2424
module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallback) {
@@ -71,7 +71,7 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
7171
return (d.delta > 0 ? cn.DIRSYMBOL.increasing : cn.DIRSYMBOL.decreasing) + value;
7272
};
7373
var tickerFill = function(d) {
74-
return d.delta > 0 ? trace.delta.increasing.color : trace.delta.decreasing.color;
74+
return d.delta >= 0 ? trace.delta.increasing.color : trace.delta.decreasing.color;
7575
};
7676

7777
// gauge related
@@ -82,19 +82,18 @@ module.exports = function plot(gd, cdModule, transitionOpts, makeOnCompleteCallb
8282
var theta = Math.PI / 2;
8383
var radius = Math.min(size.w / 2, size.h * 0.75);
8484
var innerRadius = cn.innerRadius * radius;
85-
86-
// bullet gauge
87-
var isBullet = isGauge && trace.gauge.shape === 'bullet';
88-
89-
var isWide = !(size.h > radius);
90-
9185
function valueToAngle(v) {
9286
var angle = (v - trace.min) / (trace.max - trace.min) * Math.PI - Math.PI / 2;
9387
if(angle < -theta) return -theta;
9488
if(angle > theta) return theta;
9589
return angle;
9690
}
9791

92+
// bullet gauge
93+
var isBullet = isGauge && trace.gauge.shape === 'bullet';
94+
95+
var isWide = !(size.h > radius);
96+
9897
// TODO: Move the following to defaults
9998
// Position elements
10099
var bignumberVerticalMargin, mainFontSize, bignumberX;

0 commit comments

Comments
 (0)