Skip to content

DTVF Data v2.0.0

Michael Hillman edited this page Jun 29, 2022 · 6 revisions

This page is a work in progress.

Configuration Files

In addition to the actual data (whether it's being provided in local files or via a remote endpoint), the visualisation requires a number of configuration files to function. These files need to be hosted relative to the base URL of the stack (or base directory of local files) and have the exact names detailed below.

visualisation.json:

This file is required and lists the definitions of grouped data sources and map layers to show on the visualisation. Each group within this JSON file defines a list of sources and layers to make up what the visualisation plots; these sources and layers are defined using the format provided by the MapBox API (sources, layers). However, a few additional properties should be considered:

  • id: Sources & Layers. This property is the unique back-end name for the source/layer.
  • name: Layers only. This is the user facing name of the layer and can be reused to group individual layers into a single tree option.
  • clickable: Optional, Layers only. Set to false to disable all mouse interactions
  • treeable: Optional, Layers only. Set to false to prevent adding a tree entry for this layer.

For a working example of a visualisations.json file, view the example-visualisation.

icons.json:

This optional JSON file stores a key-value mapping of any icons that need to be loaded into the map for display. It should consist of a single JSON array in which the keys are icon names (that can then be used as a feature-level property to change icons for different locations), and the value a URL of the image to load.

For a working example of a icons.json file, view the example-visualisation.

links.json:

This optional JSON file defines links to any additional resources that the viewer of the visualisation should be aware of. An intro field can be set to provide some context, then a links array should contain objects with text and url fields that will be used to construct a list of hyperlinks.

For a working example of a icons.json file, view the example-visualisation.

Using GeoJSON Files

GeoJSON files can be used by the DTVF to specify the locations of features. At the time of writing, it's intended that GeoJSON files only contain the locations of features and a small amount of visualisation properties; metadata to be shown in the visualisation side panel will be accessed via a standalone HTTP agent.

GeoJSON files for use with the DTVF are expected to follow the standard GeoJSON format with a few small additions. Each feature (i.e. location) within a GeoJSON file should have:

  • A numerical id field that is unique across all features within that file. That id field should also be nested within the feature node, but not within the properties group (this format is required by some of our mapping library's additional features).
  • A name property. This is the field that the visualisation will use for the user facing name of the location.
  • An optional description property can also be provided; by default, the name and description field (if present) will be displayed when the user hovers their mouse over the location.
  • An optional thumbnail property can also be provided; if this is a URL to an image, it can be displayed when the user hovers their mouse over the location.

Each GeoJSON should contain a single type of location (i.e. do not mix Points with Polygons or LineStrings), and will be represented by a single map layer.

Wherever possible, GeoJSON files should also be encoded with UTF-8.