Skip to content

Project Structure and Builds

Dan Rope edited this page Aug 31, 2016 · 6 revisions

Sub-Projects and Folders

  • core Primary support for Brunel Visualization
  • data The Brunel Visualization data processing engine
  • etc Examples and supporting utilities
  • lib Dependent .jars
  • service A basic web service to provide Brunel Visualization output
  • python Integration of Brunel Visualization for Jupyter
  • R Integration of Brunel Visualization for Jupyter (R)
  • scala Allows Brunel Visualization to consume data from a Spark DataFrame
  • spark-kernel Integration of Brunel Visualization for Jupyter (Toree)
  • gallery Source code for the Brunel online app

Deployment Notes

For direct Java integrations, see: SampleApp for creating D3 output, and WebDisplay as an example using these. BrunelService also contains a usage example.

Builds

Build using Gradle

Dependencies

For a complete build:

gradle build

This will build all Java (including the '.war' file), run all tests, create Javadocs, collect all required Javascript and place all of this into /brunel/out

The Brunel Server

For any non-Java integration, Brunel provides a service with a REST API that interprets the Brunel Visualization language and generates the required Javascript to display the visualization in a web browser. Any app server that supports JAX-RS should work. Simply deploy the brunel .war file. Both [Apache TomEE w/JAX-RS] (http://tomee.apache.org/apache-tomee.html) and IBM Liberty are known to work. Instructions for setting up Brunel Visualization using TomEE for a development environment are below. We are working on improving and generalizing this.

Deploying Brunel Visualization in TomEE

  1. Install [Apache TomEE w/JAX-RS] (http://tomee.apache.org/apache-tomee.html)
  2. Set local environment variables:
BRUNEL_SERVER=http://localhost:8080/brunel-service
TOMCAT_HOME=[root dir of TomEE]

Now, Gradle can be used to deploy Brunel to TomEE and start the web server:

gradle cargoRunLocal

To confirm it is working, try calling the service:

http://localhost:8080/brunel-service/brunel/interpret/d3?brunel_src=data('http%3A%2F%2Fbrunel.mybluemix.net%2Fsample_data%2FBGG%2520Top%25202000%2520Games.csv')%20chord%20x(categories)%20y(playerage)%20color(playerage)%20size(%23count)%20tooltip(%23all)&width=575&height=575

Next:

  • Explore the docs to learn more
  • Run VisualTests located in /etc to view a few Brunel syntax test examples
  • Try out BrunelPad located in /etc
  • See the /python, /R, and /spark-kernel folders for instructions on how to use Brunel with Jupyter
  • For Java integrations, explore the javadocs generated by the Gradle build in /out

Details regarding JS/CSS files and locations:

Brunel uses a mix of static, translated and generated Javascript.

  • Non-translated JS/CSS for Brunel is in /core. These are expected to be edited by developers.
  • The translated BrunelData.js is created during the build of the data project. Do not edit this file.
  • VisualTests.java (in /etc) will copy the JS/CSS upon execution so they are in the expected locations
  • Builds for /service will copy the JS/CSS in the correct locations for the .war file. Additionally, the task copyWebFiles copies the JS/CSS in the expected place for execution directly from the src.
  • Builds for /python, will copy the JS/CSS into a folder that also contains JS that is specific for the Jupyter integration