Skip to content
Wesley Ingwersen edited this page Sep 18, 2020 · 8 revisions

Pre-Build

In order to build and test the USEEIO widgets you need to have a current version of Node.js installed. Make sure that the node and npm commands are available in your systems path (you can test this via node -v and npm -v on the command line which should give you the respective version of these tools).

Build

The first step is then to install the build tools and dependencies:

cd useeio-widgets
npm install

You can build the widget libraries via:

npm run build

This should create a build folder with a lib sub-folder containing a small JavaScript library for each widget.
You will receive some warning messages that can be ignored.

View the Widgets

Once built, the build folder contains example HTML files that demonstrate the usage of these widgets.

To view these examples locally, you'll need some data that you can download from an instance of the USEEIO API via the following command (add your API key):

cd useeio-widgets
npm run download -- --endpoint https://path/to/api --apikey an-optional-api-key

Request a USEEIO API key

This will mirror the static data of that API into the build/api folder.

You can then start a server that hosts the examples with data using the following command:

npm run server

This will give you one or more URLs on your local machine that you can copy and paste into your browser and load. Once loaded, you should see the index page with links to the examples.

Widget Documentation

   Impact chart

Clone this wiki locally