tw2.protovis.hierarchies

A bunch of cool widgets from protovis (under the 'custom' heading in their examples page).

Get this source from http://github.com/ralphbean/tw2.protovis.custom

Protovis itself can be found here: http://vis.stanford.edu/protovis/

NodeLinkTree
  • pvcls
    • None
  • p_width
    • The width of the panel, in pixel.
  • p_height
    • The height of the panel, in pixels.
  • p_bottom
    • The bottom margin, in pixels.
  • p_top
    • The top margin, in pixels.
  • p_left
    • The left margin, in pixels.
  • p_right
    • The right margin, in pixels.
  • init_js
    • JSSymbol
  • p_orient
    • orientation parameter
  • p_breadth
    • None
  • p_depth
    • None
class DemoNodeLinkTree(NodeLinkTree):
    p_height = 500
    p_width = 500
    p_orient = 'radial'
    p_breadth = 29
    p_depth = 100
    def prepare(self):
        self.p_data = build_tree() # of tw2.core
        super(DemoNodeLinkTree, self).prepare()
<%namespace name="tw" module="tw2.core.mako_util"/>
<div ${tw.attrs(attrs=w.attrs)}>
<script type="text/javascript+protovis">
${w.init_js.src}
var vis = new pv.Panel()
% for f in w._pv_prop_funcs:
	${f.src}
% endfor
% for a in w._adds:
${a.display()}
% endfor
vis.render();
</script>
</div>

CirclePackingWidget
  • pvcls
    • None
  • p_width
    • The width of the panel, in pixel.
  • p_height
    • The height of the panel, in pixels.
  • p_bottom
    • The bottom margin, in pixels.
  • p_top
    • The top margin, in pixels.
  • p_left
    • The left margin, in pixels.
  • p_right
    • The right margin, in pixels.
  • init_js
    • JSSymbol
  • root_title
    • Root title
class DemoCirclePackingWidget(CirclePackingWidget):
    p_height = 500
    p_width = 500
    root_title = "filesizes in tw2.core"
    p_data = build_tree() # Builds a tree of the filesizes of tw2.core
<%namespace name="tw" module="tw2.core.mako_util"/>
<div ${tw.attrs(attrs=w.attrs)}>
<script type="text/javascript+protovis">
${w.init_js.src}
var vis = new pv.Panel()
% for f in w._pv_prop_funcs:
	${f.src}
% endfor
% for a in w._adds:
${a.display()}
% endfor
vis.render();
</script>
</div>