GithubHelp home page GithubHelp logo

millingw / visualisation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softwaresaved/visualisation

0.0 1.0 0.0 922 KB

Web-based visualisation of Institute data.

Home Page: http://softwaresaved.github.io/visualisation

License: GNU General Public License v2.0

CSS 3.85% HTML 14.10% JavaScript 62.60% Python 19.45%

visualisation's Introduction

Software Sustainability Institute web-based data visualisation

Visualisations of The Software Sustainability Institute data.

To view, visit http://softwaresaved.github.io/visualisation.


Get source code

Fork and clone this repository

  • Sign in to GitHub.
  • Fork this repository into your account.
  • Clone your fork onto your computer:
$ git clone http://[email protected]/USERNAME/visualisation.git
$ git remote add ssi  http://[email protected]/softwaresaved/visualisation.git

Get Python 3

The Anaconda version of Python is recommended.


Install Google Client library

$ pip install --upgrade google-api-python-client

View visualisations within GitHub pages

GitHub pages renders web site content in gh-pages branches of repositories hosted on GitHub.

When you push changes to the gh-pages branch of your cloned repository on GitHub, you can view the web site at http://USERNAME.github.io/visualisation/


View visualisations within Python web server

Some browsers (e.g. Google Chrome) won't render JavaScript in HTML that is loaded into the browser via, for example, a file:// URL.

Python 3 has a simple web server you can use to serve the pages. To start the web server:

$ cd visualisation
$ python -m http.server

Visit http://localhost:8000/ to see the visualisations index.html page.


Deploy under Apache 2 web server

Apache is a popular web server.

  • Note: These instructions assume the use of Apache 2.4 web server. Other versions of Apache 2, particularly Apache 2.2, differ in how they are installed, configured and managed. Consult the relevant documentation for your version of Apache 2.

These instructions assume you have sudo access to install and configure software (or a local system administrator can do this for you):

$ sudo su -

Install Apache 2 on Ubuntu 14.04.3 LTS Trusty Tahr

Install:

$ apt-get install -y apache2 apache2-utils
$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jan 14 2016 17:45:23
$ service apache2 status
 * apache2 is running

Install Apache 2 on Scientific Linux 6.6 (Carbon)

Install:

$ apt-get install -y httpd
$ /usr/sbin/httpd -v
Server version: Apache/2.2.15 (Unix)
Server built:   Aug 24 2015 11:20:01
$ chkconfig httpd on
$ /etc/init.d/httpd status
httpd (pid  18161) is running...

Install Apache 2 on Scientific Linux 7.1 (Nitrogen)

Install:

$ apt-get install -y httpd
$ /usr/sbin/httpd -v
Server version: Apache/2.4.6 (Scientific Linux)
Server built:   Jul 23 2014 05:03:32
$ systemctl restart httpd.service
$ systemctl status httpd.service
$ systemctl enable httpd.service
$ systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since Mon 2016-03-07 13:02:03 GMT; 19s ago
n Main PID: 14675 (httpd)

Clone this repository

Clone:

$ cd /var/www/html
$ git clone https://github.com/softwaresaved/visualisation

Set permissions

  • For Ubuntu:
$ chown -R www-data:www-data visualisation
  • For Scientific Linux:
$ chown -R apache:apache visualisation

View visualisations

Visit http://127.0.0.1/visualisation/


Update Institute data

Create Google API project:

Enable Google Sheets API:

  • Select your project.
  • Click + ENABLE API
  • Click Sheets API
  • Click ENABLE

Create OAuth2 credentials:

  • Click Credentials
  • Click Create credentials
  • Select OAuth client id
  • Click Configure consent screen
  • Enter
    • E-mail address: [email protected]
    • Product name shown to users: SSI visualisation scripts
  • Select Application type: Other
  • Name: SSI visualisation scripts downloader
  • Click download icon to download JSON.
  • Save as client_secret.json in the visualisation directory.

Download consultancy data:

$ python src/download_consultancy_data.py

Download Software Carpentry data:

$ python swc/download_swc.py

Download policy data:

$ python swc/download_policy.py

The first time you run one of these scripts, a browser will appear and you will be prompted for your Google username and password (if not already logged in) and then asked to allow the program access to your Google Sheets.


JavaScript development

Browser developer tools:

  • Google Chrome: CTRL+SHIFT+J opens Web Console and Debugger.
  • Mozilla Firefox: CTRL+SHIFT+K opens Web Console and Debugger.

Comments:

  • jsdoc is used for commenting JavaScript.

Logging:

  • console.log(...) outputs to browser Web console.

Copyright and licence


Third-party code

Google Sheet and OAuth2 Python example

Bootstrap 3.3.6

D3 4.2.1

D3 bar chart

D3 horizontal bar chart (bar chart IIc)

D3 pie chart

D3 circle packing

jQuery 2.2.1

  • http://jquery.com/
  • Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors
  • Licence: MIT license
  • Local code: js/jquery.js, js/jquery.min.js

Underscore 1.8.3

  • http://underscorejs.org
  • Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  • Licence: MIT license
  • Local code: js/underscore.js, js/underscore-min.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.