def make_interactive_plot(self, b): controller = self.controller if str(b.ylabel.value) == 'None': return button = Button(description='Stop interactive plot') button.on_click(self.remove_plot) button.name = 'Interactive Plot (' + str(np.random.randint(0, 1000)) + ')' image_widget = Image() popup_widget = Popup(children=[image_widget]) image_widget.width='100%' rangex, rangey = self.axes_ranges(b) interactive_plot = controller.ds.draw_2D_slice_notebook(controller.pvals, str(b.xlabel.value), str(b.ylabel.value), rangex, rangey, {i:[1e-5, 1e5] for i in controller.pvals}, intersections=[1], image_container=image_widget) wi = VBox(description=button.name, children=[interactive_plot, button, popup_widget]) controller.options.update({'xaxis':str(b.xlabel.value), 'yaxis':str(b.ylabel.value), 'x_range':rangex, 'y_range':rangey}) controller.update_child(button.name, wi)
def edit_equations_widget(self, editing=False): kinetic_orders = self.options['kinetic_orders'] if kinetic_orders is None: kinetic_orders = [] name = Text(description='* Name', value=self.name) version = Text(description='Version', value=self.version) self.version_field = version equations=Textarea(description='* Equations', value='\n'.join(self.equations)) aux=Textarea(description='Auxiliary Variables', value=', '.join(self.auxiliary)) html = HTML(value='<b>Architectural Constraints</b>') constraints=Textarea(description='Parameters', value=', '.join(self.constraints) ) options_html = HTML(value='<b>Additional Options</b>') cyclical = Checkbox(description='Check for Cycles', value = self.cyclical) codominance = Checkbox(description='Check for Co-dominance', value = self.codominance) recast = Checkbox(description='Recast Equations', value = self.recast) replacements=Textarea(description='Kinetic Orders', value=', '.join( [i for i in kinetic_orders])) wi = VBox(children=[equations, aux, html, constraints, replacements, options_html, cyclical, codominance,recast, ]) button = Button(value=False, description='Create Design Space') button.on_click(self.make_design_space) button.equations = equations button.aux = aux button.constraints = constraints button.cyclical = cyclical button.codominance = codominance button.recast = recast button.replacements = replacements button.wi = wi button.name = name ## button.version = version load = Button(value=False, description='Load Data') load.on_click(self.load_widget) load.equations = equations ## load.version = version load.aux = aux load.constraints = constraints load.cyclical = cyclical load.codominance = codominance load.replacements = replacements load.wi = wi load.name = name load.button = button button.load = load edit_symbols = Button(value=False, description='Edit Symbols') edit_symbols.on_click(self.create_edit_symbols) edit_parameters = Button(value=False, description='Edit Parameters') edit_parameters.on_click(self.create_edit_parameters) button.edit_symbols = edit_symbols button.edit_parameters = edit_parameters edit_equations = VBox(description='Edit Equations', children=[name, version, wi, edit_symbols, edit_parameters, button, load]) wi.visible = False edit_symbols.visible = False edit_parameters.visible = False if self.ds is not None: wi.visible = True ## self.update_widgets() self.make_options_menu(button) if editing is True: self.make_design_space(button) return edit_equations