-
Notifications
You must be signed in to change notification settings - Fork 51
Creating new track types
Peter Kerpedjiev edited this page Apr 5, 2017
·
1 revision
To create new track types, there are a number of methods that need to be implemented:
Render this track to the SVG or Pixi canvas.
These methods are not strictly required but may cause problems with certain functionality if not implemented.
This method should return a string version of the SVG representation of this track. This is required for exporting and is not rendered.
Example: (from HeatmapTiledPixiTrack.js
)
exportSVG() {
let svg = '<g>'
for (let tile of this.visibleAndFetchedTiles()) {
//console.log('sprite:', tile.canvas.toDataURL());
let rotation = tile.sprite.rotation * 180 / Math.PI;
svg += `<g
transform="translate(${tile.sprite.x}, ${tile.sprite.y})rotate(${rotation})scale(${tile.sprite.scale.x},${tile.sprite.scale.y})"
>`;
svg += '<image xlink:href="' + tile.canvas.toDataURL() + '"/>';
svg += "</g>";
}
svg += '</g>';
return svg;
}
- Adding a new track
- Resizing a view
- Adding and removing views
- Replacing tracks
- Changing a heatmap's colormap
- Adding track labels
- Adding new views
- Closing views
- View synchronization
- View linking
- Syncing and linking
- Exporting and sharing