Skip to content

Commit f49dd51

Browse files
committed
handle step 'all' case in label text
1 parent 053be81 commit f49dd51

File tree

1 file changed

+7
-2
lines changed
  • src/components/rangeselector

1 file changed

+7
-2
lines changed

src/components/rangeselector/draw.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,19 @@ function drawButtonText(button, selectorLayout, d) {
125125
.classed('selector-text', true)
126126
.classed('user-select-none', true);
127127

128-
// TODO is this correct?
129128
text.attr('text-anchor', 'middle');
130129

131130
text.call(Drawing.font, selectorLayout.font)
132-
.text(d.label || d.count + ' ' + d.step.charAt(0))
131+
.text(getLabel(d))
133132
.call(textLayout);
134133
}
135134

135+
function getLabel(opts) {
136+
if(opts.step === 'all') return 'reset';
137+
138+
return opts.label || opts.count + ' ' + opts.step.charAt(0);
139+
}
140+
136141
function reposition(gd, buttons, opts) {
137142
opts.width = 0;
138143
opts.height = 0;

0 commit comments

Comments
 (0)