File size: 788 Bytes
9357e05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr

from bivariate import Bivariate
from univariate import Univariate

class Optimisation:
    def __init__(self, width=1200, height=900):
        self.width = width
        self.height = height
        self.univariate = Univariate(width, height)
        self.bivariate = Bivariate(width, height)

    def on_load(self):
        self.univariate.reset()
        self.bivariate.reset()

    def launch(self):
        with gr.Blocks() as demo:
            gr.HTML("<div style='text-align:left; font-size:40px; font-weight: bold;'>Optimisation trajectory visualizer</div>")
            self.univariate.build()
            self.bivariate.build()
            demo.load(self.on_load)

        demo.launch()

visualizer = Optimisation(width=1200, height=900)
visualizer.launch()