Ralph Bean avatar Ralph Bean committed 6a44392

first stab at pv

Comments (0)

Files changed (1)


 from tw2.core.widgets import WidgetMeta
 from tw2.core.widgets import Widget
-from tw2.jit import jit_base
-from tw2.jit.resources import CompoundJSSource
-from simplejson import JSONEncoder
+from tw2.protovis import __basename__, __version__
 # TODO -- the tw2 devtools give me __name__ as tw2.jit.widgets but the resources are all in tw2.jit/static
 modname = ".".join(__name__.split('.')[:-1])
-modname = "tw2.jit"
+modname = ""
-# TODO -- what's the right way to choose minified or not in tw2?
-jit_yc_js = JSLink(modname=modname, filename="%s/jit-yc.js" % jit_base)
-jit_js = JSLink(modname=modname, filename="%s/jit.js" % jit_base)
-jit_glue_js = JSLink(modname=modname, filename="static/js/tw2.jit.glue.js")
-jit_css = CSSLink(modname=modname, filename="static/css/jit_base.css")
+pv_js = JSLink(modname='tw2.protovis',
+               filename='%s/%s/protovis.js' % (__basename__, __version__))
-# TODO -- redo all of these with mako so we have examples of that and genshi
-class JitWidget(twc.Widget):
-    """ Baseclass for all other tw2.jit.widgets
-    Provides a set of parameters common to widgets in the library.
+class PVMark(twc.Widget):
+    template = "tw2.protovis.templates.pvpanel"
-    Uses tw2.jit.resources.CompoundJSSource for client-side initialization
-    """
-    template = "tw2.jit.templates.jitwidget"
-    resources = [jit_js, jit_glue_js]
+class PVPanel(twc.Widget):
+    template = "tw2.protovis.templates.pvpanel"
+    resources = [pv_js]
     # Internal twc Variables:
     jitClassName = twc.Variable('Name of the Jit class for this widget')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.