Commit 429e7624 authored by alain's avatar alain 🐙
Browse files

update example settings

parent bf8eb3bb
export const appSettings = {
language: "nl",
panelBreakpoint: 800
}
\ No newline at end of file
import { color } from "../custom/muv/d3-color"
export const texts = {
pilotLocations: "Pilot locations",
loading: "Loading...",
lastMean: "last hourly average",
lastPeak: "peak value last hour",
mean: "mean",
peak: "peak value"
}
export const mapDefaults = {
latitude: 46.6957637170966,
longitude: 5.765113549054841,
zoom: 4.5,
pitch: 45,
bearing: 0
bounds: [
[4.5, 52.6],
[5, 52.3]
],
viewport: {
pitch: 60,
bearing: 0
}
}
export const mapLocations = [
{
name: "Amsterdam",
latitude: 52.371828,
longitude: 4.901642,
zoom: 12
},
{
name: "Barcelona",
latitude: 41.40370281706366,
longitude: 2.1432531593864312,
zoom: 12
},
{
name: "Helsinki",
latitude: 60.17226969670993,
longitude: 24.900654954799048,
zoom: 12
},
{
name: "Palermo",
latitude: 38.12088554193859,
longitude: 13.352510065410891,
zoom: 12
name: "Name",
bounds: [
[4.557490, 52.514173],
[4.694126, 52.436089]
],
sublocations: [
{
name: "Name",
bounds: [
[52.516652, 4.613219].reverse(),
[52.476220, 4.700986].reverse()
]
}
]
}
]
......@@ -62,6 +47,7 @@ export const mapItemSettings = {
sizeMax: 200,
elevationMaxMin: 120,
elevationMaxMax: 2000,
colorOffline: "#888"
}
export const lightSettings = {
......
import { addMissingHours } from "../../../src/util/data"
import { addMissingDataPoints } from "../../../src/util/data"
export default {
name: "muv",
name: "sourcename",
sides: 5,
angle: 0,
factor: 0.5,
factor: 0.5,
daysToFetch: 90,
all: async function getAll(parameter) {
all: async function(parameter) {
try {
const allResponse = await fetch(`https://data.waag.org/api/muv`)
const all = await allResponse.json()
//console.log(all)
const latestResponse = await fetch(`https://data.waag.org/api/muv/getOnlineSensors`)
const latest = await latestResponse.json()
//console.log(latest)
let offlineSensors = []
let unregisteredSensors = []
......@@ -29,10 +28,9 @@ export default {
id: sensor.id.toString(),
name: sensor.sensor_type + " " + sensor.id.toString() + " " + sensor.location,
type: sensor.sensor_type,
source: "muv",
source: "sourcename",
coordinates: [sensor.longitude, sensor.latitude].reverse(),
mean: sensorData[`${parameter}`]
//max: sensorData[`${parameter}_max`]
}
} else {
offlineSensors.push(sensor.id)
......@@ -65,15 +63,18 @@ export default {
}
},
detail: async function getDetail(station, parameter, start, end) {
stationMeta: function(station, parameter) {
const stationMeta = {
type: station.id,
name: station.name,
description: ""
}
return stationMeta
},
stationData: async function(station, parameter, start, end, granularity) {
try {
const stationInfo = {
type: station.id,
name: station.name,
description: ""
}
const response = await fetch(`https://data.waag.org/api/muv/getSensorData?sensor_id=${station.id}&start=${start}&end=${end}`)
const responseData = await response.json()
......@@ -90,7 +91,7 @@ export default {
}
})
const data = addMissingHours(conformedData)
const data = addMissingDataPoints(conformedData, granularity)
return { stationInfo, data }
} catch (error) {
......
......@@ -12,5 +12,11 @@ export const texts = {
lastMean: "laatste uurgemiddelde",
lastPeak: "piekwaarde laatste uur",
mean: "gemiddelde",
peak: "piekwaarde"
peak: "piekwaarde",
downloadData: "download data",
startDate: "startdatum",
endDate: "einddatum",
chartHeaderAddition: "(uurwaarden)",
downloadCsv: "download csv",
downloadInfo: "<small><a class='more' href='https://hollandseluchten.waag.org/data-downloaden/' target='_blank' rel='noopener noreferrer'>meer info over data downloaden en de API</a></small>",
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment