openVectorEditor
Congrats, you've made it to the repo for Teselagen's Open Source Vector Editor Component
Built With React & Redux
Built for easy extensibility + embed-ibility
Using this module in React
Installation (react)
yarn add install-peerdeps open-vector-editor
Add peer-dependencies:
install-peerdeps open-vector-editor --dev --only-peers
Code (react)
Require the following components like:
import {Editor, RowView} from "open-vector-editor
Editor
The <Editor {...editorProps}/>
component gives you a full blown editor.
It takes in a list of editorProps as detailed below.
CircularView/CircularViewUnconnected
This gives you just the circular/plasmid map view. Either redux connected or unconnected (non-interactive)
LinearView/LinearViewUnconnected
This gives you just the linear map view. Either redux connected or unconnected (non-interactive)
RowView/RowViewUnconnected
This gives you just the detailed view of the sequence rows. Either redux connected or unconnected (non-interactive)
EnzymeViewer
A component used for viewing enzymes
Using this module outside of react apps (Universal):
The universal build can be used in any app with or without react. It corresponds to using the
Installation (Universal)
via npm:
npm install open-vector-editor
then add the links
Or via CDN:
Code (Universal)
editorProps
These props consist of hooks and editor config options that can be passed like so: <Editor {...editorProps}/>
or as seen above like window.createVectorEditor(yourDomNodeHere, editorProps);
editorState
These are the options to the updateEditor()
action (the most generic redux action we have)) and will cause the editor state stored in redux to be updated. Only the subset of options that are passed will be updated.
Data Model
The data model can be interactively inspected by installing the redux devtools for your browser: devtools
Here is the top level editor state:
Example Editor State
Alignments
Integrating your own alignment data (only necessary if not using the built in alignment creation tool)
Add a panel to the panelsShown prop like so:
After calling editor.updateEditor(...)
call
Data Model
Note: alignmentData.sequence
is assumed to be the same length for EVERY track within an alignemnt run!
alignmentData
can contain "-" characters, whereas sequenceData should not. Sequence Data is the "raw" data of the sequence being aligned with features/parts/etc.
Chromatogram Data
"chromatogramData": { //only if parsing in an ab1 file
"aTrace": [], //same as cTrace but for a
"tTrace": [], //same as cTrace but for t
"gTrace": [], //same as cTrace but for g
"cTrace": [0,0,0,1,3,5,11,24,56,68,54,30,21,3,1,4,1,0,0, ...etc], //heights of the curve spaced 1 per x position (aka if the cTrace.length === 1000, then the max basePos can be is 1000)
"basePos": [33, 46, 55,], //x position of the bases (can be unevenly spaced)
"baseCalls": ["A","T", ...etc],
"qualNums": [],
},
Development:
Prerequisites
Node.js >= v4 must be installed.
Installation
yarn
yarn start