Commits

Ralph Bean committed def0745

Better parameterization of StreamGraph

  • Participants
  • Parent commits bbc120b

Comments (0)

Files changed (2)

 
 setup(
     name='tw2.protovis.custom',
-    version='0.1.a3',
+    version='0.1.a4',
     description='toscawidgets2 wrapper for the stanford protovis toolkit',
     long_description=long_description,
     author='Ralph Bean',

tw2/protovis/custom/widgets.py

     def prepare(self):
         self.init_js = js(
             """
-            var n = 20, m = 400;
+            var n = %i, m = %i;
             var data = %s,
                 w = %i,
                 h = %i,
                 x = pv.Scale.linear(0, m - 1).range(0, w),
                 y = pv.Scale.linear(0, 2 * n).range(0, h);
-            """ % (self.p_data, self.p_width, self.p_height))
+            """ % (len(self.p_data), len(self.p_data[0]),
+                   self.p_data, self.p_width, self.p_height))
         
         self.setupRootPanel()