5.0.5 • Published 4 months ago
graphgenomeviewer v5.0.5
graphgenomeviewer
Install
The graphgenomeviewer NPM module is a React component that can be installed with yarn or npm
yarn add graphgenomeviewer
Usage with React
import {Graph} from 'graphgenomeviewer'
function App() {
return (
<Graph
graph={{
nodes: [
{ id: 'id1', length: 5000 },
{ id: 'id2', length: 10000 },
],
links: [{ source: 'id1', target: 'id2', id: 'edge1' }],
}}
width={800}
height={600}
/>
)
}
or with helper that fetches a GFA file and parses it
import {GFAGraph} from 'graphgenomeviewer'
function App() {
return (
<GFAGraph
url="myfile.gfa"
width={800}
height={600}
/>
)
}
API
Here are all the props for the Graph component
function Graph({
graph,
drawPaths = false,
drawLabels = false,
colorScheme = 'Rainbow',
chunkSize = 1000,
linkSteps = 10,
sequenceThickness = 10,
linkThickness = 2,
theta = 0.9,
strengthCenter = -50,
width = 2000,
height = 1000,
onFeatureClick = () => {},
}: {
graph: Graph
drawPaths?: boolean
drawLabels?: boolean
colorScheme?: string
width?: number
height?: number
chunkSize?: number
linkSteps?: number
sequenceThickness?: number
linkThickness?: number
theta?: number
strengthCenter?: number
onFeatureClick?: (arg?: Record<string, unknown>) => void
}) {
/*...*/
}
The GFAGraph everything is the same except you use either
- a url to a GFA file supplied to the url prop
- a string of GFA data supplied to the data prop
function GFAGraph({
url,
data,
drawPaths = false,
drawLabels = false,
colorScheme = 'Rainbow',
chunkSize = 1000,
linkSteps = 10,
sequenceThickness = 10,
linkThickness = 2,
theta = 0.9,
strengthCenter = -50,
width = 2000,
height = 1000,
onFeatureClick = () => {},
}: {
url: string
data: string
drawPaths?: boolean
drawLabels?: boolean
colorScheme?: string
width?: number
height?: number
chunkSize?: number
linkSteps?: number
sequenceThickness?: number
linkThickness?: number
theta?: number
strengthCenter?: number
onFeatureClick?: (arg?: Record<string, unknown>) => void
}) {
/*...*/
}
the Graph type (used by the "Graph" component and not "GFAGraph" since GFAGraph just builds this internally is as follows
export interface Path { name: string path: string }
export interface Node { id: string sequence?: string tags?: Record<string, unknown> cigar?: string length?: number }
export interface Graph { nodes: Node[] links: Link[] paths?: Path[] }
5.0.5
4 months ago
5.0.4
11 months ago
5.0.3
11 months ago
5.0.2
12 months ago
5.0.1
12 months ago
5.0.0
12 months ago
4.0.9
1 year ago
4.0.8
1 year ago
2.2.0
1 year ago
3.0.1
1 year ago
3.0.0
1 year ago
4.0.5
1 year ago
4.0.4
1 year ago
4.0.7
1 year ago
4.0.6
1 year ago
4.0.1
1 year ago
4.0.0
1 year ago
4.0.3
1 year ago
4.0.2
1 year ago
2.1.0
2 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
5 years ago