Commit 97741a58 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Format code

parent 2203c674
...@@ -4,7 +4,7 @@ import { arrowShape } from "./gene-shapes"; ...@@ -4,7 +4,7 @@ import { arrowShape } from "./gene-shapes";
import linearGene from "../../layout/linear-gene"; import linearGene from "../../layout/linear-gene";
import { of } from "rxjs"; import { of } from "rxjs";
import { mergeMap } from "rxjs/operators"; import { mergeMap } from "rxjs/operators";
import { drag } from "d3-drag";
type Strand = "+" | "-"; type Strand = "+" | "-";
export interface GeneData { export interface GeneData {
...@@ -57,19 +57,24 @@ export default function () { ...@@ -57,19 +57,24 @@ export default function () {
updateGenes.attr("transform", d => "translate(" + d.position.x + "," + d.position.y + ")"); updateGenes.attr("transform", d => "translate(" + d.position.x + "," + d.position.y + ")");
updateGenes updateGenes
.select<SVGPathElement>("path") .select<SVGPathElement>("path")
.style("fill", d => d.strand === "+" ? "darkred": "darkblue") .style("fill", d => d.strand === "+" ? "darkred" : "darkblue")
.attr( .attr(
"transform", "transform",
({ strand, position: { width } }) => (strand === "-") ({ strand, position: { width } }) => (strand === "-")
? "translate(0," + (geneHeight + 5) + ") translate(" + width + "," + geneHeight + ") rotate(180)" ? "translate(0," + (geneHeight + 5) + ") translate(" + width + "," + geneHeight + ") rotate(180)"
: null : null
) )
.attr("d", d => arrowShape(d, geneHeight)) .attr("d", d => arrowShape(d, geneHeight))
.on("click", d => of(d).pipe( .on("click", d => of(d)
mergeMap(d => of<[number, number]>([d.begin, d.end]) .pipe(mergeMap(d => of<[number, number]>([d.begin, d.end])))
) .subscribe(d.eventHandler.click)
).subscribe(d.eventHandler.click) )
.call(
drag().on("start", d => console.log(event))
.on("drag", d => console.log(event))
.on("end", d => console.log(event))
); );
;
}) })
} }
return gene; return gene;
......
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