def add_canvas(self, proxy_widget, dom_element_ref, width=None, height=None, x=0, y=0, entropy=True, dwidth=30, dheight=40, ylabel=None): from jp_gene_viz import js_context js_context.load_if_not_loaded(["sequence_motifs.js"]) columns = self.json_columns(entropy=entropy) (ncolumns, nrows) = self.frequency_sequence.shape if width is None: width = ncolumns * dwidth if height is None: height = nrows * dheight w = proxy_widget elt = dom_element_ref canvas_tag = '<canvas width="%s" height="%s"/>' % ( int(width + x * 2), int(height + y * 2)) options = { "x": x, "y": y, } if ylabel is not None: options["ylabel"] = ylabel else: if not entropy: options["ylabel"] = "probability" else: options["ylabel"] = "bits" options["yMaximumDefault"] = 2.0 jQuery = w.window().jQuery new_canvas = jQuery(canvas_tag) w(elt.append(new_canvas.sequence_motif(width, height, columns, options))) w.flush() return w
def initialize(loaded=[False]): if not loaded[0]: print "loading javascript" js_context.load_if_not_loaded(["three.js"]) js_context.load_if_not_loaded(["three_curve.js"]) js_proxy.load_javascript_support() loaded[0] = True
def __init__(self, *pargs, **kwargs): super(ScatterPlot3D, self).__init__(*pargs, **kwargs) js_context.load_if_not_loaded(["three_scatter.js"]) js_context.load_if_not_loaded(["three_rotator.js"]) js_context.load_if_not_loaded(["TextGeometry.js"]) js_context.load_if_not_loaded(["three_simple_text.js"]) js_proxy.load_javascript_support() self.series_list = []
def __init__(self, message="Choose file", root=".", files=True, folders=False, upload=False, dialog=True, width=500, *args, **kwargs): """ FileChooser constructor. Parameters ---------- message : str Message near the top of the widget as a prompt. root : str The root path for the top folder to display. files : bool Make non-folders selectable iff true. folders : bool Show folders iff true. upload : bool Enable file upload iff true. dialog : bool Show in a jQueryUI dialog iff true, else inline. width : int Width of widget in pixels. """ super(FileChooser, self).__init__(*args, **kwargs) js_context.load_if_not_loaded(["simple_upload_button.js"]) js_context.load_if_not_loaded(["server_file_chooser.js"]) self.root = root self.upload = upload self.files = files self.folders = folders self.dialog = dialog self.message = message self.width = width self.widget = js_proxy.ProxyWidget() self.layout([self.root])
def add_canvas(self, proxy_widget, dom_element_ref, width=None, height=None, x=0, y=0, entropy=True, dwidth=30, dheight=40, ylabel=None): from jp_gene_viz import js_context js_context.load_if_not_loaded(["sequence_motifs.js"]) columns = self.json_columns(entropy=entropy) (ncolumns, nrows) = self.frequency_sequence.shape if width is None: width = ncolumns * dwidth if height is None: height = nrows * dheight w = proxy_widget elt = dom_element_ref canvas_tag = '<canvas width="%s" height="%s"/>' % (int(width + x * 2), int(height + y * 2)) options = { "x": x, "y": y, } if ylabel is not None: options["ylabel"] = ylabel else: if not entropy: options["ylabel"] = "probability" else: options["ylabel"] = "bits" options["yMaximumDefault"] = 2.0 jQuery = w.window().jQuery new_canvas = jQuery(canvas_tag) w( elt.append( new_canvas.sequence_motif(width, height, columns, options))) w.flush() return w
def initialize(): print "loading javascript" js_proxy.load_javascript_support() js_context.load_if_not_loaded(["three.js"]) js_context.load_if_not_loaded(["FontUtils.js"]) #time.sleep(0.1) #display(HTML(load_font)) js_context.load_if_not_loaded(["helvetiker_regular.typeface.js"])
def load_javascript_support(verbose=False): js_context.load_if_not_loaded(["js_proxy.js"])
def load_javascript_support(verbose=False): """ Install javascript support required for this module into the notebook. """ js_context.load_if_not_loaded(["cytoscape.js", "jp_cytoscape.js"], verbose=verbose)
def init(): for (library, dependency) in JS_LIBRARIES: js_context.load_if_not_loaded([library], local=False) js_proxy.load_javascript_support()
def initialize(): js_context.load_if_not_loaded(["cytoscape.js"]) js_proxy.load_javascript_support() color_widget.load_javascript_support()