* Create a new widget for rendering Plotly.
(options: IRenderMime.IRendererOptions)
| 34 | * Create a new widget for rendering Plotly. |
| 35 | */ |
| 36 | constructor(options: IRenderMime.IRendererOptions) { |
| 37 | super(); |
| 38 | this.addClass(CSS_CLASS); |
| 39 | this._mimeType = options.mimeType; |
| 40 | |
| 41 | // Create image element |
| 42 | this._img_el = <HTMLImageElement>document.createElement("img"); |
| 43 | this._img_el.className = "plot-img"; |
| 44 | this.node.appendChild(this._img_el); |
| 45 | |
| 46 | // Install image hover callback |
| 47 | this._img_el.addEventListener("mouseenter", (event) => { |
| 48 | this.createGraph(this._model); |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Render Plotly into this widget's node. |
nothing calls this directly
no test coverage detected