8000 Fix scatterternary lasso/select drag modes by etpinard · Pull Request #1831 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Fix scatterternary lasso/select drag modes #1831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 28, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rm ternary-only zoom layer
- use graph-wide <g.zoomlayer> for ternary zoom effects,
  no need to another layer to accomplish this.
  • Loading branch information
etpinard committed Jun 28, 2017
commit ec6e3608ef3d562f7145eec5ee25d5b368325ee6
9 changes: 5 additions & 4 deletions src/plots/ternary/ternary.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ proto.makeFramework = function() {
'backplot',
'grids',
'frontplot',
'zoom',
'aaxis', 'baxis', 'caxis', 'axlines'
];
var toplevel = _this.plotContainer.selectAll('g.toplevel')
Expand Down Expand Up @@ -263,7 +262,7 @@ proto.adjustLayout = function(ternaryLayout, graphSize) {
_this.layers.plotbg.select('path').attr('d', triangleClip);

var plotTransform = 'translate(' + x0 + ',' + y0 + ')';
_this.plotContainer.selectAll('.scatterlayer,.maplayer,.zoom')
_this.plotContainer.selectAll('.scatterlayer,.maplayer')
.attr('transform', plotTransform);

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

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

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

corners = zoomContainer.append('path')
.attr('class', 'zoombox-corners')
.attr('transform', 'translate(' + _this.x0 + ', ' + _this.y0 + ')')
.style({
fill: Color.background,
stroke: Color.defaultLine,
Expand Down Expand Up @@ -603,7 +604,7 @@ proto.initInteractions = function() {
// until we get around to persistent selections, remove the outline
// here. The selection itself will be removed when the plot redraws
// at the end.
_this.plotContainer.selectAll('.select-outline').remove();
zoomContainer.selectAll('.select-outline').remove();
}

function doubleClick() {
Expand Down
0