@@ -65,7 +65,7 @@ var numericNameWarningCountLimit = 5;
65
65
* object containing `data`, `layout`, `config`, and `frames` members
66
66
*
67
67
*/
68
- Plotly . plot = function ( gd , data , layout , config ) {
68
+ exports . plot = function ( gd , data , layout , config ) {
69
69
var frames ;
70
70
71
71
gd = Lib . getGraphDiv ( gd ) ;
@@ -93,7 +93,7 @@ Plotly.plot = function(gd, data, layout, config) {
93
93
94
94
function addFrames ( ) {
95
95
if ( frames ) {
96
- return Plotly . addFrames ( gd , frames ) ;
96
+ return exports . addFrames ( gd , frames ) ;
97
97
}
98
98
}
99
99
@@ -627,7 +627,7 @@ function plotPolar(gd, data, layout) {
627
627
}
628
628
629
629
// convenience function to force a full redraw, mostly for use by plotly.js
630
- Plotly . redraw = function ( gd ) {
630
+ exports . redraw = function ( gd ) {
631
631
gd = Lib . getGraphDiv ( gd ) ;
632
632
633
633
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -638,7 +638,7 @@ Plotly.redraw = function(gd) {
638
638
helpers . cleanLayout ( gd . layout ) ;
639
639
640
640
gd . calcdata = undefined ;
641
- return Plotly . plot ( gd ) . then ( function ( ) {
641
+ return exports . plot ( gd ) . then ( function ( ) {
642
642
gd . emit ( 'plotly_redraw' ) ;
643
643
return gd ;
644
644
} ) ;
@@ -652,14 +652,14 @@ Plotly.redraw = function(gd) {
652
652
* @param {Object } layout
653
653
* @param {Object } config
654
654
*/
655
- Plotly . newPlot = function ( gd , data , layout , config ) {
655
+ exports . newPlot = function ( gd , data , layout , config ) {
656
656
gd = Lib . getGraphDiv ( gd ) ;
657
657
658
658
// remove gl contexts
659
659
Plots . cleanPlot ( [ ] , { } , gd . _fullData || { } , gd . _fullLayout || { } ) ;
660
660
661
661
Plots . purge ( gd ) ;
662
- return Plotly . plot ( gd , data , layout , config ) ;
662
+ return exports . plot ( gd , data , layout , config ) ;
663
663
} ;
664
664
665
665
/**
@@ -987,7 +987,7 @@ function concatTypedArray(arr0, arr1) {
987
987
* @param {Number|Object } [maxPoints] Number of points for trace window after lengthening.
988
988
*
989
989
*/
990
- Plotly . extendTraces = function extendTraces ( gd , update , indices , maxPoints ) {
990
+ exports . extendTraces = function extendTraces ( gd , update , indices , maxPoints ) {
991
991
gd = Lib . getGraphDiv ( gd ) ;
992
992
993
993
function updateArray ( target , insert , maxp ) {
@@ -1038,14 +1038,14 @@ Plotly.extendTraces = function extendTraces(gd, update, indices, maxPoints) {
1038
1038
}
1039
1039
1040
1040
var undo = spliceTraces ( gd , update , indices , maxPoints , updateArray ) ;
1041
- var promise = Plotly . redraw ( gd ) ;
1041
+ var promise = exports . redraw ( gd ) ;
1042
1042
var undoArgs = [ gd , undo . update , indices , undo . maxPoints ] ;
1043
- Queue . add ( gd , Plotly . prependTraces , undoArgs , extendTraces , arguments ) ;
1043
+ Queue . add ( gd , exports . prependTraces , undoArgs , extendTraces , arguments ) ;
1044
1044
1045
1045
return promise ;
1046
1046
} ;
1047
1047
1048
- Plotly . prependTraces = function prependTraces ( gd , update , indices , maxPoints ) {
1048
+ exports . prependTraces = function prependTraces ( gd , update , indices , maxPoints ) {
1049
1049
gd = Lib . getGraphDiv ( gd ) ;
1050
1050
1051
1051
function updateArray ( target , insert , maxp ) {
@@ -1095,9 +1095,9 @@ Plotly.prependTraces = function prependTraces(gd, update, indices, maxPoints) {
1095
1095
}
1096
1096
1097
1097
var undo = spliceTraces ( gd , update , indices , maxPoints , updateArray ) ;
1098
- var promise = Plotly . redraw ( gd ) ;
1098
+ var promise = exports . redraw ( gd ) ;
1099
1099
var undoArgs = [ gd , undo . update , indices , undo . maxPoints ] ;
1100
- Queue . add ( gd , Plotly . extendTraces , undoArgs , prependTraces , arguments ) ;
1100
+ Queue . add ( gd , exports . extendTraces , undoArgs , prependTraces , arguments ) ;
1101
1101
1102
1102
return promise ;
1103
1103
} ;
@@ -1111,11 +1111,11 @@ Plotly.prependTraces = function prependTraces(gd, update, indices, maxPoints) {
1111
1111
* @param {Number[]|Number } [newIndices=[gd.data.length]] Locations to add traces
1112
1112
*
1113
1113
*/
1114
- Plotly . addTraces = function addTraces ( gd , traces , newIndices ) {
1114
+ exports . addTraces = function addTraces ( gd , traces , newIndices ) {
1115
1115
gd = Lib . getGraphDiv ( gd ) ;
1116
1116
1117
1117
var currentIndices = [ ] ,
1118
- undoFunc = Plotly . deleteTraces ,
1118
+ undoFunc = exports . deleteTraces ,
1119
1119
redoFunc = addTraces ,
1120
1120
undoArgs = [ gd , currentIndices ] ,
1121
1121
redoArgs = [ gd , traces ] , // no newIndices here
@@ -1150,7 +1150,7 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) {
1150
1150
// if the user didn't define newIndices, they just want the traces appended
1151
1151
// i.e., we can simply redraw and be done
1152
1152
if ( typeof newIndices === 'undefined' ) {
1153
- promise = Plotly . redraw ( gd ) ;
1153
+ promise = exports . redraw ( gd ) ;
1154
1154
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1155
1155
return promise ;
1156
1156
}
@@ -1176,7 +1176,7 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) {
1176
1176
// this requires some extra work that moveTraces will do
1177
1177
Queue . startSequence ( gd ) ;
1178
1178
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1179
- promise = Plotly . moveTraces ( gd , currentIndices , newIndices ) ;
1179
+ promise = exports . moveTraces ( gd , currentIndices , newIndices ) ;
1180
1180
Queue . stopSequence ( gd ) ;
1181
1181
return promise ;
1182
1182
} ;
@@ -1188,11 +1188,11 @@ Plotly.addTraces = function addTraces(gd, traces, newIndices) {
1188
1188
* @param {Object[] } gd.data The array of traces we're removing from
1189
1189
* @param {Number|Number[] } indices The indices
1190
1190
*/
1191
- Plotly . deleteTraces = function deleteTraces ( gd , indices ) {
1191
+ exports . deleteTraces = function deleteTraces ( gd , indices ) {
1192
1192
gd = Lib . getGraphDiv ( gd ) ;
1193
1193
1194
1194
var traces = [ ] ,
1195
- undoFunc = Plotly . addTraces ,
1195
+ undoFunc = exports . addTraces ,
1196
1196
redoFunc = deleteTraces ,
1197
1197
undoArgs = [ gd , traces , indices ] ,
1198
1198
redoArgs = [ gd , indices ] ,
@@ -1217,7 +1217,7 @@ Plotly.deleteTraces = function deleteTraces(gd, indices) {
1217
1217
traces . push ( deletedTrace ) ;
1218
1218
}
1219
1219
1220
- var promise = Plotly . redraw ( gd ) ;
1220
+ var promise = exports . redraw ( gd ) ;
1221
1221
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1222
1222
1223
1223
return promise ;
@@ -1254,7 +1254,7 @@ Plotly.deleteTraces = function deleteTraces(gd, indices) {
1254
1254
* // reorder all traces (assume there are 5--a, b, c, d, e)
1255
1255
* Plotly.moveTraces(gd, [b, d, e, a, c]) // same as 'move to end'
1256
1256
*/
1257
- Plotly . moveTraces = function moveTraces ( gd , currentIndices , newIndices ) {
1257
+ exports . moveTraces = function moveTraces ( gd , currentIndices , newIndices ) {
1258
1258
gd = Lib . getGraphDiv ( gd ) ;
1259
1259
1260
1260
var newData = [ ] ,
@@ -1315,7 +1315,7 @@ Plotly.moveTraces = function moveTraces(gd, currentIndices, newIndices) {
1315
1315
1316
1316
gd . data = newData ;
1317
1317
1318
- var promise = Plotly . redraw ( gd ) ;
1318
+ var promise = exports . redraw ( gd ) ;
1319
1319
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1320
1320
1321
1321
return promise ;
@@ -1351,7 +1351,7 @@ Plotly.moveTraces = function moveTraces(gd, currentIndices, newIndices) {
1351
1351
* If the array is too short, it will wrap around (useful for
1352
1352
* style files that want to specify cyclical default values).
1353
1353
*/
1354
- Plotly . restyle = function restyle ( gd , astr , val , _traces ) {
1354
+ exports . restyle = function restyle ( gd , astr , val , _traces ) {
1355
1355
gd = Lib . getGraphDiv ( gd ) ;
1356
1356
helpers . clearPromiseQueue ( gd ) ;
1357
1357
@@ -1382,7 +1382,7 @@ Plotly.restyle = function restyle(gd, astr, val, _traces) {
1382
1382
var seq = [ ] ;
1383
1383
1384
1384
if ( flags . fullReplot ) {
1385
- seq . push ( Plotly . plot ) ;
1385
+ seq . push ( exports . plot ) ;
1386
1386
} else {
1387
1387
seq . push ( Plots . previousPromises ) ;
1388
1388
@@ -2156,7 +2156,7 @@ function refAutorange(gd, obj, axLetter) {
2156
2156
* integer or array of integers for the traces to alter (all if omitted)
2157
2157
*
2158
2158
*/
2159
- Plotly . update = function update ( gd , traceUpdate , layoutUpdate , _traces ) {
2159
+ exports . update = function update ( gd , traceUpdate , layoutUpdate , _traces ) {
2160
2160
gd = Lib . getGraphDiv ( gd ) ;
2161
2161
helpers . clearPromiseQueue ( gd ) ;
2162
2162
@@ -2194,10 +2194,10 @@ Plotly.update = function update(gd, traceUpdate, layoutUpdate, _traces) {
2194
2194
gd . data = undefined ;
2195
2195
gd . layout = undefined ;
2196
2196
2197
- seq . push ( function ( ) { return Plotly . plot ( gd , data , layout ) ; } ) ;
2197
+ seq . push ( function ( ) { return exports . plot ( gd , data , layout ) ; } ) ;
2198
2198
}
2199
2199
else if ( restyleFlags . fullReplot ) {
2200
- seq . push ( Plotly . plot ) ;
2200
+ seq . push ( exports . plot ) ;
2201
2201
}
2202
2202
else if ( relayoutFlags . layoutReplot ) {
2203
2203
seq . push ( subroutines . layoutReplot ) ;
@@ -2258,10 +2258,10 @@ Plotly.update = function update(gd, traceUpdate, layoutUpdate, _traces) {
2258
2258
* object containing `data`, `layout`, `config`, and `frames` members
2259
2259
*
2260
2260
*/
2261
- Plotly . react = function ( gd , data , layout , config ) {
2261
+ exports . react = function ( gd , data , layout , config ) {
2262
2262
var frames , plotDone ;
2263
2263
2264
- function addFrames ( ) { return Plotly . addFrames ( gd , frames ) ; }
2264
+ function addFrames ( ) { return exports . addFrames ( gd , frames ) ; }
2265
2265
2266
2266
gd = Lib . getGraphDiv ( gd ) ;
2267
2267
@@ -2270,7 +2270,7 @@ Plotly.react = function(gd, data, layout, config) {
2270
2270
2271
2271
// you can use this as the initial draw as well as to update
2272
2272
if ( ! Lib . isPlotDiv ( gd ) || ! oldFullData || ! oldFullLayout ) {
2273
- plotDone = Plotly . newPlot ( gd , data , layout , config ) ;
2273
+ plotDone = exports . newPlot ( gd , data , layout , config ) ;
2274
2274
}
2275
2275
else {
2276
2276
@@ -2323,7 +2323,7 @@ Plotly.react = function(gd, data, layout, config) {
2323
2323
2324
2324
if ( restyleFlags . fullReplot || relayoutFlags . layoutReplot || configChanged ) {
2325
2325
gd . _fullLayout . _skipDefaults = true ;
2326
- seq . push ( Plotly . plot ) ;
2326
+ seq . push ( exports . plot ) ;
2327
2327
}
2328
2328
else {
2329
2329
for ( var componentType in relayoutFlags . arrays ) {
@@ -2660,7 +2660,7 @@ function diffConfig(oldConfig, newConfig) {
2660
2660
* @param {object } animationOpts
2661
2661
* configuration for the animation
2662
2662
*/
2663
- Plotly . animate = function ( gd , frameOrGroupNameOrFrameList , animationOpts ) {
2663
+ exports . animate = function ( gd , frameOrGroupNameOrFrameList , animationOpts ) {
2664
2664
gd = Lib . getGraphDiv ( gd ) ;
2665
2665
2666
2666
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -3024,7 +3024,7 @@ Plotly.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
3024
3024
* provided, an index will be provided in serial order. If already used, the frame
3025
3025
* will be overwritten.
3026
3026
*/
3027
- Plotly . addFrames = function ( gd , frameList , indices ) {
3027
+ exports . addFrames = function ( gd , frameList , indices ) {
3028
3028
gd = Lib . getGraphDiv ( gd ) ;
3029
3029
3030
3030
if ( frameList === null || frameList === undefined ) {
@@ -3153,7 +3153,7 @@ Plotly.addFrames = function(gd, frameList, indices) {
3153
3153
* @param {array of integers } frameList
3154
3154
* list of integer indices of frames to be deleted
3155
3155
*/
3156
- Plotly . deleteFrames = function ( gd , frameList ) {
3156
+ exports . deleteFrames = function ( gd , frameList ) {
3157
3157
gd = Lib . getGraphDiv ( gd ) ;
3158
3158
3159
3159
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -3197,7 +3197,7 @@ Plotly.deleteFrames = function(gd, frameList) {
3197
3197
* @param {string id or DOM element } gd
3198
3198
* the id or DOM element of the graph container div
3199
3199
*/
3200
- Plotly . purge = function purge ( gd ) {
3200
+ exports . purge = function purge ( gd ) {
3201
3201
gd = Lib . getGraphDiv ( gd ) ;
3202
3202
3203
3203
var fullLayout = gd . _fullLayout || { } ,
0 commit comments