[vtk-developers] [GSoC 2014] Supporting a Visualization Grammar
Marco Cecchetti
mrcekets at gmail.com
Fri Mar 28 10:50:33 EDT 2014
Hi all,
after analyzing source code of several classes, such as vtkPlot and
vtkChart, I succeeded in writing down a list of deliverables and a
tentative time-line for tackling the implementation of a framework that
supports a good subset of Vega and enhances charting capabilities in
VTK. Any hint or critique is welcome.
Deliverables:
(1) A Vega grammar reader. A Vega grammar file is, indeed, in JSON
format, so we could analyze the grammar starting by the tree
representation of the parsed file. The actual parsing will be performed
by exploiting the jsoncpp library.
(2) A Vega's Visualization would be mapped to a class vtkVegaChart
similar to vtkChart, but with the ability to manage input data sets
directly and sharing them between all plots added to the chart. All
Vega's Visualization properties will be supported.
(3) All Vega's Data properties will be supported but only the JSON
format for input data file sources. Usually Vega's data sets are
represented by an array of objects. Each object has the same number and
type of properties. That means we are able to transform a Vega's data
set in an object of arrays: [{"x": 1, "y": 0}, {"x": 3, "y": 2}] ->
{"x": [1, 3], "y": [0, 2]}. Hence, we can map Vega's data sets to
vtkTable, where each column of the table represents a Vega's data set
property.
(4) The following Vega's Data Manipulation Transforms will be supported:
cross, facet, filter, formula, slice, sort, stats, unique. Vega's
transforms will be mapped to new vtk data filters.
(5) The following Vega's Visual Encoding Transforms will be supported:
pie, stack, link.
(6) The following Vega's Scale Types will be supported: ordinal, linear,
log, sqrt, time. A vtkScale class would be implemented for managing
scaling, for each scale type there will be a specific subclass of
vtkScale. Part of this work is simplified by the fact that the
implementation of a part of such scale types is already embedded in the
vtkAxis class. The vtkScale class and its subclasses will provide
support for more scale types and the ability to share the scaling
business logic beetween several axis objects.
(7) The following Vega's Axes properties will be supported: type, scale,
orient, title, titleOffset, values, ticks, tickPadding, tickSize,
offset, grids. Most of these properties are already implemented by the
vtkAxis class, the main goal here will be to split the presentation
feautures from the computational part. Presentation will be supported by
a vtkVegaAxis class that would demand computational task to a vtkScale
object, that could be shared with other vtkVegaAxis objects.
(8) Vega's mark support:
-- Top-Level Mark Properties: type, name, from, properties(enter,
update, exit, hover), key.
-- Value References: value, field, group (limited to "width" and
"height"), scale, offset, band.
-- Shared Visual Properties: x, x2, width, y, y2, height, opacity,
fill, fillOpacity, stroke, strokeWidth, strokeOpacity.
-- Specific Marks: rect, symbol, arc, area, line, image, text, group.
Stroke and fill properties will be supported respectively by the
already implemented vtkPen and vtkBrush.
The following mapping from Vega's marks to vtkPlots is possible (in
some case a simplified or an enhanced version could be needed):
- rect --> vtkPlotBar
- symbol --> vtkPlotPoints
- arc --> vtkPlotPie
- line --> vtkPlotLine (actually it can handle only polygonal
lines)
- area --> vtkPlotArea (a new class is needed, but it will be
almost the same than vtkPlotLine)
Image and text marks can be implemented in a similar way of
vtkPlotPoints, but with images or labels instead of symbols.
Finally grouping layout would be handled by vtkVegaChart.
(9) Source code will be commented in order to be able to generate
doxygen documentation.
(10) Test/sample programs of the supported Vega's mark will be provided.
Time-line
Week 1, 2
Task 1 - Start implementation of a Vega grammar reader: Visualization
properties, Top-Level Mark Properties, Value References by value and by
field, Shared Visual Properties: x, x2, width, y, y2, height; rect mark
type.
Week 3
Task 2 - Support for "facet" and "stats" data transforms.
Task 3 - Support for area and line marks.
Week 4, 5
Task 4 - Implementation of vtkScale class with support for Scale
types: linear, ordinal, log and sqrt.
Task 5 - Implementation of vtkVegaAxis class with support for Axes
properties: type, scale, orient, title, titleOffset, values, ticks,
tickPadding, tickSize, offset, grids. vtkVegaAxis - vtkScale integration.
Week 6, 7
Buffer - Spread from the GSoC start to the mid-term period
Week 8
Task 6 - Support for more value reference types: scale, offset, band.
Task 7 - Support for "stack" transform.
Week 9
Task 8 - Support for "pie" transforms and "arc" marks.
Task 9 - Support for "image" and "text" marks.
Week 10, 11
Task 9 - Support for "filter", "slice", "sort" and "unique" data
transforms.
Task 10 - Support for "cross" and "formula" data transforms.
Task 11 - Support for scale of type "date".
Week 12, 13
Buffer - Spread from the mid-term period to the GSoC end.
Kind Regards,
-- Marco
More information about the vtk-developers
mailing list