File tree Expand file tree Collapse file tree 2 files changed +21
-27
lines changed
shelly/plotlyjs/static/plotlyjs/src
test-dashboard/toolpanel-dashboard Expand file tree Collapse file tree 2 files changed +21
-27
lines changed Original file line number Diff line number Diff line change @@ -361,32 +361,6 @@ plots.addLinks = function(gd) {
361
361
spacespan . text ( ( toolspan . text ( ) && sourcespan . text ( ) ) ? ' - ' : '' ) ;
362
362
} ;
363
363
364
- /**
365
- * Add or modify a margin requst object by name. Margins in pixels.
366
- *
367
- * This allows us to have multiple modules request space in the plot without
368
- * conflicts. For example:
369
- *
370
- * adjustReservedMargins(gd, 'themeBar', {left: 200})
371
- *
372
- * ... will idempotent-ly set the left margin to 200 for themeBar.
373
- *
374
- * @param gd
375
- * @param {String } marginName
376
- * @param {Object } margins
377
- * @returns {Object }
378
- */
379
- plots . adjustReservedMargins = function ( gd , marginName , margins ) {
380
- var margin ;
381
- gd . _boundingBoxMargins = gd . _boundingBoxMargins || { } ;
382
- gd . _boundingBoxMargins [ marginName ] = { } ;
383
- [ 'left' , 'right' , 'top' , 'bottom' ] . forEach ( function ( key ) {
384
- margin = margins [ key ] || 0 ;
385
- gd . _boundingBoxMargins [ marginName ] [ key ] = margin ;
386
- } ) ;
387
- return gd . _boundingBoxMargins ;
388
- } ;
389
-
390
364
// note that now this function is only adding the brand in
391
365
// iframes and 3rd-party apps
392
366
function positionPlayWithData ( gd , container ) {
Original file line number Diff line number Diff line change @@ -50,18 +50,38 @@ function createPlot (divId) {
50
50
} ;
51
51
52
52
var data = [ trace1 , trace2 ] ;
53
+ var toolPanel ;
53
54
54
55
Plotly . newPlot ( divId , data ) ;
55
56
56
- graphDiv . toolPanel = new ToolPanel ( Plotly , graphDiv , {
57
+ graphDiv . toolPanel = toolPanel = new ToolPanel ( Plotly , graphDiv , {
57
58
standalone : true ,
58
59
popoverContainer : containerDiv
59
60
} ) ;
60
61
62
+ window . toolPanel = graphDiv . toolPanel ;
63
+
61
64
graphDiv . toolPanel . makeMenu ( {
62
65
toolMenuContainer : toolDiv
63
66
} ) ;
64
67
68
+ toolPanel . createMenuMultiButton ( [
69
+ {
70
+ labelContent : 'Undo' ,
71
+ iconClass : 'icon-rotate-left' ,
72
+ handler : toolPanel . undo
73
+ } ,
74
+ {
75
+ labelContent : 'Redo' ,
76
+ iconClass : 'icon-rotate-right' ,
77
+ handler : toolPanel . redo
78
+ }
79
+ ] ) ;
80
+
81
+ toolPanel . createMenuSpacer ( ) ;
82
+
83
+ toolPanel . createMenuButtons ( toolPanel . getPanelButtonSpecs ( ) ) ;
84
+
65
85
divs . push ( graphDiv , toolDiv ) ;
66
86
67
87
}
You can’t perform that action at this time.
0 commit comments