Skip to content

Commit 55d8f98

Browse files
authored
Merge pull request #7057 from Lexachoc/ternary_cursor_fix
Fix missing cursor for ternary plot
2 parents 7b8e80c + 7e9abcf commit 55d8f98

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

draftlogs/7057_fix.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix missing cursor for Ternary Plot[[#7057](https://github.com/plotly/plotly.js/pull/7057)],
2+
with thanks to @Lexachoc for the contribution!

src/plots/ternary/index.js

+7
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,10 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
7575
}
7676
}
7777
};
78+
79+
exports.updateFx = function(gd) {
80+
var fullLayout = gd._fullLayout;
81+
fullLayout._ternarylayer
82+
.selectAll('g.toplevel')
83+
.style('cursor', fullLayout.dragmode === 'pan' ? 'move' : 'crosshair');
84+
};

src/plots/ternary/ternary.js

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function Ternary(options, fullLayout) {
3030
this.graphDiv = options.graphDiv;
3131
this.init(fullLayout);
3232
this.makeFramework(fullLayout);
33+
this.updateFx(fullLayout);
3334

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

101+
proto.updateFx = function(fullLayout) {
102+
fullLayout._ternarylayer
103+
.selectAll('g.toplevel')
104+
.style('cursor', fullLayout.dragmode === 'pan' ? 'move' : 'crosshair');
105+
};
106+
100107
proto.updateLayers = function(ternaryLayout) {
101108
var _this = this;
102109
var layers = _this.layers;

0 commit comments

Comments
 (0)