Skip to content

Getting Started

Andrew Wilkey edited this page Apr 9, 2019 · 3 revisions

What you need to know about getting started with CViTjs

Table of Contents

Install

Before doing anything, install CViTjs. This process installs the remaining dependencies required by the tool, and builds a minimized script to deliver to the browser. CViTjs has been tested to work with IE9+, Safari, Firefox and Chrome, and should work without issues in any browser older than IE10.

Setup

CViTjs requires three components to display a dataset, a cvit.conf (usually) in the root directory of the library, gff3 file with the data to display, and a configuration file for the glyphs you want to display.

CViTjs uses fetch under the hood to obtain the files, so there is no strict requirement to use a file local to your server, provided your origin rules allow for it.

For further information on configuring theses files, please see their respective entries in this wiki.

Controlling the display

CViT defaults to displaying the view pointed to by the data_default configuration under [general] in the cvit.conf. However, there are multiple ways to change which files are viewed, starting with the HTML data- attribute,which can pass several flags. For example to pass configuration target:

<div class="container" id="cvit-app" data-tag="test2" />

The data- tag isn't the only control method, as the view can be manipulated with a query string. The above data attribute is the same as:

http://cvitpage/?data=test2

When determining which data to display, the following priority is used: data-tag='tag' > url/?data=tag > cvit.conf

Similarly, the default gff files can be overridden in both the URL and the HTML. Like their configuration counterpart, this may be a single file, or an array of files.

<div class="container" id="cvit-app" data-gff="test1.gff" />

-or-

<div class="container" id="cvit-app" data-gff='["backbone.gff","test2.gff"]' />

Other data- tags are:

Tag Query Equivalent Description
data-tag data= select a specific tag
data-gff gff= or gff[]= (array) one or more gff files to use as base data
data-config config= configuration file to use for dataset
data-cvitroot not used path prefix if files aren't in the root folder of the page.
Clone this wiki locally