Published
Edited
Mar 30, 2020
Insert cell
Insert cell
Insert cell
viewof options = reportOptions(api)
Insert cell
rawTrackPoints = {
yield 'pending'
yield await api.request('track/read', {
tracker_id: options.tracker,
...options,
filter: true,
include_gsm_lbs: true,
point_limit: 3000
}, 'list')
}
Insert cell
trackLine = trackPointsAsLineString(rawTrackPoints)
Insert cell
trackPoints = trackPointsAsPointsColleaction(rawTrackPoints)
Insert cell
viewof map = getMap([
{ name: 'trackline', style: trackLineStyle, data: trackLine },
{ name: 'trackpoints', style: trackPointsStyle, data: trackPoints }
])
Insert cell
Insert cell
trackLineStyle = ({
type: 'line',
'layout': {
'line-join': 'round',
'line-cap': 'round'
},
'paint': {
'line-color': '#1E96DC',
'line-opacity': 0.5,
'line-width': 6
}
})
Insert cell
trackPointsStyle = ({
'type': 'symbol',
'layout': {
'icon-image': 'oneway',
'icon-rotate': { "type": "identity", "property": "heading" },
'text-field': ['get', 'title'],
'text-font': ['Open Sans Semibold', 'Arial Unicode MS Bold'],
'text-offset': [0, 0.6],
'text-anchor': 'top'
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more