Skip to content
Tim Wisniewski edited this page Jan 17, 2016 · 19 revisions

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.

Basic Information

chartType

  • 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

title

Required. The title of the chart ex. Type of Violation

description

Optional. The description of the chart. ex. Includes all public safety agencies

Data Source

Currently, only Socrata data sources work with VizWit. Additional data sources could be added by extending the BaseProvider class.

provider

The data provider from the hash in providers.js. Defaults to socrata

domain

Required. The domain/hostname of the data provider. ex. data.phila.gov

dataset

Required. The 4x4 dataset ID. ex. a8cx-la3p

Aggregation Options

In most cases, aggregation can be achieved using only groupBy, but some cases require more advanced options.

groupBy

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

aggregateFunction

Optional. Defaults to count.

aggregateField

Optional. Defaults to *.

valueField

Optional. Allows complete override of what is selected as the value, which is normally done through aggregation. ex. sum(votes) / sum(total) * 100

triggerField

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.

Choropleth Options

The following options are only used in choropleth chart types.

boundariesURL

URL to the GeoJSON file containing the map boundaries ex. https://data.phila.gov/resource/w4gp-aa3d.geojson

boundariesLabel

The property from each GeoJSON feature to be used as the polygon's label in the popup ex. zip_code

boundariesId

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

Callout Options

The following options are only used in callout chart types

valueFormat

Numbro format string used on values ex. 0,0

labelFormat

Moment format string used on labels ex. YYYY

Overrides

The following options can be used on any chart type

orderBy

Optional. Order of the data query. You probably want to use label or value but don't have to. ex. label desc

limit

Optional. The number of results in the data query. ex. 5

baseFilters

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"
      }
  }
]

Table Display Options

These only work with table chartTypes.

columnsToHide

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"]

Clone this wiki locally