MCPcopy Index your code
hub / github.com/plotly/plotly.py / constructor

Method constructor

js/src/mimeExtension.ts:36–50  ·  view source on GitHub ↗

* Create a new widget for rendering Plotly.

(options: IRenderMime.IRendererOptions)

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

createGraphMethod · 0.95
addClassMethod · 0.45
addEventListenerMethod · 0.45

Tested by

no test coverage detected