Skip to content

hypertrack/perseus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HyperTrack logo

| Perseus


PRs Welcome

Perseus is a ReactJS sample application to visualise a Hypertrack trip_summary or LineString geoJSON. Use this web app to debug your device's trips, investigate location & activity events in your trip.

Overview

Features

Perseus features:

Activity Overview
  • Start time of the activity (if available)
  • End time of the activity (if available)
  • Recorded duration of the activity (if available)
  • Activity type: (classified into one of: Stop, Walk, Cycle, Drive, Unknown)
  • Available only for trip_summary
Location Overview
  • Coordinates of the Location event
  • Altitude of Location event (if available)
  • Recorded timestamp of Location event (if available)
  • Available for trip_summary & LineString geoJSONs
Outage Overview
  • Start time of outage
  • End time of outage
  • Duration of outage
Validation Overview
  • Erroneous input not be plotted, until corrections are performed
  • Errors and thier locations are listed in the same popup
  • Validation is available for trip_summary & LineString geoJSONs

Features that can be enabled using URLSearchParams:

Search parameter key Required Default value Possible values & thier validity
accessToken - Mapbox access token: pk.__your_token_here__. Pick up your token from mapbox, click here for instructions.
gist - Valid, public or private, github gist url
shed_animation false Set this key to true, to shed animations between map transitions
hash true Set this key to false, to remove the trailing hash fragment in the URL

accessToken once set, will be cached in the browser.

Local Installation and setup

After cloning or forking this repository, you should install all dependencies on your machine:

# with npm
npm install

# or with Yarn
yarn

With the dependencies and configuration in place, you can start the server in development mode:

# with npm
npm start

# or with Yarn
yarn start

Usage

You'd be using Perseus in one of 2 ways:

  1. Start afresh with no data, One would acquire a trip_summary or LineString geoJSON; either paste the JSON as text in the text field, or upload one of the JSON type through the file input field. Once validated, Update button, would close the modal, and plot the location data on to the map
  2. Perseus is loaded with a gist URL. In such scenario, Perseus would fetch the json from the gist (both public gists, and private gists are supported) and update the text field. Once validated, Update button, would close the modal, and plot the location data on to the map.
    The gist url can be supplied as a URL search parameter gist.
    Eg: https://hypertrack.github.io/perseus/?gist=https://gist.github.com/SahRckr/c6ee0dd9b7bd605f8ca9d9b43561387d

The validation of input will prohibit the input overlay to close and list out known problems in the input.

Related

Credits

This project uses the following open-source packages:

  • ajv: The fastest JSON Schema Validator.
  • @blueprintjs/core: A React-based UI toolkit for the web
  • mapbox-gl: Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL

License

This project is licensed under the MIT License - see the LICENSE file for details