Skip to content

Commit e32fe28

Browse files
committed
disbale interactions with sankey when staticPlot is true
1 parent 327cda8 commit e32fe28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/traces/sankey/render.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,8 @@ function switchToSankeyFormat(nodes) {
804804

805805
// scene graph
806806
module.exports = function(gd, svg, calcData, layout, callbacks) {
807+
var isStatic = gd._context.staticPlot;
808+
807809
// To prevent animation on first render
808810
var firstRender = false;
809811
Lib.ensureSingle(gd._fullLayout._infolayer, 'g', 'first-render', function() {
@@ -830,7 +832,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
830832
.style('position', 'absolute')
831833
.style('left', 0)
832834
.style('shape-rendering', 'geometricPrecision')
833-
.style('pointer-events', 'auto')
835+
.style('pointer-events', isStatic ? 'none' : 'auto')
834836
.attr('transform', sankeyTransform);
835837

836838
sankey.each(function(d, i) {
@@ -843,7 +845,7 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
843845

844846
// Style dragbox
845847
gd._fullData[i]._bgRect
846-
.style('pointer-events', 'all')
848+
.style('pointer-events', isStatic ? 'none' : 'all')
847849
.attr('width', d.width)
848850
.attr('height', d.height)
849851
.attr('x', d.translateX)

0 commit comments

Comments
 (0)