Skip to content

Commit 68c2aef

Browse files
committed
add mock to test bullet spanning negative values
1 parent 6e9def2 commit 68c2aef

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/traces/indicator/plot.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,12 @@ function strTranslate(x, y) {
826826

827827
function fitTextInsideBox(textBB, width, height) {
828828
// compute scaling ratio to have text fit within specified width and height
829-
// var textBB = Drawing.bBox(el.node());
830829
var ratio = Math.min(width / textBB.width, height / textBB.height);
831830
return [ratio, textBB, width + 'x' + height];
832831
}
833832

834833
function fitTextInsideCircle(textBB, radius) {
835834
// compute scaling ratio to have text fit within specified radius
836-
// var textBB = Drawing.bBox(el.node());
837835
var elRadius = Math.sqrt((textBB.width / 2) * (textBB.width / 2) + textBB.height * textBB.height);
838836
var ratio = radius / elRadius;
839837
return [ratio, textBB, radius];
-243 Bytes
Loading

test/image/mocks/indicator_grid_template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"type": "indicator",
44
"value": 120,
55
"delta": {"reference": 60},
6-
"gauge": {"axis": {"visible": false}},
6+
"gauge": {"axis": {"visible": false, "range": [0, 200]}},
77
"domain": {"row": 0, "column": 0}
88
}, {
99
"type": "indicator",
1010
"value": 120,
11-
"gauge": {"shape": "bullet", "axis": {"visible": false}},
11+
"gauge": {"shape": "bullet", "axis": {"visible": false, "range": [-200, 200]}},
1212
"domain": {"x": [0.05, 0.5], "y": [0.15, 0.35]}
1313
}, {
1414
"type": "indicator",

0 commit comments

Comments
 (0)