first try on wrapper classes (Object, Container (Column, Row)) that simplify the append/remove logic
This commit is contained in:
@@ -3,8 +3,10 @@ import numpy as np
|
||||
from bokeh.plotting import figure
|
||||
from bokeh.models import ColumnDataSource
|
||||
|
||||
from buki import Object
|
||||
|
||||
class Plot2D:
|
||||
|
||||
class Plot2D(Object):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
data = {
|
||||
@@ -13,8 +15,9 @@ class Plot2D:
|
||||
|
||||
self.source = source = ColumnDataSource(data=data)
|
||||
|
||||
self.fig = fig = figure()
|
||||
fig = figure()
|
||||
fig.image(source=source, x=0, y=0, dw=1, dh=1, palette="Spectral11")
|
||||
super().__init__(fig)
|
||||
|
||||
|
||||
def set(self, image):
|
||||
|
||||
Reference in New Issue
Block a user