From 51eec575423e98a54571baea4b7cf834333c4666 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 4 Oct 2021 09:42:12 +0200 Subject: [PATCH] Remove FigureGL --- bqplot_gl/__init__.py | 1 - bqplot_gl/figure.py | 22 --- examples/lines.ipynb | 31 +--- examples/scatter.ipynb | 4 +- src/LinesGLView.ts | 33 ++-- src/ScatterGLView.ts | 60 +++---- src/figure.ts | 169 ------------------ src/index.ts | 7 +- src/test/widget-utils.ts | 13 +- src/utils.ts | 121 +++++++++++++ ui-tests/tests/notebooks/lines_update.ipynb | 8 +- ui-tests/tests/notebooks/scatter.ipynb | 8 +- ui-tests/tests/notebooks/scatter_update.ipynb | 8 +- 13 files changed, 200 insertions(+), 285 deletions(-) delete mode 100644 bqplot_gl/figure.py delete mode 100644 src/figure.ts create mode 100644 src/utils.ts diff --git a/bqplot_gl/__init__.py b/bqplot_gl/__init__.py index a982643..637a188 100644 --- a/bqplot_gl/__init__.py +++ b/bqplot_gl/__init__.py @@ -4,7 +4,6 @@ # Copyright (c) The bqplot Development Team. # Distributed under the terms of the Modified BSD License. -from .figure import FigureGL # noqa from .marks import * # noqa from ._version import __version__, version_info # noqa diff --git a/bqplot_gl/figure.py b/bqplot_gl/figure.py deleted file mode 100644 index 86dd927..0000000 --- a/bqplot_gl/figure.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -# Copyright (c) The bqplot Development Team. -# Distributed under the terms of the Modified BSD License. - -from traitlets import Unicode - -from bqplot import Figure - -from ._frontend import module_name, module_version - - -class FigureGL(Figure): - """TODO: Add docstring here - """ - _view_name = Unicode('FigureGLView').tag(sync=True) - _model_name = Unicode('FigureGLModel').tag(sync=True) - _view_module = Unicode(module_name).tag(sync=True) - _model_module = Unicode(module_name).tag(sync=True) - _view_module_version = Unicode(module_version).tag(sync=True) - _model_module_version = Unicode(module_version).tag(sync=True) diff --git a/examples/lines.ipynb b/examples/lines.ipynb index a824fd8..7a3a905 100644 --- a/examples/lines.ipynb +++ b/examples/lines.ipynb @@ -2,29 +2,14 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "faf6701a", "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "c4ee4d8bc9a04a279a55494a782a76cd", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "FigureGL(axes=[Axis(label='Index', scale=LinearScale()), Axis(label='lines', orientation='vertical', scale=Lin…" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "from bqplot import *\n", "\n", - "from bqplot_gl import FigureGL, ScatterGL, LinesGL\n", + "from bqplot_gl import ScatterGL, LinesGL\n", "\n", "import numpy as np\n", "import pandas as pd\n", @@ -47,12 +32,12 @@ "ax_x = Axis(scale=sc_x, label='Index')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', label='lines')\n", "\n", - "FigureGL(marks=[lines], axes=[ax_x, ax_y], title='Lines', interaction=panzoom)" + "Figure(marks=[lines], axes=[ax_x, ax_y], title='Lines', interaction=panzoom)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "bd78813d", "metadata": {}, "outputs": [], @@ -62,7 +47,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "52a1f6dc", "metadata": {}, "outputs": [], @@ -91,7 +76,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -105,7 +90,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.5" } }, "nbformat": 4, diff --git a/examples/scatter.ipynb b/examples/scatter.ipynb index 4439fb9..53bb4ae 100644 --- a/examples/scatter.ipynb +++ b/examples/scatter.ipynb @@ -9,7 +9,7 @@ "source": [ "from bqplot import *\n", "\n", - "from bqplot_gl import FigureGL, ScatterGL\n", + "from bqplot_gl import ScatterGL\n", "\n", "import numpy as np\n", "import pandas as pd\n", @@ -44,7 +44,7 @@ "ax_x = Axis(scale=sc_x, label='Date')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', tick_format='0.0f', label='Security 2')\n", "\n", - "fig = FigureGL(marks=[scatt], axes=[ax_x, ax_y])\n", + "fig = Figure(marks=[scatt], axes=[ax_x, ax_y])\n", "fig" ] }, diff --git a/src/LinesGLView.ts b/src/LinesGLView.ts index e231d95..e48a2f5 100644 --- a/src/LinesGLView.ts +++ b/src/LinesGLView.ts @@ -13,16 +13,18 @@ import 'three/examples/js/lines/LineMaterial'; import 'three/examples/js/lines/LineSegmentsGeometry'; import 'three/examples/js/lines/LineGeometry'; -import { ScaleType, FigureGLView } from './figure'; - import { LinesGLModel } from './LinesGLModel'; import { Values } from './values'; +import { ScaleType, initializeBqplotFigure } from './utils'; + export class LinesGLView extends Lines { async render() { await super.render(); + initializeBqplotFigure(this.parent); + // Create material for markers this.material = new THREE.LineMaterial(); this.material.uniforms.domain_x = { type: '2f', value: [0, 1] }; @@ -56,10 +58,8 @@ export class LinesGLView extends Lines { this.listenTo(this.model, 'change:x change:y', this.updateGeometry); this.listenTo(this.model, 'change:stroke_width', this.update_stroke_width); - this.updateScene(); - this.listenTo(this.parent, 'margin_updated', () => { - this.updateScene(); - }); + this.parent.extras.webGLMarks.push(this); + this.parent.extras.webGLRequestRender(); } beforeCompile(shader) { @@ -124,11 +124,11 @@ export class LinesGLView extends Lines { ); this.geometry.setPositions(current.array_vec3['position']); - this.updateScene(); + this.parent.extras.webGLRequestRender(); } update_line_xy(animate: boolean) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } update_style() { @@ -140,12 +140,12 @@ export class LinesGLView extends Lines { } else { this.material.uniforms.opacity.value = 1; } - this.updateScene(); + this.parent.extras.webGLRequestRender(); } update_stroke_width() { this.material.linewidth = this.model.get('stroke_width'); - this.updateScene(); + this.parent.extras.webGLRequestRender(); } updateMaterialScales() { @@ -182,15 +182,8 @@ export class LinesGLView extends Lines { ]; this.updateMaterialScales(); - fig.renderer.render(this.scene, fig.camera); - } - - updateScene() { - this.parent.update_gl(); - } - - relayout() { - this.updateScene(); + const { renderer, camera } = fig.extras.webGLRenderer; + renderer.render(this.scene, camera); } draw(animate) {} @@ -202,6 +195,4 @@ export class LinesGLView extends Lines { scene: THREE.Scene; model: LinesGLModel; - - parent: FigureGLView; } diff --git a/src/ScatterGLView.ts b/src/ScatterGLView.ts index dd86d91..3857bdd 100644 --- a/src/ScatterGLView.ts +++ b/src/ScatterGLView.ts @@ -19,7 +19,7 @@ import * as d3 from 'd3'; import * as _ from 'underscore'; import { ScatterGLModel } from './ScatterGLModel'; import * as THREE from 'three'; -import { ScaleType, FigureGLView } from './figure'; +import { ScaleType, initializeBqplotFigure } from './utils'; type TypedArray = | Int8Array @@ -143,6 +143,8 @@ export class ScatterGLView extends Mark { async render() { const base_render_promise = super.render(); + initializeBqplotFigure(this.parent); + this.transitions = []; this.invalidated_pixel_position = true; @@ -313,10 +315,9 @@ export class ScatterGLView extends Mark { this.create_listeners(); this.compute_view_padding(); - this.updateScene(); - this.listenTo(this.parent, 'margin_updated', () => { - this.updateScene(); - }); + + this.parent.extras.webGLMarks.push(this); + this.parent.extras.webGLRequestRender(); } initializeAttribute(name: string, parameters: AttributeParameters) { @@ -491,10 +492,6 @@ export class ScatterGLView extends Mark { } } - updateScene() { - this.parent.update_gl(); - } - renderGL() { this.set_ranges(); const fig = this.parent; @@ -560,7 +557,8 @@ export class ScatterGLView extends Mark { this.scales.opacity.scale.domain(); } - fig.renderer.render(this.scene, fig.camera); + const { renderer, camera } = fig.extras.webGLRenderer; + renderer.render(this.scene, camera); const transitions_todo = []; for (let i = 0; i < this.transitions.length; i++) { @@ -572,7 +570,7 @@ export class ScatterGLView extends Mark { } this.transitions = transitions_todo; if (this.transitions.length > 0) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -611,7 +609,7 @@ export class ScatterGLView extends Mark { const sync_visible = () => { this.mesh.visible = this.model.get('visible'); - this.updateScene(); + this.parent.extras.webGLRequestRender(); }; this.listenTo(this.model, 'change:visible', sync_visible); sync_visible(); @@ -619,7 +617,7 @@ export class ScatterGLView extends Mark { const sync_fill = () => { this.material.defines['FILL'] = this.model.get('fill') ? 1 : 0; this.material.needsUpdate = true; - this.updateScene(); + this.parent.extras.webGLRequestRender(); }; this.listenTo(this.model, 'change:fill', sync_fill); sync_fill(); @@ -746,7 +744,7 @@ export class ScatterGLView extends Mark { ); if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -768,7 +766,7 @@ export class ScatterGLView extends Mark { ); if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -801,7 +799,7 @@ export class ScatterGLView extends Mark { this.material.needsUpdate = true; if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -815,7 +813,7 @@ export class ScatterGLView extends Mark { ); if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -829,7 +827,7 @@ export class ScatterGLView extends Mark { ); if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -843,7 +841,7 @@ export class ScatterGLView extends Mark { ); if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -858,7 +856,7 @@ export class ScatterGLView extends Mark { selected_parameters.use_selection; if (rerender) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); } } @@ -900,7 +898,7 @@ export class ScatterGLView extends Mark { } this.material.needsUpdate = true; - this.updateScene(); + this.parent.extras.webGLRequestRender(); } updateStroke() { @@ -915,12 +913,12 @@ export class ScatterGLView extends Mark { } this.material.needsUpdate = true; - this.updateScene(); + this.parent.extras.webGLRequestRender(); } updateStrokeWidth() { this.material.uniforms.stroke_width.value = this.model.get('stroke_width'); - this.updateScene(); + this.parent.extras.webGLRequestRender(); } updateColorMap() { @@ -961,11 +959,11 @@ export class ScatterGLView extends Mark { } } - this.updateScene(); + this.parent.extras.webGLRequestRender(); } updatePosition(animate?) { - this.updateScene(); + this.parent.extras.webGLRequestRender(); this.invalidatePixelPosition(); } @@ -1071,17 +1069,17 @@ export class ScatterGLView extends Mark { } if (size_scale) { this.listenTo(size_scale, 'domain_changed', () => { - this.updateScene(); + this.parent.extras.webGLRequestRender(); }); } if (opacity_scale) { this.listenTo(opacity_scale, 'domain_changed', () => { - this.updateScene(); + this.parent.extras.webGLRequestRender(); }); } if (rotation_scale) { this.listenTo(rotation_scale, 'domain_changed', () => { - this.updateScene(); + this.parent.extras.webGLRequestRender(); }); } } @@ -1145,12 +1143,12 @@ export class ScatterGLView extends Mark { this.called_on_done = true; on_done.apply(context); } - that.updateScene(); + that.parent.extras.webGLRequestRender(); }); if (!this.duration) { f.apply(context, [1]); on_done.apply(context); - that.updateScene(); + that.parent.extras.webGLRequestRender(); } else { that.transitions.push(this); } @@ -1288,6 +1286,4 @@ export class ScatterGLView extends Mark { dot: any; model: ScatterGLModel; - - parent: FigureGLView; } diff --git a/src/figure.ts b/src/figure.ts deleted file mode 100644 index 333a8ee..0000000 --- a/src/figure.ts +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) The bqplot Development Team -// Distributed under the terms of the Modified BSD License. - -import * as THREE from 'three'; - -import { Figure, FigureModel, Mark, MarkModel } from 'bqplot'; - -import { MODULE_NAME, MODULE_VERSION } from './version'; - -THREE.ShaderChunk['scales'] = - require('raw-loader!../shaders/scales.glsl').default; - -export enum ScaleType { - SCALE_TYPE_LINEAR = 1, - SCALE_TYPE_LOG = 2, -} - -export class FigureGLModel extends FigureModel { - defaults() { - return { - ...super.defaults(), - _model_name: FigureGLModel.model_name, - _model_module: FigureGLModel.model_module, - _model_module_version: FigureGLModel.model_module_version, - _view_name: FigureGLModel.view_name, - _view_module: FigureGLModel.view_module, - _view_module_version: FigureGLModel.view_module_version, - }; - } - - static model_name = 'FigureGLModel'; - static model_module = MODULE_NAME; - static model_module_version = MODULE_VERSION; - static view_name = 'FigureGLView'; - static view_module = MODULE_NAME; - static view_module_version = MODULE_VERSION; -} - -export class FigureGLView extends Figure { - private createWebGLRenderer() { - // a shared webgl context for all marks - if (!this.renderer) { - this.renderer = new THREE.WebGLRenderer({ - antialias: true, - alpha: true, - premultipliedAlpha: true, - }); - - this.renderer.setSize(100, 100); - this.renderer.setClearAlpha(0); - this.renderer.setPixelRatio( - this.model.get('pixel_ratio') || window.devicePixelRatio - ); - - this.camera = new THREE.OrthographicCamera( - -1 / 2, - 1 / 2, - 1 / 2, - -1 / 2, - -10000, - 10000 - ); - this.camera.position.z = 10; - } - - if (this.renderer && !this.el.contains(this.renderer.domElement)) { - this.el.insertBefore(this.renderer.domElement, this.el.childNodes[1]); - } - this.layout_webgl_canvas(); - } - - async add_mark(model: MarkModel) { - const view = await super.add_mark(model); - - // If the mark needs a WebGL renderer, we create it - if (view['renderGL']) { - this.createWebGLRenderer(); - } - - return view; - } - - update_marks(marks: Mark[]) { - super.update_marks(marks); - - this.update_gl(); - } - - async renderGL(): Promise { - // Nothing to render using a WebGL context - if (!this.renderer) { - return Promise.resolve(); - } - - this.camera.left = 0; - this.camera.right = this.plotarea_width; - this.camera.bottom = 0; - this.camera.top = this.plotarea_height; - this.camera.updateProjectionMatrix(); - - const views = await Promise.all(this.mark_views.views); - - // render all marks that have a renderGL method - this.renderer.autoClear = false; - this.renderer.autoClearColor = new (THREE.Color as (x) => void)(0x000000); - this.renderer.clear(); - - for (const mark of views) { - if (mark['renderGL']) { - mark['renderGL'](); - } - } - } - - relayoutImpl() { - super.relayoutImpl(); - - this.layout_webgl_canvas(); - } - - create_listeners() { - this.listenTo(this.model, 'change:pixel_ratio', () => { - if (this.renderer) { - this.renderer.setPixelRatio( - this.model.get('pixel_ratio') || window.devicePixelRatio - ); - this.update_gl(); - } - }); - } - - async get_svg() { - return this.renderGL().then(() => { - return super.get_svg(); - }); - } - - update_gl() { - if (!this._update_requested) { - this._update_requested = true; - requestAnimationFrame(this._update_gl.bind(this)); - } - } - - _update_gl() { - this.renderGL(); - this._update_requested = false; - } - - layout_webgl_canvas() { - if (this.renderer) { - this.renderer.domElement.style = - 'left: ' + - this.margin.left + - 'px; ' + - 'top: ' + - this.margin.top + - 'px;'; - this.renderer.setSize(this.plotarea_width, this.plotarea_height); - this.update_gl(); - } - } - - private _update_requested: boolean; - - renderer: THREE.WebGLRenderer | null; - - camera: THREE.OrthographicCamera; -} diff --git a/src/index.ts b/src/index.ts index 7558c32..5ea5508 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,13 @@ // Copyright (c) The bqplot Development Team // Distributed under the terms of the Modified BSD License. +import * as THREE from 'three'; + export * from './version'; -export * from './figure'; + +THREE.ShaderChunk['scales'] = + require('raw-loader!../shaders/scales.glsl').default; + export * from './ScatterGLView'; export * from './ScatterGLModel'; export * from './LinesGLView'; diff --git a/src/test/widget-utils.ts b/src/test/widget-utils.ts index 92705ca..ee73056 100644 --- a/src/test/widget-utils.ts +++ b/src/test/widget-utils.ts @@ -5,6 +5,15 @@ async function create_model_bqplot( name: string, id: string, args: Object +) { + return create_model(manager, 'bqplot', `${name}Model`, `${name}`, id, args); +} + +async function create_model_bqplotgl( + manager, + name: string, + id: string, + args: Object ) { return create_model( manager, @@ -105,7 +114,7 @@ export async function create_figure_scatter(manager, x, y, log = false) { const rotation = null; const skew = null; - const scatterModel = await create_model_bqplot( + const scatterModel = await create_model_bqplotgl( manager, 'ScatterGL', 'scatter1', @@ -130,7 +139,7 @@ export async function create_figure_scatter(manager, x, y, log = false) { ); let figureModel; try { - figureModel = await create_model_bqplot(manager, 'FigureGL', 'figure1', { + figureModel = await create_model_bqplot(manager, 'Figure', 'figure1', { scale_x: scales['x'], scale_y: scales['y'], layout: layout.toJSON(), diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..2f7885b --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,121 @@ +import * as THREE from 'three'; +import { Figure } from 'bqplot'; + +export enum ScaleType { + SCALE_TYPE_LINEAR = 1, + SCALE_TYPE_LOG = 2, +} + +export interface Renderer { + renderer: THREE.WebGLRenderer; + camera: THREE.OrthographicCamera; +} + +export function createRenderer( + canvas: HTMLCanvasElement, + context: WebGLRenderingContext, + pixelRatio: number +): Renderer { + const renderer = new THREE.WebGLRenderer({ + canvas, + context, + antialias: true, + alpha: true, + premultipliedAlpha: true, + }); + + renderer.setPixelRatio(pixelRatio); + renderer.setSize(100, 100); + renderer.setClearAlpha(0); + + const camera = new THREE.OrthographicCamera( + -1 / 2, + 1 / 2, + 1 / 2, + -1 / 2, + -10000, + 10000 + ); + camera.position.z = 10; + + return { renderer, camera }; +} + +export function resizeRenderer( + renderer: Renderer, + width: number, + height: number +) { + renderer.camera.left = 0; + renderer.camera.right = width; + renderer.camera.bottom = 0; + renderer.camera.top = height; + renderer.camera.updateProjectionMatrix(); + + renderer.renderer.setSize(width, height); +} + +export function initializeBqplotFigure(figure: Figure) { + if (!figure.extras.webGLRenderer) { + const ext = figure.extras; + + // Create ThreeJS Renderer + ext.webGLRenderer = createRenderer( + figure.webGLCanvas, + figure.webGLContext, + figure.model.get('pixel_ratio') || window.devicePixelRatio + ); + + ext.webGLMarks = []; + + // Actual render function + ext.webGLRender = function () { + const renderer = this.extras.webGLRenderer.renderer; + + this.extras.webGLRenderer.renderer.setPixelRatio( + this.model.get('pixel_ratio') || window.devicePixelRatio + ); + + resizeRenderer( + this.extras.webGLRenderer, + this.plotarea_width, + this.plotarea_height + ); + + // Clear renderer + renderer.autoClear = false; + renderer.autoClearColor = new THREE.Color(0x000000); + renderer.clear(); + + // Render WebGL marks + const marks = this.extras.webGLMarks; + for (const mark of marks) { + mark.renderGL(); + } + }.bind(figure); + + // Render request functions + ext.webGLUpdate = function () { + this.extras.webGLRender(); + this.extras.webGLUpdateRequested = false; + }.bind(figure); + + ext.webGLRequestRender = function () { + if (!this.extras.webGLUpdateRequested) { + this.extras.webGLUpdateRequested = true; + requestAnimationFrame(this.extras.webGLUpdate); + } + }.bind(figure); + + // Render hook: Called when the Figure needs a synchronous render + figure.renderHooks.webGLRender = ext.webGLRender; + + // Relayout hook: Called when there is a figure relayout + figure.relayoutHooks.webGLRelayoutHook = ext.webGLRequestRender; + + // Event handlers + figure.listenTo(figure, 'margin_updated', ext.webGLRequestRender); + + figure.listenTo(figure.model, 'change:pixel_ratio', ext.webGLRequestRender); + } +} diff --git a/ui-tests/tests/notebooks/lines_update.ipynb b/ui-tests/tests/notebooks/lines_update.ipynb index 2dbd4af..402d6ab 100644 --- a/ui-tests/tests/notebooks/lines_update.ipynb +++ b/ui-tests/tests/notebooks/lines_update.ipynb @@ -8,7 +8,7 @@ "outputs": [], "source": [ "from bqplot import *\n", - "from bqplot_gl import FigureGL, LinesGL\n", + "from bqplot_gl import LinesGL\n", "\n", "import numpy as np\n", "import pandas as pd\n", @@ -27,7 +27,7 @@ "ax_x = Axis(scale=sc_x, label='Index')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', label='lines')\n", "\n", - "FigureGL(marks=[lines], axes=[ax_x, ax_y], title='Lines')" + "Figure(marks=[lines], axes=[ax_x, ax_y], title='Lines')" ] }, { @@ -133,7 +133,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -147,7 +147,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.5" } }, "nbformat": 4, diff --git a/ui-tests/tests/notebooks/scatter.ipynb b/ui-tests/tests/notebooks/scatter.ipynb index 3158b0a..72b6761 100644 --- a/ui-tests/tests/notebooks/scatter.ipynb +++ b/ui-tests/tests/notebooks/scatter.ipynb @@ -8,7 +8,7 @@ "outputs": [], "source": [ "from bqplot import *\n", - "from bqplot_gl import FigureGL, ScatterGL\n", + "from bqplot_gl import ScatterGL\n", "\n", "import numpy as np\n", "import pandas as pd" @@ -58,7 +58,7 @@ "ax_x = Axis(scale=sc_x, label='Date')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', tick_format='0.0f', label='Security 2')\n", "\n", - "fig = FigureGL(marks=[scatt], axes=[ax_x, ax_y])\n", + "fig = Figure(marks=[scatt], axes=[ax_x, ax_y])\n", "fig" ] }, @@ -78,7 +78,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -92,7 +92,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.5" } }, "nbformat": 4, diff --git a/ui-tests/tests/notebooks/scatter_update.ipynb b/ui-tests/tests/notebooks/scatter_update.ipynb index 7ea7ac8..390cb90 100644 --- a/ui-tests/tests/notebooks/scatter_update.ipynb +++ b/ui-tests/tests/notebooks/scatter_update.ipynb @@ -8,7 +8,7 @@ "outputs": [], "source": [ "from bqplot import *\n", - "from bqplot_gl import FigureGL, ScatterGL\n", + "from bqplot_gl import ScatterGL\n", "\n", "import numpy as np\n", "import pandas as pd\n", @@ -43,7 +43,7 @@ "ax_x = Axis(scale=sc_x, label='Date')\n", "ax_y = Axis(scale=sc_y, orientation='vertical', tick_format='0.0f', label='Security 2')\n", "\n", - "fig = FigureGL(marks=[scatt], axes=[ax_x, ax_y])\n", + "fig = Figure(marks=[scatt], axes=[ax_x, ax_y])\n", "fig" ] }, @@ -175,7 +175,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -189,7 +189,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.9.5" } }, "nbformat": 4,