- JavaScript 96.8%
- CSS 1.8%
- HTML 1.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github/ISSUE_TEMPLATE | ||
| app | ||
| css | ||
| data | ||
| docs | ||
| .gitignore | ||
| charts.html | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE.txt | ||
| README.md | ||
This repository is small HTML/JavaScript page which gives graphical charts of the traffic ("unique cloners" and "unique visitors") on État de Genève's GitHub repositories.
Reference : GitHub traffic.
Technical facts
The application consists of three parts:
- A small HTML file
- A JavaScript file
data/charts-data.jswhich stores the traffic values, for a set of GitHub repositories - Two JavaScript files
app/main.jsandapp/charts.jswhich plot the traffic values.
The application is based on the D3 library. It heavily borrows from Tutorial Point's primer.
Usage
In order to view the charts, simply open a browser on file charts.html.
You don't need to have a Web server.
Customization
In order to accommodate this repository to your own GitHub page:
-
Clone this repository.
-
Edit file
charts-data.jsand replace the values with the traffic values of your own GitHub repositories. -
Edit file
main.jsand replace the values with those of your own repositories. In the calls to functionplot, beware of the 3rd parametermaxY: if it is smaller than the largest value, the repository's data won't be plotted at all.
On the community version of GitHub, the traffic values of your repositories are to be found at tab Insights, option
Traffic.
Note that GitHub provides values on a 2-week time range only.
This implies that you have to pick and store these values quite regularly, e.g., every month;
as far as we know, data older than two weeks are permanently lost.
