Pluggable Track Register Tool for HiGlass
If you develop pluggable tracks for HiGlass please use this simple tool to register your tracks.
Note, higlass-register
is nothing more than an agreed way of exposing plugins to HiGlass. You could circumvent higlass-register
but then you'll have to take of staying up to date with the plugin registration process yourself.
npm install --save-dev higlass-register
To register your track as a plugin
import register from 'higlass-register';
import MyFancyNewHiGlassTrack from './MyFancyNewHiGlassTrack';
register(
{
track: MyFancyNewHiGlassTrack,
config: MyFancyNewHiGlassTrack.config,
},
{
// Set to `true` if you want to override previously registered track that
// define the same track type.
force: false
}
);
Take a look at HiGlass GeoJSON Track for how to write a pluggable track.
To register your data fetcher as a plugin
import register from 'higlass-register';
import MyFancyNewHiGlassDataFetcher from './MyFancyNewHiGlassDataFetcher';
register(
{
dataFetcher: MyFancyNewHiGlassDataFetcher,
config: MyFancyNewHiGlassDataFetcher.config,
},
{
// The default pluginType is 'track', so specify 'dataFetcher' here.
pluginType: 'dataFetcher',
// Set to `true` if you want to override previously registered data fetcher that
// define the same data fetcher type.
force: false
}
);