|
9 | 9 |
|
10 | 10 | 'use strict'; |
11 | 11 |
|
12 | | -var Plotly = require('../../plotly'); |
| 12 | +var Registry = require('../../registry'); |
13 | 13 | var Plots = require('../../plots/plots'); |
14 | 14 | var axisIds = require('../../plots/cartesian/axis_ids'); |
15 | 15 | var Lib = require('../../lib'); |
16 | 16 | var downloadImage = require('../../snapshot/download'); |
17 | 17 | var Icons = require('../../../build/ploticon'); |
18 | 18 |
|
19 | | - |
20 | 19 | var _ = Lib._; |
21 | 20 |
|
22 | 21 | var modeBarButtons = module.exports = {}; |
@@ -250,7 +249,7 @@ function handleCartesian(gd, ev) { |
250 | 249 | aobj[astr] = val; |
251 | 250 | } |
252 | 251 |
|
253 | | - Plotly.relayout(gd, aobj); |
| 252 | + Registry.call('relayout', [gd, aobj]); |
254 | 253 | } |
255 | 254 |
|
256 | 255 | modeBarButtons.zoom3d = { |
@@ -306,7 +305,7 @@ function handleDrag3d(gd, ev) { |
306 | 305 | var val2d = (val === 'pan') ? val : 'zoom'; |
307 | 306 | layoutUpdate.dragmode = val2d; |
308 | 307 |
|
309 | | - Plotly.relayout(gd, layoutUpdate); |
| 308 | + Registry.call('relayout', [gd, layoutUpdate]); |
310 | 309 | } |
311 | 310 |
|
312 | 311 | modeBarButtons.resetCameraDefault3d = { |
@@ -345,7 +344,7 @@ function handleCamera3d(gd, ev) { |
345 | 344 | } |
346 | 345 | } |
347 | 346 |
|
348 | | - Plotly.relayout(gd, aobj); |
| 347 | + Registry.call('relayout', [gd, aobj]); |
349 | 348 | } |
350 | 349 |
|
351 | 350 | modeBarButtons.hoverClosest3d = { |
@@ -406,7 +405,7 @@ function handleHover3d(gd, ev) { |
406 | 405 | button._previousVal = Lib.extendDeep({}, currentSpikes); |
407 | 406 | } |
408 | 407 |
|
409 | | - Plotly.relayout(gd, layoutUpdate); |
| 408 | + Registry.call('relayout', [gd, layoutUpdate]); |
410 | 409 | } |
411 | 410 |
|
412 | 411 | modeBarButtons.zoomInGeo = { |
@@ -462,7 +461,7 @@ function handleGeo(gd, ev) { |
462 | 461 | var scale = geoLayout.projection.scale; |
463 | 462 | var newScale = (val === 'in') ? 2 * scale : 0.5 * scale; |
464 | 463 |
|
465 | | - Plotly.relayout(gd, id + '.projection.scale', newScale); |
| 464 | + Registry.call('relayout', [gd, id + '.projection.scale', newScale]); |
466 | 465 | } else if(attr === 'reset') { |
467 | 466 | resetView(gd, 'geo'); |
468 | 467 | } |
@@ -501,7 +500,7 @@ function toggleHover(gd) { |
501 | 500 |
|
502 | 501 | var newHover = gd._fullLayout.hovermode ? false : onHoverVal; |
503 | 502 |
|
504 | | - Plotly.relayout(gd, 'hovermode', newHover); |
| 503 | + Registry.call('relayout', [gd, 'hovermode', newHover]); |
505 | 504 | } |
506 | 505 |
|
507 | 506 | // buttons when more then one plot types are present |
@@ -556,7 +555,7 @@ modeBarButtons.toggleSpikelines = { |
556 | 555 |
|
557 | 556 | var aobj = setSpikelineVisibility(gd); |
558 | 557 |
|
559 | | - Plotly.relayout(gd, aobj); |
| 558 | + Registry.call('relayout', [gd, aobj]); |
560 | 559 | } |
561 | 560 | }; |
562 | 561 |
|
@@ -603,5 +602,5 @@ function resetView(gd, subplotType) { |
603 | 602 | } |
604 | 603 | } |
605 | 604 |
|
606 | | - Plotly.relayout(gd, aObj); |
| 605 | + Registry.call('relayout', [gd, aObj]); |
607 | 606 | } |
0 commit comments