@@ -66,7 +66,7 @@ var numericNameWarningCountLimit = 5;
66
66
* object containing `data`, `layout`, `config`, and `frames` members
67
67
*
68
68
*/
69
- exports . plot = function ( gd , data , layout , config ) {
69
+ function plot ( gd , data , layout , config ) {
70
70
var frames ;
71
71
72
72
gd = Lib . getGraphDiv ( gd ) ;
@@ -391,7 +391,7 @@ exports.plot = function(gd, data, layout, config) {
391
391
emitAfterPlot ( gd ) ;
392
392
return gd ;
393
393
} ) ;
394
- } ;
394
+ }
395
395
396
396
function emitAfterPlot ( gd ) {
397
397
var fullLayout = gd . _fullLayout ;
@@ -403,9 +403,9 @@ function emitAfterPlot(gd) {
403
403
}
404
404
}
405
405
406
- exports . setPlotConfig = function setPlotConfig ( obj ) {
406
+ function setPlotConfig ( obj ) {
407
407
return Lib . extendFlat ( dfltConfig , obj ) ;
408
- } ;
408
+ }
409
409
410
410
function setBackground ( gd , bgColor ) {
411
411
try {
@@ -622,7 +622,7 @@ function plotLegacyPolar(gd, data, layout) {
622
622
}
623
623
624
624
// convenience function to force a full redraw, mostly for use by plotly.js
625
- exports . redraw = function ( gd ) {
625
+ function redraw ( gd ) {
626
626
gd = Lib . getGraphDiv ( gd ) ;
627
627
628
628
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -637,7 +637,7 @@ exports.redraw = function(gd) {
637
637
gd . emit ( 'plotly_redraw' ) ;
638
638
return gd ;
639
639
} ) ;
640
- } ;
640
+ }
641
641
642
642
/**
643
643
* Convenience function to make idempotent plot option obvious to users.
@@ -647,15 +647,15 @@ exports.redraw = function(gd) {
647
647
* @param {Object } layout
648
648
* @param {Object } config
649
649
*/
650
- exports . newPlot = function ( gd , data , layout , config ) {
650
+ function newPlot ( gd , data , layout , config ) {
651
651
gd = Lib . getGraphDiv ( gd ) ;
652
652
653
653
// remove gl contexts
654
654
Plots . cleanPlot ( [ ] , { } , gd . _fullData || [ ] , gd . _fullLayout || { } ) ;
655
655
656
656
Plots . purge ( gd ) ;
657
657
return exports . plot ( gd , data , layout , config ) ;
658
- } ;
658
+ }
659
659
660
660
/**
661
661
* Wrap negative indicies to their positive counterparts.
@@ -975,7 +975,7 @@ function concatTypedArray(arr0, arr1) {
975
975
* @param {Number|Object } [maxPoints] Number of points for trace window after lengthening.
976
976
*
977
977
*/
978
- exports . extendTraces = function extendTraces ( gd , update , indices , maxPoints ) {
978
+ function extendTraces ( gd , update , indices , maxPoints ) {
979
979
gd = Lib . getGraphDiv ( gd ) ;
980
980
981
981
function updateArray ( target , insert , maxp ) {
@@ -1031,9 +1031,9 @@ exports.extendTraces = function extendTraces(gd, update, indices, maxPoints) {
1031
1031
Queue . add ( gd , exports . prependTraces , undoArgs , extendTraces , arguments ) ;
1032
1032
1033
1033
return promise ;
1034
- } ;
1034
+ }
1035
1035
1036
- exports . prependTraces = function prependTraces ( gd , update , indices , maxPoints ) {
1036
+ function prependTraces ( gd , update , indices , maxPoints ) {
1037
1037
gd = Lib . getGraphDiv ( gd ) ;
1038
1038
1039
1039
function updateArray ( target , insert , maxp ) {
@@ -1088,7 +1088,7 @@ exports.prependTraces = function prependTraces(gd, update, indices, maxPoints) {
1088
1088
Queue . add ( gd , exports . extendTraces , undoArgs , prependTraces , arguments ) ;
1089
1089
1090
1090
return promise ;
1091
- } ;
1091
+ }
1092
1092
1093
1093
/**
1094
1094
* Add data traces to an existing graph div.
@@ -1099,7 +1099,7 @@ exports.prependTraces = function prependTraces(gd, update, indices, maxPoints) {
1099
1099
* @param {Number[]|Number } [newIndices=[gd.data.length]] Locations to add traces
1100
1100
*
1101
1101
*/
1102
- exports . addTraces = function addTraces ( gd , traces , newIndices ) {
1102
+ function addTraces ( gd , traces , newIndices ) {
1103
1103
gd = Lib . getGraphDiv ( gd ) ;
1104
1104
1105
1105
var currentIndices = [ ] ;
@@ -1164,7 +1164,7 @@ exports.addTraces = function addTraces(gd, traces, newIndices) {
1164
1164
promise = exports . moveTraces ( gd , currentIndices , newIndices ) ;
1165
1165
Queue . stopSequence ( gd ) ;
1166
1166
return promise ;
1167
- } ;
1167
+ }
1168
1168
1169
1169
/**
1170
1170
* Delete traces at `indices` from gd.data array.
@@ -1173,7 +1173,7 @@ exports.addTraces = function addTraces(gd, traces, newIndices) {
1173
1173
* @param {Object[] } gd.data The array of traces we're removing from
1174
1174
* @param {Number|Number[] } indices The indices
1175
1175
*/
1176
- exports . deleteTraces = function deleteTraces ( gd , indices ) {
1176
+ function deleteTraces ( gd , indices ) {
1177
1177
gd = Lib . getGraphDiv ( gd ) ;
1178
1178
1179
1179
var traces = [ ] ;
@@ -1206,7 +1206,7 @@ exports.deleteTraces = function deleteTraces(gd, indices) {
1206
1206
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1207
1207
1208
1208
return promise ;
1209
- } ;
1209
+ }
1210
1210
1211
1211
/**
1212
1212
* Move traces at currentIndices array to locations in newIndices array.
@@ -1239,7 +1239,7 @@ exports.deleteTraces = function deleteTraces(gd, indices) {
1239
1239
* // reorder all traces (assume there are 5--a, b, c, d, e)
1240
1240
* Plotly.moveTraces(gd, [b, d, e, a, c]) // same as 'move to end'
1241
1241
*/
1242
- exports . moveTraces = function moveTraces ( gd , currentIndices , newIndices ) {
1242
+ function moveTraces ( gd , currentIndices , newIndices ) {
1243
1243
gd = Lib . getGraphDiv ( gd ) ;
1244
1244
1245
1245
var newData = [ ] ;
@@ -1303,7 +1303,7 @@ exports.moveTraces = function moveTraces(gd, currentIndices, newIndices) {
1303
1303
Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
1304
1304
1305
1305
return promise ;
1306
- } ;
1306
+ }
1307
1307
1308
1308
/**
1309
1309
* restyle: update trace attributes of an existing plot
@@ -1405,7 +1405,6 @@ function restyle(gd, astr, val, _traces) {
1405
1405
return gd ;
1406
1406
} ) ;
1407
1407
}
1408
- exports . restyle = restyle ;
1409
1408
1410
1409
// for undo: undefined initial vals must be turned into nulls
1411
1410
// so that we unset rather than ignore them
@@ -1466,12 +1465,12 @@ function storeCurrent(attr, val, newVal, preGUI) {
1466
1465
* `layout._preGUI` or `layout._tracePreGUI[uid]`
1467
1466
* @param {object } edits: the {attr: val} object as normally passed to `relayout` etc
1468
1467
*/
1469
- exports . _storeDirectGUIEdit = function ( container , preGUI , edits ) {
1468
+ function _storeDirectGUIEdit ( container , preGUI , edits ) {
1470
1469
for ( var attr in edits ) {
1471
1470
var np = nestedProperty ( container , attr ) ;
1472
1471
storeCurrent ( attr , np . get ( ) , edits [ attr ] , preGUI ) ;
1473
1472
}
1474
- } ;
1473
+ }
1475
1474
1476
1475
function _restyle ( gd , aobj , traces ) {
1477
1476
var fullLayout = gd . _fullLayout ;
@@ -1903,7 +1902,6 @@ function relayout(gd, astr, val) {
1903
1902
return gd ;
1904
1903
} ) ;
1905
1904
}
1906
- exports . relayout = relayout ;
1907
1905
1908
1906
// Optimization mostly for large splom traces where
1909
1907
// Plots.supplyDefaults can take > 100ms
@@ -2425,7 +2423,6 @@ function update(gd, traceUpdate, layoutUpdate, _traces) {
2425
2423
return gd ;
2426
2424
} ) ;
2427
2425
}
2428
- exports . update = update ;
2429
2426
2430
2427
/*
2431
2428
* internal-use-only restyle/relayout/update variants that record the initial
@@ -2440,9 +2437,6 @@ function guiEdit(func) {
2440
2437
return p ;
2441
2438
} ;
2442
2439
}
2443
- exports . _guiRestyle = guiEdit ( restyle ) ;
2444
- exports . _guiRelayout = guiEdit ( relayout ) ;
2445
- exports . _guiUpdate = guiEdit ( update ) ;
2446
2440
2447
2441
// For connecting edited layout attributes to uirevision attrs
2448
2442
// If no `attr` we use `match[1] + '.uirevision'`
@@ -2676,7 +2670,7 @@ function applyUIRevisions(data, layout, oldFullData, oldFullLayout) {
2676
2670
* object containing `data`, `layout`, `config`, and `frames` members
2677
2671
*
2678
2672
*/
2679
- exports . react = function ( gd , data , layout , config ) {
2673
+ function react ( gd , data , layout , config ) {
2680
2674
var frames , plotDone ;
2681
2675
2682
2676
function addFrames ( ) { return exports . addFrames ( gd , frames ) ; }
@@ -2816,7 +2810,7 @@ exports.react = function(gd, data, layout, config) {
2816
2810
2817
2811
return gd ;
2818
2812
} ) ;
2819
- } ;
2813
+ }
2820
2814
2821
2815
function diffData ( gd , oldFullData , newFullData , immutable , transition , newDataRevision ) {
2822
2816
var sameTraceLength = oldFullData . length === newFullData . length ;
@@ -3135,7 +3129,7 @@ function diffConfig(oldConfig, newConfig) {
3135
3129
* @param {object } animationOpts
3136
3130
* configuration for the animation
3137
3131
*/
3138
- exports . animate = function ( gd , frameOrGroupNameOrFrameList , animationOpts ) {
3132
+ function animate ( gd , frameOrGroupNameOrFrameList , animationOpts ) {
3139
3133
gd = Lib . getGraphDiv ( gd ) ;
3140
3134
3141
3135
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -3477,7 +3471,7 @@ exports.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
3477
3471
resolve ( ) ;
3478
3472
}
3479
3473
} ) ;
3480
- } ;
3474
+ }
3481
3475
3482
3476
/**
3483
3477
* Register new frames
@@ -3498,7 +3492,7 @@ exports.animate = function(gd, frameOrGroupNameOrFrameList, animationOpts) {
3498
3492
* provided, an index will be provided in serial order. If already used, the frame
3499
3493
* will be overwritten.
3500
3494
*/
3501
- exports . addFrames = function ( gd , frameList , indices ) {
3495
+ function addFrames ( gd , frameList , indices ) {
3502
3496
gd = Lib . getGraphDiv ( gd ) ;
3503
3497
3504
3498
if ( frameList === null || frameList === undefined ) {
@@ -3615,7 +3609,7 @@ exports.addFrames = function(gd, frameList, indices) {
3615
3609
if ( Queue ) Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
3616
3610
3617
3611
return Plots . modifyFrames ( gd , ops ) ;
3618
- } ;
3612
+ }
3619
3613
3620
3614
/**
3621
3615
* Delete frame
@@ -3626,7 +3620,7 @@ exports.addFrames = function(gd, frameList, indices) {
3626
3620
* @param {array of integers } frameList
3627
3621
* list of integer indices of frames to be deleted
3628
3622
*/
3629
- exports . deleteFrames = function ( gd , frameList ) {
3623
+ function deleteFrames ( gd , frameList ) {
3630
3624
gd = Lib . getGraphDiv ( gd ) ;
3631
3625
3632
3626
if ( ! Lib . isPlotDiv ( gd ) ) {
@@ -3662,15 +3656,15 @@ exports.deleteFrames = function(gd, frameList) {
3662
3656
if ( Queue ) Queue . add ( gd , undoFunc , undoArgs , redoFunc , redoArgs ) ;
3663
3657
3664
3658
return Plots . modifyFrames ( gd , ops ) ;
3665
- } ;
3659
+ }
3666
3660
3667
3661
/**
3668
3662
* Purge a graph container div back to its initial pre-Plotly.plot state
3669
3663
*
3670
3664
* @param {string id or DOM element } gd
3671
3665
* the id or DOM element of the graph container div
3672
3666
*/
3673
- exports . purge = function purge ( gd ) {
3667
+ function purge ( gd ) {
3674
3668
gd = Lib . getGraphDiv ( gd ) ;
3675
3669
3676
3670
var fullLayout = gd . _fullLayout || { } ;
@@ -3692,7 +3686,7 @@ exports.purge = function purge(gd) {
3692
3686
delete gd . _context ;
3693
3687
3694
3688
return gd ;
3695
- } ;
3689
+ }
3696
3690
3697
3691
// -------------------------------------------------------
3698
3692
// makePlotFramework: Create the plot container and axes
@@ -3829,3 +3823,32 @@ function makePlotFramework(gd) {
3829
3823
3830
3824
gd . emit ( 'plotly_framework' ) ;
3831
3825
}
3826
+
3827
+ exports . animate = animate ;
3828
+ exports . addFrames = addFrames ;
3829
+ exports . deleteFrames = deleteFrames ;
3830
+
3831
+ exports . addTraces = addTraces ;
3832
+ exports . deleteTraces = deleteTraces ;
3833
+ exports . extendTraces = extendTraces ;
3834
+ exports . moveTraces = moveTraces ;
3835
+ exports . prependTraces = prependTraces ;
3836
+
3837
+ exports . newPlot = newPlot ;
3838
+ exports . plot = plot ;
3839
+ exports . purge = purge ;
3840
+
3841
+ exports . react = react ;
3842
+ exports . redraw = redraw ;
3843
+ exports . relayout = relayout ;
3844
+ exports . restyle = restyle ;
3845
+
3846
+ exports . setPlotConfig = setPlotConfig ;
3847
+
3848
+ exports . update = update ;
3849
+
3850
+ exports . _guiRelayout = guiEdit ( relayout ) ;
3851
+ exports . _guiRestyle = guiEdit ( restyle ) ;
3852
+ exports . _guiUpdate = guiEdit ( update ) ;
3853
+
3854
+ exports . _storeDirectGUIEdit = _storeDirectGUIEdit ;
0 commit comments