-
Notifications
You must be signed in to change notification settings - Fork 35
Configuration
It's pretty difficult to balance functionality with simplicity, and the configuration options are probably the best indicator of where VizWit is at in that regard. The intention with the builder is to abstract this complexity with a wizard-like layout tool. But this page documents all the configuration options.
Most configuration options are used by all chart types. Some are only used by one.
-
bar
: a bar chart -
datetime
: an area chart representing temporal categories -
table
: a sortable, pageable table -
pie
: a pie chart -
choropleth
: a map with polygon colors scaled based on a value -
callout
: a single value, typically a key metric
Required. The title of the chart
ex. Type of Violation
Optional. The description of the chart.
ex. Includes all public safety agencies
Currently, only Socrata data sources work with VizWit. Additional data sources could be added by extending the BaseProvider
class.
The data provider from the hash in providers.js. Defaults to socrata
Required. The domain/hostname of the data provider.
ex. data.phila.gov
Required. The 4x4 dataset ID.
ex. a8cx-la3p
In most cases, aggregation can be achieved using only groupBy
, but some cases require more advanced options.
Field to group by / pivot on. For date/time fields, it is recommended to use a variation of date_trunc_ym(field_name)
.
ex. violation_type
Optional. Defaults to count
.
Optional. Defaults to *
.
Optional. Allows complete override of what is selected as the value, which is normally done through aggregation.
ex. sum(votes) / sum(total) * 100
Optional. Defaults to value of groupBy
. The field to filter other charts by when a user clicks this chart.
When you interact with a chart in VizWit, it filters the other charts based on the chart's groupBy
field. But if you use a function in groupBy
like date_trunc_ym(datetime)
, you want it to filter the other charts by datetime
(without the function). triggerField
allows you to specify this.
The following options are only used in choropleth chart types.
URL to the GeoJSON file containing the map boundaries
ex. https://data.phila.gov/resource/w4gp-aa3d.geojson
The property from each GeoJSON feature to be used as the polygon's label in the popup
ex. zip_code
The property from each GeoJSON feature that represents the ID of the polygon. Used to join against the dataset using its groupBy
value.
ex. _feature_id
The following options are only used in callout chart types
Numbro format string used on values
ex. 0,0
Moment format string used on labels
ex. YYYY
The following options can be used on any chart type
Optional. Order of the data query. You probably want to use label
or value
but don't have to.
ex. label desc
Optional. The number of results in the data query.
ex. 5
Optional. JSON array of base filters to always use on the data query. For example, if you wanted a visualization of parking tickets issued by police, you could set a base filter limiting the tickets data to those issued by police. [More info](Base Filters)
[
{
"field": "issuing_agency",
"expression": {
"type": "=",
"value": "POLICE"
}
}
]
These only work with table
chartType
s.
Optional. Hide columns in the data table by specifying their id (Socrata API field name) in an array named columnsToHide
ex: "columnsToHide":["id","x_coordinate","y_coordinate"]