TnT Board is a javascript library for displaying track-based annotations in the web. It is part of the the TnT set of visualisation libraries to display trees and/or track-based visualisations. It has been designed with a powerful API, written with flexibility in mind, that allows the creation of expressive, dynamic and powerful track-based visualisations.
TnT Board defines several elements to facilitate the creation of visualisations: a board that is a container for tracks, tracks that are independent units of data representation, data retrievers to get the data synchronously or asynchronously and visual features to display the available data.
In TnT Board, a board is an interactive container for tracks. Each panning or zoom event in the board triggers new data and visualisation updates in the attached tracks. New boards are created using the tnt.board method. Once it is created new tracks can be attached using the board.add_track method. Boards are configured via several methods that are fully explained in the API page.
As shown in the example above, the board itself is a function that when executed initialises the visualisation using the provided DOM element as its DOM container. After initialistion, the board is started, which means that each track retrieves and displays its data it. It is important to understand these three states of the visualisation:
In TnT Board, tracks are 1-dimensional independent units of data representation, which means that each track is independent from each other and defines its own way of data retrieval and representation. When it is defined, each new track selects how the data for the track is retrieved (either synchronously or asynchronously) and displayed. TnT offers predefined common displays (like rectangles, lines, areas, pins, etc) ready to use and new displays can also be created using the display interface. Composite displays are also allowed and a very powerful tool for displaying complex data. One of the main characteristics of TnT Board is the separation of concerns between data retrieval and data representation. Check the API documentation for a full list of methods available for tracks, data retrievals and displays
Examples are a fundamental part of TnT documentation. Check more in the examples page
The above example starts by defining a board that displays data from position 0 to 500, being the minimum and maximum coordinates 0 and 1000 respectively. The code also defines two tracks and each of them defines how the data is retrieved and displayed. Once defined, the tracks are attached to the board using the add_track method. The first one is a location track. The second track is 30 pixels high and displays one block from position 200 to 350 in the board. Once the board is configure the visualisation is ready to start.
TnT Board can be linked directly from the github repo. It depends on d3js and this library needs to be linked before tnt.board
It is also possible to install the source code and build the library locally. This can be achieved either by using npm or github:
TnT works on HTML5, CSS3 and SVG-compliant browser, which generally means any "modern browser". The TnT library and themes are tested regularly against Chrome (Chromium) and major changes are regularly tested in recent versions of Firefox, Safari (Webkit) and Opera. It has been also tested in IE versions 9+. If you find any problem, please let me know.
The TnT library depends on the D3.js library. Check its browser's compatibility note for more information.
Please, send any feedback to emepyc@gmail.com. Bug reports and feature requests are also welcome in the project's issue tracker