Exemple #1
0
def construct():
    from bowtie import Layout
    layout = Layout(debug=True)
    layout.add_controller(sigma)
    layout.add_visual(mainplot)
    layout.schedule(0.1, walk)

    layout.build()
Exemple #2
0
def construct():
    from bowtie import Layout
    layout = Layout(debug=True)
    layout.add_sidebar(sigma)
    layout.add(mainplot)
    layout.schedule(0.1, walk)

    layout.build()
Exemple #3
0
def build():
    layout = Layout(rows=2, columns=2, sidebar=False, debug=False)

    layout.columns[1].pixels(100)
    layout.rows[0].pixels(40)

    layout.add(talk, row_start=0, column_start=0)
    layout.add(click, row_start=0, column_start=1)
    layout.add(chat, row_start=1, column_start=0, row_end=1, column_end=1)

    layout.load(update_chat)

    layout.subscribe(entered, talk.on_enter)
    layout.subscribe(clicked, click.on_click)
    layout.schedule(5, update_chat)

    layout.build()
Exemple #4
0
"""

from bowtie.control import Nouislider
from bowtie.visual import Plotly

import numpy as np
from numpy import random as rng
import plotlywrapper as pw

sigma = Nouislider(caption='Sigma', start=1, minimum=0.1, maximum=50)
mainplot = Plotly()

data = np.zeros(100).tolist()


def walk():
    value = float(sigma.get())
    data.pop(0)
    data.append(value * rng.randn() + data[-1])
    mainplot.do_all(pw.line(data).to_json())


if __name__ == "__main__":
    from bowtie import Layout
    layout = Layout(debug=False)
    layout.add_controller(sigma)
    layout.add_visual(mainplot)
    layout.schedule(0.1, walk)

    layout.build()