/canvas-graph-creator

Graph creator using HTML5 canvas.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Canvas Graph Creator

Build Status Test Coverage Issue Count

Graph creator using HTML5 canvas

Building

Make sure you have Node installed.

To build the code, run the following:

# Install dependencies
npm install

# Build project to ./dist
npm run build

If you prefer using Gulp, run the following commands instead of npm run build:

# Install Gulp globally (required for Gulp to work)
npm install -g gulp

# Build project to ./dist
gulp build

Testing

Unit tests are written with Mocha (test framework) + Chai (assertion library). Unit tests can be run using the following command:

# Run unit tests
gulp test

Browser tests use the Selenium framework (requires Maven). In order for these tests to work, the app must be hosted on a server. Run the following commands:

# Before running browser tests, host the app
# Example:
npm install -g http-server
http-server ./dist --silent -p 8080 -a 0.0.0.0 &
# kill the server afterwards: fuser -k 8080/tcp

# Go to selenium test directory
cd selenium-tests/

# Run browser tests
mvn test

Development

A development server is provided with ESLint and Hot Module Replacement (HMR). HMR enables live reloading of modules as changes are made to the files.

To run the development server, run npm run dev or gulp. Navigate to http://localhost:8080/webpack-dev-server/index.html to view the app.