Skip to content

Commit

Permalink
Merge pull request #7057 from Lexachoc/ternary_cursor_fix
Browse files Browse the repository at this point in the history
Fix missing cursor for ternary plot
  • Loading branch information
archmoj authored Jul 22, 2024
2 parents 7b8e80c + 7e9abcf commit 55d8f98
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions draftlogs/7057_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix missing cursor for Ternary Plot[[#7057](https://github.com/plotly/plotly.js/pull/7057)],
with thanks to @Lexachoc for the contribution!
7 changes: 7 additions & 0 deletions src/plots/ternary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,10 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
}
}
};

exports.updateFx = function(gd) {
var fullLayout = gd._fullLayout;
fullLayout._ternarylayer
.selectAll('g.toplevel')
.style('cursor', fullLayout.dragmode === 'pan' ? 'move' : 'crosshair');
};
7 changes: 7 additions & 0 deletions src/plots/ternary/ternary.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function Ternary(options, fullLayout) {
this.graphDiv = options.graphDiv;
this.init(fullLayout);
this.makeFramework(fullLayout);
this.updateFx(fullLayout);

// unfortunately, we have to keep track of some axis tick settings
// as ternary subplots do not implement the 'ticks' editType
Expand Down Expand Up @@ -97,6 +98,12 @@ proto.makeFramework = function(fullLayout) {
Drawing.setClipUrl(_this.layers.grids, clipId, gd);
};

proto.updateFx = function(fullLayout) {
fullLayout._ternarylayer
.selectAll('g.toplevel')
.style('cursor', fullLayout.dragmode === 'pan' ? 'move' : 'crosshair');
};

proto.updateLayers = function(ternaryLayout) {
var _this = this;
var layers = _this.layers;
Expand Down

0 comments on commit 55d8f98

Please sign in to comment.