Example #1
0
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
Example #2
0
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
Example #3
0
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"])
Example #4
0
 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 = []
Example #5
0
 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 = []
Example #6
0
 def canvas(self, width=None, height=None, entropy=True):
     """
     Make a jsproxy canvas widget which draws the motif using sequence_motif.js.
     """
     from jp_gene_viz import js_proxy
     js_proxy.load_javascript_support()
     w = js_proxy.ProxyWidget()
     elt = w.element()
     return self.add_canvas(w, elt,
         width=width, height=height, entropy=entropy,
         x=5, y=5)
Example #7
0
def load_javascript_support():
    print "loading highcharts javascript"
    js_proxy.load_javascript_support()
    load_highcharts = """
    <script src="https://code.highcharts.com/highcharts.js"></script>
    """
    display(HTML(load_highcharts))
    load_modules = """
    <script src="https://code.highcharts.com/modules/drilldown.js"></script>
    <script src="https://code.highcharts.com/highcharts-more.js"></script>
    <script src="https://code.highcharts.com/modules/exporting.js"></script>
    """
    display(HTML(load_modules))
Example #8
0
 def canvas(self, width=None, height=None, entropy=True):
     """
     Make a jsproxy canvas widget which draws the motif using sequence_motif.js.
     """
     from jp_gene_viz import js_proxy
     js_proxy.load_javascript_support()
     w = js_proxy.ProxyWidget()
     elt = w.element()
     return self.add_canvas(w,
                            elt,
                            width=width,
                            height=height,
                            entropy=entropy,
                            x=5,
                            y=5)
Example #9
0
def explore_directory(directory):
    from jp_gene_viz import js_proxy
    from IPython.display import display, HTML
    js_proxy.load_javascript_support()
    load_highcharts = """
    <script src="https://code.highcharts.com/highcharts.js"></script>
    """
    display(HTML(load_highcharts))
    widget = js_proxy.ProxyWidget()
    elt = widget.element()
    # create a chart element look up table
    #widget(elt._set("PieCharts", {}))
    # attach a pie chart for directory
    chart = DirectoryPieChart(directory, widget, elt)
    widget.flush()
    display(widget)
    return widget
Example #10
0
def decrypt_widget():
    import time
    import threading
    from jp_gene_viz import js_proxy
    js_proxy.load_javascript_support()
    # wait for the js to compile...
    time.sleep(0.5)
    from IPython.display import display
    d = js_proxy.ProxyWidget()
    elt = d.element()
    #display(d)
    window = d.window()
    jQuery = window.jQuery
    d(elt.width("400px").height("100px"))
    d(
        elt.html(
            """<input type="password" id="pw000"/> <input id="b000" type="button" value="decrypt files"/> """
        ))

    def click_handler(id, args):
        print "click"
        t = threading.Timer(0.1, extract)
        t.start()

    def extract():
        print "extracting password..."
        print d.send(jQuery("#pw000").val(), pw_callback)

    def pw_callback(arg):
        print "... password extracted"
        password = arg[0]
        # print("pw="+repr(password))
        decrypt(password)

    callback = d.callback(click_handler, None)
    d(jQuery("#b000").click(callback))
    d.flush()
    #display(d)
    return d
def decrypt_widget():
    import time
    from jp_gene_viz import js_proxy
    js_proxy.load_javascript_support()
    # wait for the js to compile...
    time.sleep(0.5)
    from IPython.display import display
    d = js_proxy.ProxyWidget()
    elt = d.element()
    #display(d)
    window = d.window()
    jQuery = window.jQuery
    d(elt.width("400px").height("100px"))
    d(elt.html("""<input type="password" id="pw000"/> <input id="b000" type="button" value="decrypt files"/> """))
    def click_handler(id, args):
        password = d.evaluate(jQuery("#pw000").val())
        # print("pw="+repr(password))
        decrypt(password)
    callback = d.callback(click_handler, None)
    d(jQuery("#b000").click(callback))
    d.flush()
    #display(d)
    return d
Example #12
0
 def show(self):
     js_proxy.load_javascript_support()
     #self.widget.flush()
     display(self.widget)
"""
A substitute for jp_svg_canvas.canvas.SVGCanvasWidget
which supports draw and re-draw operations
on an HTML5 canvas representation of SVGCanvasWidget.
It is intended that this substitute can present larger
visualizations with better performance than SVGCanvasWidget can.
"""

from jp_gene_viz import js_proxy
import traitlets
import math
import json

# this loads the proxy widget javascript "view" implementation
js_proxy.load_javascript_support()

# XXXX Very similar to jp_svg_canvas.fake_svg...

ASSIGN = 'A'
CALL = 'C'
PI2 = 6.29
SIDE_DEFAULT = 500.0

class HTML5CanvasProxy(traitlets.HasTraits):

    # Canvas width
    svg_width = traitlets.Float(SIDE_DEFAULT, sync=True)
    
    # Canvas height
    svg_height = traitlets.Float(SIDE_DEFAULT, sync=True)
Example #14
0
def init():
    for (library, dependency) in JS_LIBRARIES:
        js_context.load_if_not_loaded([library], local=False)
    js_proxy.load_javascript_support()
Example #15
0
 def show(self):
     js_proxy.load_javascript_support()
     #self.widget.flush()
     display(self.widget)
Example #16
0
def load_javascript_support(verbose=False):
    canvas.load_javascript_support()
    js_proxy.load_javascript_support()
Example #17
0
"""
A substitute for jp_svg_canvas.canvas.SVGCanvasWidget
which supports draw and re-draw operations
on an HTML5 canvas representation of SVGCanvasWidget.
It is intended that this substitute can present larger
visualizations with better performance than SVGCanvasWidget can.
"""

from jp_gene_viz import js_proxy
import traitlets
import math
import json

# this loads the proxy widget javascript "view" implementation
js_proxy.load_javascript_support()

# XXXX Very similar to jp_svg_canvas.fake_svg...

ASSIGN = 'A'
CALL = 'C'
PI2 = 6.29
SIDE_DEFAULT = 500.0


class HTML5CanvasProxy(traitlets.HasTraits):

    # Canvas width
    svg_width = traitlets.Float(SIDE_DEFAULT, sync=True)

    # Canvas height
    svg_height = traitlets.Float(SIDE_DEFAULT, sync=True)
def initialize():
    js_context.load_if_not_loaded(["cytoscape.js"])
    js_proxy.load_javascript_support()
    color_widget.load_javascript_support()
Example #19
0
def initialize():
    js_context.load_if_not_loaded(["cytoscape.js"])
    js_proxy.load_javascript_support()
    color_widget.load_javascript_support()