Data Pipeline Change
To support Brunel's increasing use in large data applications, we have modified the way we handle data sets.
Previously, all rows of data were copied into the Javascript for processing, even if a summary was being performed.
This could be very inefficient for large data sets that were being summarized. In version 2.3 we have modified the
behavior so that if we detect that not all the data are needed, we only send summarized data to the Javascript front
end. Further, the data set is tagged as summarized so that the data processing steps for summarizing it are not
performed a second time.
The rules for when we can summarize a data set and pass it down are complex, but in general:
* If there is no summary operation requested (no explicit sum, mean, or other summary operation and no use of count),
then summarization is not performed.
* If a data set is used for two elements, then they must have the same way of summarizing the data
(same summary, transforms, each statements), otherwise summarization is not performed
* filter statements (since they dynamically change the data in the client) stop summarization of a data set
* Using the Javascript API to pre-modify the data (by defining the `pre` command) is not recognized because it is
a client-side operation. If you wish to use `pre` it is strong recommended you change the build option for data to
be `columns` to stop automatic summarization (see below)
Builder Options
You can specify the field `includeData` in the `BuilderOptions` structure to modify the data pipeline. The default
value is `minimal`:
* `none` - no data set information will be written. It is the responsibility of the user to provide data sets
* `full` - all data passed to Brunel will be sent to the Javascript, even columns not needed for the chart
* `columns` - only the columns needed for the visualization will be written (this was the version 2.2 default)
* `minimal` - only columns needed will be passed down, and summarization will be performed if possible
Multiple labels
It is now possible to have multiple labels on a shape. This is done by specifying an optional location as part of
each label element. All labels at the same location are concatenated into a single string.
The location can be specified as a list composing location parts, or as a string linking them with "-".
The allowable elements are: `top`, `bottom`, `middle` for the vertical location; `left`, `right`, `center`
for the horizontal, and `inside`, `outside` for whether to show the label inside or outside the shape.
Thus the following are all legal label comments:
label(name:top, ':':top, count:top)
label(name:'top-outside', count:'bottom-right')
label(name:'outside-top', count:[bottom,right])
Symbol Aesthetic
This aesthetic is used only for point elements, and replaces the default circle with a glyph, drawn as a path.
Brunel defines two sets of symbols, a *basic* and an *extended* set. Basic symbols are:
circle, square, triangle, diamond,
cross, pentagon, star, hexagon
and extended symbols include the basic symbols and
plus, alert, arrowup, arrowdown, chart, circleOutline, database,
person, question, happy, neutral, sad, thumbup, thumbdown,
lightbulb, flag, female, male, heart, pencil, info.
The basic set are the ones used if no parameters are specified in the aesthetic syntax. The extended ones are
used only if specifically requested. The icons have been taken from the open source collection "Google Material
Designs". Symbol names can also be used in the style syntax to apply across a whole element.
The full syntax for `symbol` is: `symbol(field:[name1, name2, ...]:uri)`
When a set of names are given, then only the named symbols are used in the symbol mapping, with the given order.
If the URI is given, then the given URI should contain an SVG file containing a list of valid SVG `symbol`
definitions, each with a unique ID. If the IDs all have an identical prefix or suffix, those are stripped. Here are
some examples of symbols; also included is the URL of a set of test symbols
point x(state) y(density) size(population:300%) symbol(density)
bubble x(region) symbol(presidential_choice:[heart, flag]) label(abbr)
x(region) y(girls_name) size(count) style('symbol:female') + x(region) y(boys_name) size(count) style('symbol:male')
x(summer) y(winter) symbol(region:'http://brunelvis.org/test/testsym.svg')
Legends for symbols
Previously, only `color` would display a legend. Now, a legend will be shown for color and symbol mappings.
If only one of `color` or `symbol` is specified, that will be shown in a legend (subject to the options in the
legend statement, if any exists). If both are specified, and they refer to the same field with the same
transformations and summaries a combined legend will be shown with both aesthetics applied. If both are specified,
but they are not showing compatible information, the color legend only will be shown.
Limited gradient support
Brunel defines four gradients which can be used in style statements. A typical use might be:
style('fill:url(_gradient_radial_red);stroke:none')
The four gradients are `_gradient_linear_blue`, `_gradient_linear_red`, `_gradient_radial_blue`, `_gradient_radial_red`.
As you might guess form the names, two are linear and two are radial. The colors have been chosen to match the
first two default brunel element colors.
Note that use of gradient styles overrides any color or opacity aesthetic on the element.
Map quality option 'full'
Added the map quality option `full` to denote a map with the full natural earth data, no quantization
except to regularize the maps. These map files are about twice as large as the `high` quality files,
but for most purposes are very similar in appearance.
css aesthetic now also applies to labels
The CSS aesthetic now also applies to labels, so you can specify styles for labels by mapping to
a field, like so:
`map css(region:'':names) key(state) label(state) style('.label.Midwest {font-size:16px;font-weight:bold}')`
This will show labels for the midwest states in the designated style.
Edge styling
We now support curves and arrows on edges in network, tree and other charts using them.
They can be set with a style `symbol` command to request that style. The valid symbols are given below:
* `style("symbol:straight")` -- simple straight lines
* `style("symbol:arrow")` -- straight lines with an arrow
* `style("symbol:curved")` -- curved lines with no arrowheads
* `style("symbol:curvedArrow")`-- curved lines with arrowheads
The arrowhead will always be a drawn in a neutral grey color. This is a limitation
of current SVG technology, due to be fixed in SVG 2.0.
Custom Maps
You can now use custom maps. Instructions for using GeoJSON files are here: https://github.com/Brunel-Visualization/Brunel/wiki/Custom-Maps.
The `map` action takes a location to a topojson file and the name of the property used for matching to the data values separated by ``
`data('boroughs') map('http://localhost:8889/tree/notebooks/data/boroughs.jsonBoroName') x(Borough) color(value) label(Borough)`
Note that a field must be present in the data containing values that exactly match the attribute values for the chosen property name.