Git Product home page Git Product logo

jsds's Introduction

JavaScript in Data Science

A set of demos and training presentations on using JavaScript from a data science perspective.

This started as a rewrite of an R-Shiny project that had no analytical code: it was pure web development, but done without any of the resources or tooling normally available to web developers. That made it painful.

It is intended to help data scientists, who often use only R and/or Python, to do things like create data visualisations directly in JavaScript. If the data science project is intended to be presented to the end user in a web browser, doing it in JavaScript is often better and easier than having to rely on indirect tools like Shiny (some simple use-cases excepted...).

Each stage in this project tackles distinct techniques or processes used in building common data science / data visualisation websites.

It may require a bit of extra work (i.e. learning another language), but this should be repaid in many ways, such as more choice of tools and better performance.

As a bonus to data scientists, in section 8 there's a bit of a taster on how it is possible to do real data science in JavaScript: machine learning, neural networks. Not that you should - but in some instances, you can...

This is a work in progress, so documentation and demos are being added to keep up with the regular schedule

0. Servers

What do they do?

Naturally, the server runs in JavaScript - either using the Express framework, or as a basic no-dependency simple server.

There is also a Python Flask server, in case you don't have node.js installed.

Demos:

  • getting data from the server using AJAX
  • sending data using POST
  • two-way communications between browser and server using websockets
  • demonstrating how the server can set cookies in the browser
  • how the server can run Python or R scripts

Note: the demos are intended to run with the full, Express, server (main_server.js) - not all examples have code supporting them in the basic servers.

1. Get data

Introduction to async programming

This has to cover some of the background first, so it takes a while to get to the basics. It may be a bit long/irrelevant - in which case it can be shortened...

2. Wrangle data

The joys of JSON

3. More data wrangling

tidy data in JavaScript

4. Data visualisation

graphing/charting

5. Data visualisation

network graphing

6. Maps

How to display geographic data

7. Building web pages

HTML, CSS frameworks, etc.

8. Odds and ends

This is the fun stuff involving ML/AI

Some reading material to get you started

Installation

This repo doesn't have any dependencies included, so you will have to install these before running:

cd /path/to/jsds/
npm install

and/or - for Python:

pip install Flask

It may be a good idea to also have R installed on your computer for any R-based examples.

Running

This is set up to run from a node.js + express server:
node index.js (do this in a terminal window!)

However, for those who cannot use npm (i.e. because their machine is behind a firewall), there is a minimal server:
node simple_server.js

or, if you prefer, a Python equivalent using Flask:
python simple_server.py

For completeness, if you were to run this from a traditional LAMP setup, the ajax calls for the ICED demo can use the php script get_data.php

The actual tutorial files are in ./static/presentation/ - these will run without the need for any server - just open them in your browser (double-click on them...)

There are a few other demos within this that are designed to run with a server. Once you launch the server and go to the page it is running under e.g. http://localhost:3000 for the express version, you will see links to these.

These demos mostly have only a minimal UI as they are designed to output to the developer tools console, or the server console for some examples.

jsds's People

Contributors

andreasharding avatar

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.