Skip to content

Commit d87a448

Browse files
committed
sane defaults for gauge's background, 🔒 gauge.axis.visible with mock
1 parent 9b3433c commit d87a448

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

src/traces/indicator/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ module.exports = {
318318
borderwidth: {
319319
valType: 'number',
320320
min: 0,
321-
dflt: 0,
321+
dflt: 1,
322322
role: 'info',
323323
editType: 'plot',
324324
description: 'Sets the width (in px) of the border enclosing the gauge.'

src/traces/indicator/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function supplyDefaults(traceIn, traceOut, defaultColor, layout) {
101101
}
102102

103103
// gauge background
104-
coerceGauge('bgcolor');
104+
coerceGauge('bgcolor', layout.paper_bgcolor);
105105
coerceGauge('borderwidth');
106106
coerceGauge('bordercolor');
107107

33.1 KB
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"data": [{
3+
"type": "indicator",
4+
"value": 120,
5+
"delta": {"reference": 60},
6+
"gauge": {"axis": {"visible": false}},
7+
"domain": {"row": 0, "column": 0}
8+
}, {
9+
"type": "indicator",
10+
"value": 120,
11+
"delta": {"reference": 60},
12+
"gauge": {"shape": "bullet", "axis": {"visible": false}},
13+
"domain": {"row": 1, "y": [0.15, 0.35]}
14+
}, {
15+
"type": "indicator",
16+
"mode": "number+delta",
17+
"value": 120,
18+
"delta": {"reference": 60},
19+
"domain": {"row": 0, "column": 1}
20+
}, {
21+
"type": "indicator",
22+
"mode": "delta",
23+
"value": 40,
24+
"delta": {"reference": 60},
25+
"domain": {"row": 1, "column": 1}
26+
}],
27+
"layout": {
28+
"width": 700,
29+
"height": 400,
30+
"margin": {"t": 25, "b": 25, "l": 25, "r": 25},
31+
"grid": {"rows": 2, "columns": 2, "pattern": "independent"},
32+
"template": {
33+
"data": {
34+
"indicator": [{
35+
"mode": "number+delta+gauge"
36+
}]
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)