index.ts 545 Bytes
Newer Older
1
import GeneComponent, { GeneData } from "./component/sequence/gene";
Remi  PLANEL's avatar
Remi PLANEL committed
2
3
4
import { select, Selection } from "d3-selection";
const genes = [
    { name: "gene 1", length: 1000, strand: 1 },
Remi  PLANEL's avatar
Remi PLANEL committed
5
6
7
8
9
    { name: "gene 2", length: 500, strand: -1 },
    { name: "gene 3", length: 500, strand: 1 },
    { name: "gene 4", length: 20, strand: 1 },
    { name: "gene 3", length: 250, strand: -1 },

Remi  PLANEL's avatar
Remi PLANEL committed
10
11
12
13
14
]

const geneComponent = GeneComponent();


15
const myGenes = select<SVGGElement, Array<GeneData>>("g#genes");
Remi  PLANEL's avatar
Remi PLANEL committed
16

Remi  PLANEL's avatar
Remi PLANEL committed
17
myGenes.datum(genes).call(geneComponent, 1000, 10, 50);
Remi  PLANEL's avatar
Remi PLANEL committed
18