Views

View is a visualization of certain theme using a set of related indicators and groups of objects (markers or areas) displayed on a map. View also contains the definition of filters.

It is linked to dashboards and marker selectors. Each view references exactly one dashboard and exactly one marker selector.

Syntax

This is the Catchment Area view of the Retail Solution Demo project.

You can see that the view contains a fitting description and title. It is linked with its dashboard and a marker selector. It also contains a number of filters, defined in the filterGroup array. At the end, in the mapOptions object, various map window settings - such as map center, or zoom limits can be defined.

Additional syntax examples

Example of a view with the variables filter type. This filter allows you to set unique variables used in metrics. In this example, it allows you to tweak different aspects of some index.

.

Default values are also available for indicator filter type. The values array must contain exactly two values with respect to the data type of the actual indicator, as well as the default granularity setting.

Default values are also available for histogram filter type. The values array must contain exactly two integer values. Notice the nullFiltered switch, which filters out null values.

Default values are also available for multiSelect filter type. The values array must contain at least one string value.

Default values are also available for singleSelect filter type. Apart from the value key, the syntax is identical with multiSelect.

Default values are also available for feature filter type. The values array must contain at least one string value. The specified values must be the feature ids (property specified in the dataset's primaryKey).

Key description

content

KeyTypeOptionalityDescriptionConstraints
iconstring

identifier of the view icon as shown on the project page

see the available icons below

["catchment_area", "atm_cash_machine", "city_buildings", "credit_cards", "customer_intelligence", "diagram_chart", "fast_delivery", "first_place_pedestal", "hourglass_sandclock", "location_mark", "market_potential", "market_trends", "market_vision", "optimism_and_happiness", "packaging_box", "performance_method", "rent_a_house", "road_route", "shopping_cart", "tactical_advantage", "venture_capital", "wealth_accumulation", "workgroup_people"]
orderinteger

specifies the order of the view on the Project page

secondary ordering is by title, alphabetically 

x => 1
dashboardstring

URL link to the dashboard, which the view contains

/rest/projects/$projectId/md/dashboards?name={dashboardName}
markerSelectorstring

URL link to the marker selector, which the view contains

/rest/projects/$projectId/md/markerSelectors?name={markerSelectorName}
markersOnlyboolean

enables the marker only view (see the tutorial)

default = false

[true, false]
showAttributesOnDrillbooleanenables feature attributes visibility after clicking on a indicator drill[true, false]
defaultGranularitystringURL link to the dataset, which will be the selected as the default granularity level when entering the view/rest/projects/$projectId/md/datasets?name={datasetName}
defaultVisualizedstringURL link to the indicator, which will be the visualised by default when entering the view/rest/projects/$projectId/md/indicators?name={indicatorName}
defaultVisualizationstringspecifies default visualization selected when entering the view[areas, grid, zones, heatmap, dotmap, line]
defaultDrilledstringURL link to the indicator, which will be the drilled down to by default when entering the view/rest/projects/$projectId/md/indicators?name={indicatorName}
defaultToolstring

specify a tool which will be active by default when entering the view

search = , filter = , visibility =, measure =

[search, filter, visibility, measure]
defaultCompareTypestringspecifies default compare type selected when using compare[dominance, overlap]
filterGrouparray

array of filters applicable to the indicators presented in this view

[indicatorglobalDate, datehistogram, multiSelect, variables]
spatialQueryobjectdefault spatial query settings (used in heatmap visualization)x => 1
fitnessGroupsinteger

specifies the number of indicator fitness segments

this setting's scope is view, so it will affect all indicators in the view

[3, 5]
mapOptionsobjectmap window settings on the project page
mapContextMenuobjectarray of objects with definition of 3rd party services available on mouse context click
exportsobjectarray of export references which allows you to define exports per view
measureobjectmeasure tool settings
defaultSelectedobjectspecify objects selected by default when entering the view
excludeDatasetsarrayarray of dataset names (not links) to be excluded from the granularity dropdown menu

content.filterGroup.indicator

Indicator filter allows you to filter areas based on the values of various indicators present in the view's dashboard.

They are located in the Filters  tool, as well as all other filters (except globalDate).

Default values can be set in the defaultValues object. And since indicator filters can have different results on different granularities, default granularity can be set as well.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always indicator

[indicator]
indicatorstring

URL link to an indicator object, whose value will be filtered

/rest/projects/$projectId/md/indicators?name={indicatorName}
defaultValuesobject

object containing default values for the filter


filterSelectionboolean

determines if the filter should be applied also when a marker is selected (true means apply the filter)

default = false

[true, false]

content.filterGroup.indicator.defaultValues

KeyTypeOptionalityDescriptionConstraints
values

decimal

array of two decimals - maximum and minimum value of the filter

size = 2

granularitystringURL link to a dataset object, which will be the default granularity option/rest/projects/$projectId/md/datasets?name={datasetName}

content.filterGroup.globalDate

Defines a property, which will filter the whole time frame.

Can be set by the date picker in the top left corner of the map window.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always globalDate

[globalDate]
propertyobject

identifier of a dataset property, which will be filtered by date

e.g.: orders.order_date

{datasetName}.{datasetProperty}
defaultValuesobject

object containing default values for the date range

(warning) if present, please note that this will make this filter active all the time


content.filterGroup.date

Allows to set from-to filter for multiple date attributes (year, month, week, day, hour...). It has identical syntax with the globalDate filter.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always date

[date]
propertyobject

identifier of a dataset property, which will be filtered by date

{datasetName}.{datasetProperty}
defaultValuesobject

object containing default values for the date range

(warning) if present, please note that this will make this filter active all the time


content.filterGroup.globalDate.defaultValues

content.filterGroup.date.defaultValues

KeyTypeOptionalityDescriptionConstraints
startDateobject

an object containing either value or function that specifies the start date


endDateobjectan object containing either value or function that specifies the end date

content.filterGroup.globalDate.defaultValues.startDate

content.filterGroup.date.defaultValues.startDate

content.filterGroup.globalDate.defaultValues.endDate

content.filterGroup.date.defaultValues.endDate

KeyTypeOptionalityDescriptionConstraints
valuestring

given value in the ISO 8601 format

format = YYYY-MM-DD

functionobject

a function object defining an interval of a relative date filter


Relative date filters

Relative date filters allow you to create filters with sliding date values, like last week, previous month or the first 90 days of a year.

They consist of three functions:

  • function_today - always returns today's date
  • function_date_trunc - truncates a date to a beginning of an interval (= first day of a week, month, etc.)
    • supported intervals: day, week, month, quarter, year
  • function_interval - generates a date interval, which can later be added or subtracted from a date
Date rangeDefinition syntax
the day before 30 daysfunction_today  function_interval(30, day)
the beginning of the current weekfunction_date_trunc(today, week)​

​the beginning of last week

function_date_trunc(today, week)​  function_interval(1, week)
the day before two monthsfunction_today  function_interval(2, month)
the ending of the last monthfunction_date_trunc(today, month)​  function_interval(1, day)

By combining these functions into startDate and endDate, you are able to create the desired intervals. Let's have a look at an example:

Last 30 days

This interval spans last 30 days since today. It does not respect the boundaries of a calendar month.

This month

This interval starts at the 1st of the current month and ends today.

Previous year

This interval spans all days of the previous year. If it's the New Year's Eve of 2017, the whole year 2016 will be selected. If it's the New Year's Day of 2018, the whole year 2017 will be selected.

content.filterGroup.histogram

Histogram filter allows you to filter the integer, bigint and decimal values.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always histogram

[histogram]
propertyobject

identifier of a dataset property, which the filter will be applied to

{datasetName}.{datasetProperty}
formatobject

specifies the formatting of the histogram values

see indicator.content.format


defaultValuesobject

object containing default values for the histogram filter

(warning) if present, please note that this will make this filter active all the time


content.filterGroup.histogram.defaultValues

KeyTypeOptionalityDescriptionConstraints
valuesarray

array of two integers - upper and lower default value

size = 2

nullFilteredboolean

specifies if null values should be filtered or not

default = false (null values are present)

[true, false]

content.filterGroup.multiSelect

Multiselect filter that works like checkbox. Used to filter enumeration types (e.g. day of the week, type of the store, etc.).

When there is more than 10 items, a search bar is added. The maximum count of filterable records is 20 000.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always multiSelect

[multiSelect]
propertyobject

identifier of a dataset property, which the filter will be applied to

{datasetName}.{datasetProperty}
orderByobject

specifies how to order the multiselect list


defaultValuesobject

object containing default values for the multiselect filter

(warning) if present, please note that this will make this filter active all the time


content.filterGroup.multiSelect.orderBy

Specifies the ordering of elements in a multiSelect filter.

KeyTypeOptionalityDescriptionConstraints
propertystring

identifier of a dataset property, by which the list will be ordered

{datasetName}.{datasetProperty}
directionstring

sort direction

default = asc

[asc, desc]

content.filterGroup.multiSelect.defaultValues

KeyTypeOptionalityDescriptionConstraints
valuesarray

array of at least one string value(s), that will be set as default(s)

size => 1

content.filterGroup.singleSelect

Singleselect filter that works like radio button. The user can choose only one of a predefined set of options. Used to filter enumeration types (e.g. day of the week, type of the store, etc.).

Please note that having this filter in a view makes it active all the time. If no defaultValues.value is specified, the first property is selected.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always singleSelect

[singleSelect]
propertyobject

identifier of a dataset property, which the filter will be applied to

{datasetName}.{datasetProperty}
orderByobject

specifies how to order the singleselect list


defaultValuesobject

object containing one default value for the singleselect filter


content.filterGroup.singleSelect.defaultValues

KeyTypeOptionalityDescriptionConstraints
valuestring

string value, that will be set as default

(*)

content.filterGroup.variables

Allows you to set unique variables which are used in metrics. See the syntax example of the filter above.

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always variables

[variables]

title

string

title of the variables filter

(*)
variablesarrayarray of the content.filterGroup.variables.variable objectssize => 1

content.filterGroup.variables.variable

Each variable is uniquely identified by it's name. This name then must be used in a metric objects, which is located 

KeTypeOptionalityDescriptionConstraints
namestring

name of the variable

must match the name of variable used in metrics

(a-z0-9_-)
titlestring

human-readable title of the variable

(*)
minValuedecimal

minimum value of the variable


maxValuedecimal

maximum value of the variable


defaultValuedecimaldefault value of the variable
formatobject

specifies the formatting of the variables values

see indicator.content.format


content.filterGroup.feature

Allows you to set selected objects in the map (markers, areas, polygons, lines...).

KeyTypeOptionalityDescriptionConstraints
typestring

type identifier, always feature

[feature]

dataset

string

link to a dataset whose features will be filtered/rest/projects/$projectId/md/datasets?name={datasetName}
defaultValuesobject

object containing default string values for the feature filter

see example above

size => 1

content.spatialQuery

KeyTypeOptionalityDescriptionConstraints
profilestring

profile of the spatial query[car, bike, foot, air]
unitstring

unit of the spatial query[time, distance]
amountinteger

the size of the query (in meters or minutes, according to unit)x => 1

content.mapOptions

KeyTypeOptionalityDescriptionConstraints
centerobject

center of the map window when entering the view
zoominteger

sets ideal zoom level2 .. 18
minZoominteger

sets the minimum zoom level2 .. 18
maxZoominteger

sets the maximum zoom level2 .. 18
tileLayerMenuboolean

display or hide the base map layer menu

default = true

[true, false]
tileLayerstringbase map layer identifier

[mapbox, mapboxStreets, mapboxOutdoors, mapboxSatelliteStreets, mapboxLight, mapboxDark]

content.mapOptions.center

KeyTypeOptionalityDescriptionConstraints
latdecimaldecimal value of the latitude-90.0 .. +90.0
lngdecimaldecimal value of the longitue-180.0 .. +180.0

content.mapContextMenu

The mapContextMenu object allows you to define the content of context menu after using right click in the map.

KeyTypeOptionalityDescriptionConstraints
itemsarray

array of map context menu items

content.mapContextMenu.items

KeyTypeOptionalityDescriptionConstraints
typestring

type of the clickable item

choose one of the provided services by Google, Mapy.cz or ČÚZK

[googleSatellite, googleStreetView, mapyczOrtophoto, mapyczPanorama, cuzkParcelInfo]

content.exports

Allows you to define list of export objects which will be available after using the Export function available from the Menu ().

KeyTypeOptionalityDescriptionConstraints

export

string

link to an export which will be available in the view/rest/projects/$projectId/md/exports?name={exportName}

content.measure

This object allows you to set the settings of measure tool. The settings is available for line and isoline measure.

KeyTypeOptionalityDescriptionConstraints
typestring

type of the measure[line, isoline]
pointsarray

array of points for line measure

(warning) either points or zones can be specified

size => 1
zonesarrayarray of zones for isoline measure

(warning) either points or zones can be specified

size => 1

content.measure.points

KeyTypeOptionalityDescriptionConstraints
latdecimal

decimal value of the point's latitude-90.0 .. +90.0
lngdecimal

decimal value of the point's longitude

-180.0 .. +180.0

content.measure.zones

KeyTypeOptionalityDescriptionConstraints
latdecimal

decimal value of the point's latitude-90.0 .. +90.0
lngdecimal

decimal value of the point's longitude

-180.0 .. +180.0
profilestringprofile of the isochrone[car, bike, foot, air]
unitstringunit of the isochrone[time, distance]
amountintegeramount of units of the isochronex => 1

content.defaultSelected

Specifies selected objects and selected coordinates when entering the view.

KeyTypeOptionalityDescriptionConstraints
datasetstring

link to a dataset whose features will be filtered/rest/projects/$projectId/md/datasets?name={datasetName}
idsarray

array of object ids which will be selected


coordinatesarrayarray of objects with "lat" and "lng" size => 1

Visual representation

View icons

This is the available view icon palette.

atm_cash_machinecatchment_areacity_buildingscredit_cardscustomer_intelligencediagram_chartfast_deliveryfirst_place_pedestalhourglass_sandclocklocation_mark

market_potentialmarket_trendsmarket_visionoptimism_and_happinesspackaging_boxperformance_methodrent_a_houseroad_routeshopping_carttactical_advantage

venture_capitalwealth_accumulationworkgroup_people

Views displayed on the project page

Map base layers

mapboxmapboxStreetsmapboxOutdoors

mapboxSatelliteStreetsmapboxLightmapboxDark

globalDate filter type

in default statewith set values


indicator
filter type

in default statewith set values

date filter type

in default statewith set values

histogram filter type                                                                                           

in default statewith set values

multiSelect filter type

in default statewith set values

multiSelect filter type

in default statewith set values

variables filter type

in default statewith set values

feature filter type

in default state

with set values