vega / vega

A visualization grammar.

Home Page:https://vega.github.io/vega

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tree Transform Features

PBI-David opened this issue · comments

I've recently built the following tree diagram which allows a user to expand and collapse nodes as well as zoom and pan. Unfortunately, there is a lot of code required as I had to work around not being able to access a child node's children. I'd like to file the following feature request which I think will be useful to anyone using the tree transform.

  1. In the transform, a dataset is created with ["x", "y", "depth", "children"]. Can we add a column with an object or array which specifies all the children in the hierarchy or create a function which can be accessed via an expression? This is needed because when you collapse a node, you can't just collapse the immediate child or you will leave orphans of that child still rendered on screen.
  2. Sort doesn't support data objects. For example, there is no way to sort the following alphabetically by name: https://vega.github.io/vega/examples/tree-layout/

I could probably list quite a few other feature requests which would reduce the code required but the first one would probably halve the size of the spec.

image

Editor

As as aside, I think there may be a bug in the SVG renderer. When you zoom in using the SVG renderer, the KPI bars disappear from the bottom of each node. This doesn't happen with the Canvas renderer. Weirdly, zooming out is not affected.