Browse Source

handle launched with location, and ignore unrecognized events

closes #11
pull/14/merge
Aaron Parecki 6 years ago
parent
commit
df578d4aed
No known key found for this signature in database GPG Key ID: 276C2817346D6056
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      compass/public/assets/events.js

+ 13
- 5
compass/public/assets/events.js View File

@ -3,6 +3,12 @@ function collectEventSeries(data) {
var events = data.events;
var series = {
"application_launched_with_location": {
name: "Launched with Location",
color: '#42C093',
y: 90,
data: []
},
"visit": {
name: "Visit",
type: 'scatter',
@ -55,11 +61,13 @@ function collectEventSeries(data) {
};
for(var i=0; i<events.length; i++) {
series[events[i].properties.action].data.push({
x: new Date(events[i].properties.unixtime*1000),
y: series[events[i].properties.action].y,
location: (events[i].geometry ? events[i].geometry.coordinates : null)
});
if(series[events[i].properties.action]) {
series[events[i].properties.action].data.push({
x: new Date(events[i].properties.unixtime*1000),
y: series[events[i].properties.action].y,
location: (events[i].geometry ? events[i].geometry.coordinates : null)
});
}
}
var response = [];

Loading…
Cancel
Save