Skip to content
Commits on Apr 28, 2010
  1. Fixes for latest integrate from vads-protovis.

    This is mostly some minor formatting changes, though it includes a few fixes for
    spline interpolation, and for the geo tests.
Commits on Apr 27, 2010
  1. More flexible make rules.

    The Makefile can now easily be extended to build a smaller version of Protovis
    containing only the desired files (e.g., without layouts, physics or geo).
  2. Update TODO.

Commits on Apr 16, 2010
  1. Fix point behavior for marks with width and height.

    The point behavior now uses the mark centroid, rather than the top-left point,
    to compute distance from the cursor. This functionality is not yet implemented
    for wedges, but pointing can be used with wedges in conjunction with an anchor
    serving as the centroid, as shown in the included test.
    In the future, it would be better for the point behavior to compute the true
    distance from the mouse to the closest point on the perimeter of the mark,
    taking into consideration the true shape of the mark. But the current approach
    is simple, fast and sufficient for now.
Commits on Apr 14, 2010
  1. Update TODO.

Commits on Apr 11, 2010
  1. Pan & zoom behaviors now support bounding.

    If bounding is enabled, it is not possible to zoom or pan outside of the initial
    panel bounds.
Commits on Apr 6, 2010
  1. Update TODO.

Commits on Apr 5, 2010
  1. Add quantile scale.

    Quantile scales are similar to quantitative scales, except the data is first
    mapped to a normalized quantile range in [0,1] before the final mapping to
    visual range. Thus quantile scales can be used to quantize positions, line
    widths, colors, etc.
Commits on Apr 1, 2010
  1. Force-directed layout improvements.

    The nodes and links associated with a force-directed layout can now be changed.
    The layout will preserve any existing node positions using the `x` and `y`
    attributes. In addition, the layout will only create one timer, even if the
    layout is instantiated in multiple panels.
    Also, "fixed" particles are now implemented using pv.Constraint.position,
    eliminating special support for fixed particles in the simulator. The drag and
    select behaviors now re-render automatically.
Commits on Mar 31, 2010
Commits on Mar 30, 2010
  1. Simplify network layouts using panels.

    This makes network layouts less magical, simplifying the implementation and
    hopefully making them more comprehensible for users. A new "cache" property on
    network layouts specifies whether the layout should be cached. The default is
    true; caching can be temporarily disabled within an event handler to force
    redraw. Rename angle to midAngle to avoid confusion with wedge's angle property.
    Treemap layout now has a separate `leaf` mark which is only displayed on leaf
    nodes, and does not have any fill or stroke. This simplifies the implementation
    of nested (hierarchical) treemaps.
    The rollup layout no longer uses the standard positional properties to layout
    the nodes, since now that the rollup layout is a panel, we can't multiply the
    panel and still render the rolled up nodes and links easily. Instead, the
    psuedo-properties x and y are evaluated, similar to stack layouts.
Commits on Mar 29, 2010
  1. Rewrite select behavior.

    The select behavior is applied to a panel to allow the user to specify the
    selected region by dragging; this is also know an "brushing". In addition, the
    drag behavior can now be used with rectangular regions, expressed by {x, y, dx,
    dy}. The dragged region will be bounded by the parent panel.
Commits on Mar 28, 2010
  1. Update TODO.

  2. Allow anchors across panels.

    Previously, using anchors across panels would fail because Protovis did not know
    which instances of the anchor target to reference. (The code would crash because
    `target.scene is undefined.`) Now we support mirrored descent, which means that
    if the anchor and its target are in different panels, we find the target
    instances using the anchor's parent indexes.
    For example, if you have a stacked area:
      var area = vis.add(pv.Panel)
    You can now easily add labels in an overlay:
    These labels will not be clipped by the areas since they exist in a separate
  3. Update TODO.

Commits on Mar 24, 2010
  1. Add US states geo scale example.

    Note that geo scales currently do not determine their center point from the
    domain. When this feature is added the non-cylindrical projections will be more
  2. Integrate with vads-protovis.

    Mostly this is minor reformatting and cleanup. There are a few API changes.
    This commit includes Vad's implementation of "basis" and "cardinal"
    interpolation for lines. Note that these interpolation methods are not yet
    supported for areas, nor segmented lines, nor segmented areas. Support for these
    is forthcoming.
    The "interpolate" property is once again fixed for non-segmented lines and
    areas. Although there are some contexts in which it may be valid to change the
    interpolate property across lines, that is certainly not true for splines and it
    seems confusing to support it intermittently; better to just make it fixed. The
    area-zero test is updated accordingly.
    For convenience, geo scales now export `x` and `y` scale methods, which can be
    assigned to the `left` and `top` properties. Geo scales now also have two ticks
    methods: `` and `ticks.lng`. The `projection` method now behaves
    correctly when passed a single string argument (e.g., "mercator"). The `range`
    method can now accept two number arguments, which specify the maximum values of
    the range while the minimum values are implicitly zero.
    Note: geo domains are different than those of quantitative scales because the
    projection is two-dimensional and non-affine. This means that a geo domain
    cannot be represented as either a one-dimensional (span) or two-dimensional
    (rect) range. Instead the domain is a set of points that when projected define a
    domain in normalized ([-1,1]) space. Thus, the default domain is now the empty
    array, which resets the normalized domain to [1,-1] in both dimensions. This
    means that the user need not specify a default domain to project the entire
    In addition, the arguments to the pv.Geo.scale constructor are interpreted as
    the projection, rather than the domain. Vad initially implemented it this way,
    and I thought it would be more consistent with other scales if the arguments
    were the domain. However, now that I understand how different the domain is for
    geo scales, it seems more sensible (and convenient!) to have the arguments
    forwarded to the projection method.
    The pv.Geo.projection interface has been changed slightly; the new methods are
    `project` and `invert`. The names are intended to match pv.Scale (which also has
    an `invert` method). The geo-related code now properly uses the `lng` attribute,
    rather than `lon`, to match the pv.Geo.LatLng interface. The mercator projection
    is undefined when Math.abs(lat) > 85; we now clamp the projected values to -1
    and 1 rather than returning Infinity or -Infinity, which causes the browser's
    SVG renderer to throw a fatal error.
    The pv.Geo.radians and pv.Geo.degrees methods have been moved to pv, living in
    I deleted the, for the time-being. I'll probably add it back
    in the future, but it's not used by any examples and the design still needs to
    be determined.
    I restructured the geo scale examples, breaking them up into smaller examples
    suitable for the tests directory. The countries.js data file now converts itself
    to this representation on load, eliminating extra conversion on render (as well
    as duplicate code).
    I deleted the dorling-us example, but this is only temporary and I plan on
    adding it back once some additional work has been done. Similarly, I eliminated
    all code related to Proj4js; when we have an example of Proj4js integration
    cleaned up and ready to go it can live in examples/proj4js.
Commits on Mar 23, 2010
Commits on Mar 21, 2010
  1. Cluster and partition layout inner and outer radius.

    The innerRadius and outerRadius properties can be specified to customize the
    radial layout for both node-link and space-filling variants of cluster and
    partition layouts. This commit also flips the angle for radial labels on
    internal nodes, for improved legibility and consistency with cartesian
Commits on Mar 20, 2010
Commits on Mar 19, 2010
Commits on Mar 18, 2010
  1. Add root and quantitative scales.

    This commit takes pv.Scale.linear and refactors it slightly into an abstract
    "quantitative" scale, which exposes a transform method so that implementations
    can apply arbitrary mappings from domain to range. This reduces code duplication
    and makes the various scales behave more consistently.
    The new "root" scale applies a Math.sqrt transform. A power can be specified by
    the user to change the transform; 2 is the default. Root scales reuse the same
    ticks and nice behavior as linear scales.
    I suspect that this change also fixes some bugs in log scale's ticks and invert
    methods. I have added several tests to verify the new behavior.
Commits on Mar 17, 2010
  1. Treemap improvements.

    Treemaps now support two modes: "squarify" for squarified treemaps (as before),
    and "slice-and-dice" for the simpler algorithm that alternates between
    horizontal and vertical cuts at different hierarchy levels. In addition,
    treemaps now support three orders: "ascending", "descending", and null (for
    unsorted). The default is "ascending" as before.
    This commit also fixes an occasional bug with rounding.
Commits on Mar 15, 2010
  1. Add pv.Dom.Node.prototype.toggle.

    Toggling a node temporarily hides its child nodes. Toggling again restores the
    child nodes. This provides a simple facility for interactive expanding and
    collapsing of tree layouts (though note that we don't yet support animation).
Commits on Mar 13, 2010
  1. Add rollup layout.

    This implements Martin Wattenberg's PivotGraph technique, described in "Visual
    Exploration of Multivariate Graphs", CHI 2006. I've included a force-directed
    layout of the same trivial dataset for comparison. Still to-do: spline
    interpolation and arrow markers for lines, which would allow rendering of pretty
    directed links.
  2. New "events" property.

    This exposes the SVG pointer-events property, and allows control over which
    marks participate in mouse events. The default value of "painted" corresponds to
    the SVG value of the same name. Note, however, that labels default to "none".
Commits on Mar 12, 2010
  1. Partition layout now uses properties.

    Hierarchy layout links now default to "#ccc" rather than translucent black.
    Fix a bug in the implicit links for hierarchy layout: define linkValue to 1
    rather than linkDegree. The space-filling logic from cluster layout has been
    moved to hierarchy layout for reuse with partition layout.
  2. Treemap layout now uses properties.

    The inset property has been replaced by the standard top, right, bottom and left
    properties; see the earlier commit that adds a convenience margin function to
    mark. This commit also changes Treemap to use the standard pv.dom node
    I also removed the magic to hide internal nodes if an inset (margin) is used;
    it's probably better if users get in the habit of defining a visible function
    to show only leaf nodes instead, e.g., visible(function(d) !d.firstChild).
Commits on Mar 11, 2010
  1. Fix bug in transformed mouse location.

    Matrix multiplication is not generally commutative, so we have to multiply the
    transforms from the top down rather than the bottom up.
Commits on Mar 10, 2010
  1. Add new panel-transform test.

  2. Fix for undirected arc diagrams.

    A recent commit removed population of the `index` attribute on nodes, which is
    needed by arc layout to determine whether to reverse link direction to render
    undirected links.
Commits on Mar 9, 2010
  1. Force layout now extends network layout.

    The `left` and `top` attributes on the nodes used by network layout have been
    renamed `x` and `y`, respectively, so as to match the Particle interface used by
    the physics simulation.
  2. Inject stack layout with awesomeness.

    The `offset` property now takes a string rather than a function, and implements
    two standard algorithms: silohouette and wiggle. The first, also known as
    ThemeRiver, centers the stacks around the middle of the panel. The second,
    described in Byron & Wattenberg's "Stacked Graphs -- Geometry & Aesthetics"
    paper, minimizes the weighted change in slope (the "wiggle"). The default offset
    is "zero".
    A new `order` property adopts a further recommendation by Byron & Wattenberg; by
    specifying the value "inside-out", the layout will first order the series by the
    occurrence of their maximum value, and then interleave the series to provide
    equal weighting on the top and bottom. The "inside-out" order is highly
    recommended in conjunction with the "wiggle" offset, as without it the wiggle
    algorithm can drift.
Commits on Mar 3, 2010
  1. Add pv.Layout.horizon.

    This is a simple layout for making horizon graphs. It can be configured to
    display an arbtirary number of bands, and supports both mirror and offset
Something went wrong with that request. Please try again.