Skip to content

Commit ec6e360

Browse files
committed
rm ternary-only zoom layer
- use graph-wide <g.zoomlayer> for ternary zoom effects, no need to another layer to accomplish this.
1 parent 14ae77c commit ec6e360

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/plots/ternary/ternary.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ proto.makeFramework = function() {
8888
'backplot',
8989
'grids',
9090
'frontplot',
91-
'zoom',
9291
'aaxis', 'baxis', 'caxis', 'axlines'
9392
];
9493
var toplevel = _this.plotContainer.selectAll('g.toplevel')
@@ -263,7 +262,7 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
263262
_this.layers.plotbg.select('path').attr('d', triangleClip);
264263

265264
var plotTransform = 'translate(' + x0 + ',' + y0 + ')';
266-
_this.plotContainer.selectAll('.scatterlayer,.maplayer,.zoom')
265+
_this.plotContainer.selectAll('.scatterlayer,.maplayer')
267266
.attr('transform', plotTransform);
268267

269268
// TODO: shift axes to accommodate linewidth*sin(30) tick mark angle
@@ -382,7 +381,7 @@ proto.initInteractions = function() {
382381
var _this = this,
383382
dragger = _this.layers.plotbg.select('path').node(),
384383
gd = _this.graphDiv,
385-
zoomContainer = _this.layers.zoom;
384+
zoomContainer = gd._fullLayout._zoomlayer;
386385

387386
// use plotbg for the main interactions
388387
var dragOptions = {
@@ -441,6 +440,7 @@ proto.initInteractions = function() {
441440

442441
zb = zoomContainer.append('path')
443442
.attr('class', 'zoombox')
443+
.attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')
444444
.style({
445445
'fill': lum > 0.2 ? 'rgba(0,0,0,0)' : 'rgba(255,255,255,0)',
446446
'stroke-width': 0
@@ -449,6 +449,7 @@ proto.initInteractions = function() {
449449

450450
corners = zoomContainer.append('path')
451451
.attr('class', 'zoombox-corners')
452+
.attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')
452453
.style({
453454
fill: Color.background,
454455
stroke: Color.defaultLine,
@@ -603,7 +604,7 @@ proto.initInteractions = function() {
603604
// until we get around to persistent selections, remove the outline
604605
// here. The selection itself will be removed when the plot redraws
605606
// at the end.
606-
_this.plotContainer.selectAll('.select-outline').remove();
607+
zoomContainer.selectAll('.select-outline').remove();
607608
}
608609

609610
function doubleClick() {

0 commit comments

Comments
 (0)