diff --git a/draftlogs/7057_fix.md b/draftlogs/7057_fix.md new file mode 100644 index 00000000000..b310a59d947 --- /dev/null +++ b/draftlogs/7057_fix.md @@ -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! diff --git a/src/plots/ternary/index.js b/src/plots/ternary/index.js index 2f65f155961..12147231744 100644 --- a/src/plots/ternary/index.js +++ b/src/plots/ternary/index.js @@ -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'); +}; diff --git a/src/plots/ternary/ternary.js b/src/plots/ternary/ternary.js index 45bdd84e47f..06a457d6d3e 100644 --- a/src/plots/ternary/ternary.js +++ b/src/plots/ternary/ternary.js @@ -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 @@ -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;