https://github.com/vmapps/polargraphs
Dynamic graphs from Polar A360 tracker
https://github.com/vmapps/polargraphs
graphs javascript plotlyjs polar
Last synced: 11 months ago
JSON representation
Dynamic graphs from Polar A360 tracker
- Host: GitHub
- URL: https://github.com/vmapps/polargraphs
- Owner: vmapps
- Created: 2019-07-18T18:32:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T21:13:50.000Z (over 6 years ago)
- Last Synced: 2024-03-31T23:23:04.669Z (almost 2 years ago)
- Topics: graphs, javascript, plotlyjs, polar
- Language: HTML
- Homepage:
- Size: 3.28 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# polargraph
Transform data from Polar A360 tracker into HTML dynamic graphs
## Purpose
Purpose of this very simple tool is to :
- read JSON data from Polar A360 tracker
- add data to web graph generated with Ploty javascript module
- let user add/remove new data to the existing graph
This small project has been first been developed to complete web
interfaces proposed by Polar.
## Requirements
Following javascript modules are required :
- [jQuery](https://jquery.com/)
- [jQuery UI](https://jqueryui.com/)
- [Plotly.js](https://plot.ly/javascript/)
## Get data from Polar Flow
First of all, you will have to get data from A360 tracker. As the
activity tracker is able to synchronize with Polar Flow website,
it is easier to extract data as JSON file directly from ths website:
- log into [Polar Flow](https://flow.polar.com/) using Chrome
- go to `Agenda` menu, then `Activity` submenu
- in the meantime, open `Developer Tools` console in Chrome
- open `Network` tab in the developer console
- in Polar Flow, click on left arrow to select yesterday (do not use the calendar)
- in developer console, right-click on URL displayed in network tab
- select `Copy` and `Copy link address`
- now paste into Chrome URL bar to get JSON data with regards to yesterday
- save JSON data into `data` local directory as `/data///--.json`
Note that URL to get will look like this:
```
https://flow.polar.com/api/activity-timeline/load?day=2019-07-08&maxSampleCount=200
```
## Run web server
Once you have retrieved all JSON data, run a simple web server by running that commad into root directory:
```
$ python -m SimpleHTTPServer 80
```
Now, go to the browser and type `http://127.0.0.1/polargraph-heart-rate.html` to see the graph.
## User interface
On top-left corner, you could click on calendar button to graph data from a specific day:
- first click on a day will add data to the graph
- second click on already selected day will remove data from the graph
On top-right corner, you will find out Plotly graph toolbar.
## Sample
