Skip to content

Commit 1879cf9

Browse files
authoredJul 19, 2017
Merge pull request #1897 from plotly/errorbars-nss
better zooming behavior for errorbars, bars, and box plots
2 parents bc5726c + 819f146 commit 1879cf9

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed
 

‎src/components/errorbars/plot.js

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ module.exports = function plot(traces, plotinfo, transitionOpts) {
8989

9090
if(isNew) {
9191
yerror = errorbar.append('path')
92+
.style('vector-effect', 'non-scaling-stroke')
9293
.classed('yerror', true);
9394
} else if(hasAnimation) {
9495
yerror = yerror
@@ -117,6 +118,7 @@ module.exports = function plot(traces, plotinfo, transitionOpts) {
117118

118119
if(isNew) {
119120
xerror = errorbar.append('path')
121+
.style('vector-effect', 'non-scaling-stroke')
120122
.classed('xerror', true);
121123
} else if(hasAnimation) {
122124
xerror = xerror

‎src/plots/cartesian/dragbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
747747
.call(Drawing.setTranslate, clipDx, clipDy)
748748
.call(Drawing.setScale, xScaleFactor2, yScaleFactor2);
749749

750-
var scatterPoints = subplot.plot.select('.scatterlayer').selectAll('.points');
750+
var scatterPoints = subplot.plot.selectAll('.scatterlayer .points, .boxlayer .points');
751751

752752
subplot.plot
753753
.call(Drawing.setTranslate, plotDx, plotDy)

‎src/traces/bar/plot.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ module.exports = function plot(gd, plotinfo, cdbar) {
124124
// append bar path and text
125125
var bar = d3.select(this);
126126

127-
bar.append('path').attr('d',
128-
'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z');
127+
bar.append('path')
128+
.style('vector-effect', 'non-scaling-stroke')
129+
.attr('d',
130+
'M' + x0 + ',' + y0 + 'V' + y1 + 'H' + x1 + 'V' + y0 + 'Z');
129131

130132
appendBarText(gd, bar, d, i, x0, x1, y0, y1);
131133
});

‎src/traces/box/plot.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ module.exports = function plot(gd, plotinfo, cdbox) {
8282
d3.select(this).selectAll('path.box')
8383
.data(Lib.identity)
8484
.enter().append('path')
85+
.style('vector-effect', 'non-scaling-stroke')
8586
.attr('class', 'box')
8687
.each(function(d) {
8788
var posc = posAxis.c2p(d.pos + bPos, true),
@@ -204,6 +205,7 @@ module.exports = function plot(gd, plotinfo, cdbox) {
204205
});
205206
})
206207
.enter().append('path')
208+
.classed('point', true)
207209
.call(Drawing.translatePoints, xa, ya);
208210
}
209211
// draw mean (and stdev diamond) if desired
@@ -212,7 +214,10 @@ module.exports = function plot(gd, plotinfo, cdbox) {
212214
.data(Lib.identity)
213215
.enter().append('path')
214216
.attr('class', 'mean')
215-
.style('fill', 'none')
217+
.style({
218+
fill: 'none',
219+
'vector-effect': 'non-scaling-stroke'
220+
})
216221
.each(function(d) {
217222
var posc = posAxis.c2p(d.pos + bPos, true),
218223
pos0 = posAxis.c2p(d.pos + bPos - bdPos, true),

0 commit comments

Comments
 (0)
Please sign in to comment.