Skip to content

Commit bf1a116

Browse files
committed
disbale interactions with sunburst, treemap & icicle when staticPlot is true
1 parent 1169948 commit bf1a116

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/traces/icicle/draw_descendants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) {
2929
var prevEntry = opts.prevEntry;
3030
var refRect = {};
3131

32+
var isStatic = gd._context.staticPlot;
33+
3234
var fullLayout = gd._fullLayout;
3335
var cd0 = cd[0];
3436
var trace = cd0.trace;
@@ -130,7 +132,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) {
130132
var sliceTop = d3.select(this);
131133

132134
var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {
133-
s.style('pointer-events', 'all');
135+
s.style('pointer-events', isStatic ? 'none' : 'all');
134136
});
135137

136138
if(hasTransition) {

src/traces/sunburst/plot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ exports.plot = function(gd, cdmodule, transitionOpts, makeOnCompleteCallback) {
8080
};
8181

8282
function plotOne(gd, cd, element, transitionOpts) {
83+
var isStatic = gd._context.staticPlot;
84+
8385
var fullLayout = gd._fullLayout;
8486
var hasTransition = !fullLayout.uniformtext.mode && helpers.hasTransition(transitionOpts);
8587

@@ -219,7 +221,7 @@ function plotOne(gd, cd, element, transitionOpts) {
219221
var sliceTop = d3.select(this);
220222

221223
var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {
222-
s.style('pointer-events', 'all');
224+
s.style('pointer-events', isStatic ? 'none' : 'all');
223225
});
224226

225227
pt.rpx0 = y2rpx(pt.y0);

src/traces/treemap/draw_ancestors.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
2828
var makeUpdateTextInterpolator = opts.makeUpdateTextInterpolator;
2929
var refRect = {};
3030

31+
var isStatic = gd._context.staticPlot;
32+
3133
var fullLayout = gd._fullLayout;
3234
var cd0 = cd[0];
3335
var trace = cd0.trace;
@@ -101,7 +103,7 @@ module.exports = function drawAncestors(gd, cd, entry, slices, opts) {
101103
var sliceTop = d3.select(this);
102104

103105
var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {
104-
s.style('pointer-events', 'all');
106+
s.style('pointer-events', isStatic ? 'none' : 'all');
105107
});
106108

107109
if(hasTransition) {

src/traces/treemap/draw_descendants.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) {
2929
var prevEntry = opts.prevEntry;
3030
var refRect = {};
3131

32+
var isStatic = gd._context.staticPlot;
33+
3234
var fullLayout = gd._fullLayout;
3335
var cd0 = cd[0];
3436
var trace = cd0.trace;
@@ -138,7 +140,7 @@ module.exports = function drawDescendants(gd, cd, entry, slices, opts) {
138140
var sliceTop = d3.select(this);
139141

140142
var slicePath = Lib.ensureSingle(sliceTop, 'path', 'surface', function(s) {
141-
s.style('pointer-events', 'all');
143+
s.style('pointer-events', isStatic ? 'none' : 'all');
142144
});
143145

144146
if(hasTransition) {

0 commit comments

Comments
 (0)