Skip to content

Commit fd538ca

Browse files
committed
factoring out tickFormat into a constant; unifying tick and extreme value formats
1 parent 1b7ebc7 commit fd538ca

File tree

6 files changed

+3
-2
lines changed

6 files changed

+3
-2
lines changed

src/traces/parcoords/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
legendWidth: 80,
1616
verticalPadding: 2, // otherwise, horizontal lines on top or bottom are of lower width
1717
tickDistance: 50,
18+
tickFormat: '3s',
1819
canvasPixelRatio: 1,
1920
blockLineCount: 5000,
2021
scatter: false,

src/traces/parcoords/parcoords.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ module.exports = function(root, svg, styledData, layout, callbacks) {
548548
.orient('left')
549549
.tickSize(4)
550550
.outerTickSize(2)
551-
.ticks(wantedTickCount, '3s') // works for continuous scales only...
551+
.ticks(wantedTickCount, c.tickFormat) // works for continuous scales only...
552552
.tickValues(d.ordinal ? // and this works for ordinal scales
553553
sdom.filter(function(d, i) {return !(i % Math.round((sdom.length / wantedTickCount)));})
554554
.map(function(d, i) {return texts && texts[i] || d;}) :
@@ -619,7 +619,7 @@ module.exports = function(root, svg, styledData, layout, callbacks) {
619619
.data(repeat, keyFun);
620620

621621
function formatExtreme(d) {
622-
return d.ordinal ? function() {return '';} : d3.format('.3s');
622+
return d.ordinal ? function() {return '';} : d3.format(c.tickFormat);
623623
}
624624

625625
axisExtentTopText.enter()
517 Bytes
Loading
-155 Bytes
Loading
-185 Bytes
Loading
425 Bytes
Loading

0 commit comments

Comments
 (0)