Skip to content

Commit d26a4b4

Browse files
committed
ohlc: bump tickwidth dflt to 0.1
1 parent 6036045 commit d26a4b4

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/traces/ohlc/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ module.exports = {
102102
valType: 'number',
103103
min: 0,
104104
max: 0.5,
105-
dflt: 0.05,
105+
dflt: 0.1,
106106
role: 'style',
107107
description: [
108108
'Sets the width of the open/close tick marks',

test/jasmine/tests/finance_test.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,16 +304,16 @@ describe('finance charts calc transforms:', function() {
304304
var out = _calc([trace0, trace1]);
305305

306306
expect(out[0].x).toEqual([
307-
-0.05, 0, 0, 0, 0, 0.05, null,
308-
2.95, 3, 3, 3, 3, 3.05, null,
309-
4.95, 5, 5, 5, 5, 5.05, null,
310-
6.95, 7, 7, 7, 7, 7.05, null
307+
-0.1, 0, 0, 0, 0, 0.1, null,
308+
2.9, 3, 3, 3, 3, 3.1, null,
309+
4.9, 5, 5, 5, 5, 5.1, null,
310+
6.9, 7, 7, 7, 7, 7.1, null
311311
]);
312312
expect(out[1].x).toEqual([
313-
0.95, 1, 1, 1, 1, 1.05, null,
314-
1.95, 2, 2, 2, 2, 2.05, null,
315-
3.95, 4, 4, 4, 4, 4.05, null,
316-
5.95, 6, 6, 6, 6, 6.05, null
313+
0.9, 1, 1, 1, 1, 1.1, null,
314+
1.9, 2, 2, 2, 2, 2.1, null,
315+
3.9, 4, 4, 4, 4, 4.1, null,
316+
5.9, 6, 6, 6, 6, 6.1, null
317317
]);
318318
expect(out[2].x).toEqual([
319319
0, 0, 0, 0, 0, 0,
@@ -384,6 +384,7 @@ describe('finance charts calc transforms:', function() {
384384
it('should work with *filter* transforms', function() {
385385
var trace0 = Lib.extendDeep({}, mock1, {
386386
type: 'ohlc',
387+
tickwidth: 0.05,
387388
transforms: [{
388389
type: 'filter',
389390
operation: '>',
@@ -450,6 +451,7 @@ describe('finance charts calc transforms:', function() {
450451

451452
var trace0 = Lib.extendDeep({}, mock1, {
452453
type: 'ohlc',
454+
tickwidth: 0.05,
453455
transforms: [opts]
454456
});
455457

@@ -561,7 +563,7 @@ describe('finance charts updates:', function() {
561563
var path0;
562564

563565
Plotly.plot(gd, [trace0]).then(function() {
564-
expect(gd.calcdata[0][0].x).toEqual(-0.05);
566+
expect(gd.calcdata[0][0].x).toEqual(-0.1);
565567
expect(gd.calcdata[0][0].y).toEqual(33.01);
566568

567569
return Plotly.restyle(gd, 'tickwidth', 0.5);

0 commit comments

Comments
 (0)