Commit 435c13d8 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Change draw fun call

parent 30ef813e
import GeneComponent, { GeneData } from "./component/sequence/gene"; import GeneComponent, { GeneData } from "./component/sequence/gene";
import GenomeAxis from "./component/sequence/genome-axis"; import GenomeAxis from "./component/sequence/genome-axis";
import { select } from "d3-selection"; import { select } from "d3-selection";
import { of } from "rxjs"; import { drag } from "d3-drag";
const width = 1500; const width = 1500;
let genomeWindowSize = 6000; let genomeWindowSize = 6000;
...@@ -47,6 +45,11 @@ const genes: Array<GeneData> = [ ...@@ -47,6 +45,11 @@ const genes: Array<GeneData> = [
} }
] ]
draw();
select("#zoom-in").on("click", function () { select("#zoom-in").on("click", function () {
genomeWindowSize -= 1000; genomeWindowSize -= 1000;
draw() draw()
...@@ -70,7 +73,7 @@ function draw() { ...@@ -70,7 +73,7 @@ function draw() {
.datum<Array<GeneData>>(genes) .datum<Array<GeneData>>(genes)
.call(geneComponent, genomeAxis.scale(), 40); .call(geneComponent, genomeAxis.scale(), 40);
} }
draw();
function getGenomeWindow(middle: number, genomeWindowSize: number): [number, number] { function getGenomeWindow(middle: number, genomeWindowSize: number): [number, number] {
const halfWindow = genomeWindowSize / 2; const halfWindow = genomeWindowSize / 2;
return [middle - halfWindow, middle + halfWindow] return [middle - halfWindow, middle + halfWindow]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment