0.2.2 • Published 5 years ago

@yapv/canvas v0.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@yapv/canvas

Build Status lerna npm version

Renders the plasmid map in an HTML5 Canvas, re-rendering on every draw request.

Usage

import YAPV from '@yapv/core';
import Canvas from '@yapv/canvas';

const data = { ... }
const workspace = document.querySelector('#workspace');
// Attaches the viewer to the HTML element with the specified selector
const plasmidViewer = YAPV.create(workspace);
// Use the Canvas renderer
plasmidViewer.use(Canvas.circular);
// Draw it!
plasmidViewer.draw(data);

The 'data' instance is a JS object that conforms to the schema specified here. There are several sample files you can use as a reference.