Skip to content

Commit 75f243c

Browse files
committed
pass graphDiv to scene constructor
1 parent 5d6ce26 commit 75f243c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/plots/gl3d/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ exports.plot = function plotGl3d(gd) {
5151
// If Scene is not instantiated, create one!
5252
if(scene === undefined) {
5353
scene = new Scene({
54-
container: gd.querySelector('.gl-container'),
5554
id: sceneId,
55+
graphDiv: gd,
56+
container: gd.querySelector('.gl-container'),
5657
staticPlot: gd._context.staticPlot,
5758
plotGlPixelRatio: gd._context.plotGlPixelRatio
5859
},

src/plots/gl3d/scene.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ function Scene(options, fullLayout) {
180180
var sceneContainer = document.createElement('div');
181181
var plotContainer = options.container;
182182

183+
// keep a ref to the graph div to fire hover+click events
184+
this.graphDiv = options.graphDiv;
183185
//Create SVG container for hover text
184186
var svgContainer = document.createElementNS(
185187
'http://www.w3.org/2000/svg',

0 commit comments

Comments
 (0)