Abstract data visualization with Autark Plot
D3-based charts that read feature properties directly, and that emit and receive selections so several views stay linked.
Autark is a modular toolkit for building urban visual analytics applications in the browser. Its modules share a common data model, so data retrieved from a spatial database, processed by a computation pipeline, displayed on a map and explored through charts stays connected throughout an application.
This page introduces autk-plot, the module for abstract data visualizations: reusable charts for distributions, relationships, categories and temporal patterns. Charts are not isolated outputs; they emit selections and react to selections produced by other charts or by an autk-map view. We introduce the data model, create a first chart, transform feature attributes into aggregated chart data, and connect several plots through interaction events.
1. Autark Plot
1.1 What it is
autk-plot is a D3-based charting module for attributes stored in GeoJSON feature collections. A plot receives a container element and a configuration object: the chart type, the input collection, the attributes to encode, and optional labels, dimensions, transformations and interaction events. Supported chart types include scatter plots, bar charts, line charts, tables, heat matrices and parallel-coordinates plots, each mapping feature properties to visual channels such as position, color, size or category.
It reads values straight from feature.properties, with no separate table or data frame, so it works equally on data returned by autk-db and on data already loaded in autk-map. A typical configuration specifies:
- a chart type, such as
"scatterplot"or"barchart"; - a GeoJSON feature collection;
- the feature-property names used as attributes;
- human-readable labels for axes and titles;
- optional transformations, such as binning or aggregation; and
- optional events that enable clicks or brushing.
1.2 The feature-centric model
Autark takes the geographical feature as the atomic unit of the toolkit. Many urban visual analytics systems get complicated because data and interaction operate at different levels of abstraction: a database returns rows, a renderer consumes buffers, a user interaction produces a pixel coordinate or a brush box. Autark collapses these levels into one principle: all modules operate on features.
A feature has geometry, properties, and an optional GeoJSON id. A selection in Autark uses positions in the source collection.features array, not the GeoJSON IDs. This is why the same objects flow across modules:
autk-dbreturns a feature collection;autk-maprenders feature geometries;autk-plotbinds to feature properties;autk-computeconsumes features to produce data;- interactions return selections of features.
1.3 First example
A plot starts from a GeoJSON FeatureCollection. We use the neighborhoods of Manhattan. Inspecting one feature shows its properties; two of them, shape_leng (perimeter) and shape_area (area), are enough for a scatter plot.
To create a chart use the AutkPlot constructor with two arguments: an HTML container that determines where the chart is rendered, and a configuration object. type picks the chart ("scatterplot"), collection supplies the features, attributes.axis maps property names to the x and y axes, labels gives readable axis labels and a title, and height is in pixels. Set width: "auto" to fit the container. Autark 5 uses ticks.x.format and ticks.y.format for tick labels; "~s" is a compact D3 number format.
2. Data transformation
autk-plot may need to pre-process a FeatureCollection before drawing. A bar chart, for example, usually cannot use the raw collection, since it needs binned, sorted or aggregated values rather than one mark per feature. The transform option lets you bin, sort, aggregate arrays and reduce time series without leaving the charting API.
2.1 The @transform placeholder
The @transform placeholder tells the plot where the output of a transformation goes in the chart configuration. A transform computes new values, and those must be connected to one of the chart's visual channels. Instead of naming a property of the original collection, write @transform to say that this channel receives the derived result.
With binning-1d, the transform produces an aggregated value for each bin, so @transform goes in attributes.axis[1], where the bar height reads those computed values.
3. Interactions
autk-plot supports coordinated views through interaction events. A plot emits an event when the user selects marks, and other plots, maps or interface elements can react to that selection.
3.1 Mouse events
Enable the interactions a plot needs through its events option:
PlotEvent.CLICK: emitted when the user clicks a mark.PlotEvent.HOVER: emitted when the pointer enters or leaves a mark; it does not change the selection.PlotEvent.BRUSH: emitted while drawing a rectangle selection.PlotEvent.BRUSH_X: emitted when brushing horizontally.PlotEvent.BRUSH_Y: emitted when brushing vertically.
3.2 Linked visualizations
Both charts use the same neighborhood collection, so a selection from one chart can be passed to the other with setSelection(). Drag a rectangle over the scatter plot to see the number of selected neighborhoods and the brush ranges in data units. Click a histogram bar to select the features it represents. Pass the event’s optional shares through as well. In the RC this is an object keyed by source index, with feature: {selectedUnits, totalUnits} and optional series membership/coverage—not an array of fractions. Remapping indices also requires remapping share keys; differently grouped receivers should receive feature-level coverage without incompatible series restrictions.
Hover over a histogram bar to preview the matching points with setHover(). Move away and the preview clears without changing the current selection.
4. Compare groups and add references
Use attributes.series to compare groups with categorical colors on shared scales. Here we split the neighborhoods around their median area without changing their source indices. A manual scales domain fixes the display window; it clips marks, rather than filtering the data before statistics or aggregation.
Annotations are reference marks, not selectable data. They do not expand domains or change provenance; setAnnotations([]) clears them. Statistics pool finite observations across groups after filtering and transforms, before the manual window. Do not combine series with attributes.color or topK.
For grouped bars, provide one nonnegative value per category/series pair. For grouped lines, combine series with reduce-series; missing buckets break the path instead of becoming zero. Explore Series and annotations in the User Guide and the linked studies Manhattan’s noise rhythms, Two airports, one destination, and Same route, different ride.
5. Inspect series-aware selections
Click a bucket point. The console shows one original feature index and its keyed series share; the table receives the same indices and shares. The table is ungrouped, so it ignores series restrictions. Use style.radius: 0 to hide point marks without removing their data from brushes or programmatic selection.
An invalid updateCollection() throws and retains the previous valid collection, domains, and selection. The runner destroys plots before rerunning their cell or leaving the chapter; application code must call plot.destroy() when done.
Credits
Adapted from the Observable notebook 05. Abstract Data Visualization, produced for the tutorial Urban Data Analytics with Autark at SIBGRAPI 2026. See the author list.