javascript - mpld3: How to change the location of the toolbar using a plugin? -


After the

The toolbar for the mpld3 display is usually located in the bottom right corner of the screen. I want to put it in the top right corner of the screen. It appears that the code controlling the position of the toolbar may be located.

I would like to know how to use Javascript toolbar objects so that I can change my position. JavaScript code base will feature some custom mpld3 plugin

Here is a simple mpld3 is a figure to move to the top of the plugin toolbar:

  class TopToolbar (plugins.PluginBase): "" "to the top of the plugin data to the toolbar" "" JavaScript = "" "mpld3.register_plugin (" toptoolbar ", TopToolbar); TopToolbar.prototype = Object.create (mpld3.Plugin.prototype); TopToolbar.prototype.constructor = TopToolbar; function TopToolbar (fig prop) {mpld3 .Plugin.call (this, Njir, props);}; TopToolbar.prototype .draw = function () {/ / toolbar svg still does not exist, so the first change it to drag it. Fig.toolbar.draw (); // then y position / a // figure on top this.fig.toolbar.toolbar.attr ( "y", 2); // then draw function) to remove // ​​so he this.fig.toolbar.draw = function (called You can see it in action in {}} "" "Def __init __ (self): self.dict_ = {" type ":" Toptoolbar "}  

.


Comments