README.md

analytics-dashboard

Standalone project which shows how you can use the D3 Javascript library to create visualizations for Spring XD counters.

Running the App

To provide some data for appliation, start the XD server and then execute the following commands in the XD shell.

NOTE: We're using twitterstream as a source which assumes the twitterstream module configuration $XD_MODULE_CONFIG_LOCATION/source/twitterstream/twitterstream.properties is correctly populated with valid keys.

A count of tweet's language. The incoming JSON data from the twitter stream has this information located under the field named lang. This is done using the Field Value Counter sink. The name of the counter default to the name of the stream, 'tweetlang'

The number of tweets pre-aggregated into minute, hour, day, month and year time buckets. This information is used to show the graph of tweets per minute in the UI and is based on the Aggregate Counter sink.

A count of the hashtags in the tweets. The incoming JSON data from the twitter stream has this information ocated under the path entities.hashtags.text. The name of the counter is explicitly specified to be 'hashtags'.

All that's required to run the app is to serve up the public directory from a web server listening on port 9889. There are various ways you can do this. For example, you can use the Spring Boot CLI. If you have it installed, run

The page is a simple dashboard divided in half. The right hand side will show a field value counter as a bubble chart. The left is divided into two panels, one which will show a field value counter as a pie chart, and one below it for an aggregate counter bar chart. The menus are populated by querying the Spring XD admin server, which is expected to also be running on localhost. You can toggle between the different field-value counters, the one for hashtags is best displayed using a bubble chart.