This javascript tool based on the library D3, will allow you to display the features covering your sequence of DNA, protein, or others.
You will first need to create the SVG that will contains the features.
To do so, give whithin the parameters, the sequence (or length) and the div in which the features will be
display.
You can also adjust some rendering options :
The brush zoom will allow you to select a part of the sequence to zoom in.
It may happen that the div is too small to display the sequence, but a zoom will make it
appears.
To zoom out, just do a right click.
To add a feature to the SVG you have to pass an object as parameter.
This object will take :
Note 1 : In case of "line" feature, you can add 2 arrays of data within an array (e.g. data:[dataArray1,dataArray2]), and 2 colors for each data within an array (e.g. color:["#C50063","#005572"])
Note 2 : Be carefull to specify different className for each type of feature
You can listen for a click on a feature, and get the specific positions of this feature with the listener onFeatureSelected.
This method take a custom function in parameter allowing you to link this event with the rest of your application.
It is possible to fill the feature viewer with protein features from NeXtProt, the human protein database.