From 66ebea220e7a2a8863fea94e33d6728ed959c53c Mon Sep 17 00:00:00 2001 From: Remi Planel <rplanel@pasteur.fr> Date: Mon, 8 Apr 2019 17:14:42 +0200 Subject: [PATCH] Pass the gene color through the data --- src/scripts/component/sequence/gene.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/scripts/component/sequence/gene.ts b/src/scripts/component/sequence/gene.ts index a4f627b..9a0e14b 100644 --- a/src/scripts/component/sequence/gene.ts +++ b/src/scripts/component/sequence/gene.ts @@ -14,7 +14,9 @@ export interface GeneData { strand: Strand, begin: number, end: number, - gene: string + gene: string, + fill?: string, + stroke?: string } export interface PositionedGeneData extends GeneData { position: { @@ -56,7 +58,11 @@ export default function () { updateGenes.attr("transform", d => "translate(" + d.position.x + "," + d.position.y + ")"); updateGenes .select<SVGPathElement>("path") - .style("fill", d => d.strand === "+" ? "darkred" : "darkblue") + .style("fill", d => d.fill || null) + .style("fill-opacity", 0.85) + .style("stroke", d => d.stroke || null) + .style("stroke-width", '1px') + .style("stroke-opacity", 0.8) .attr( "transform", ({ strand, position: { width } }) => (strand === "-") -- GitLab