Commit fc57a899 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Put negative strand on a different line that positive strand.

parent f5137deb
...@@ -57,11 +57,11 @@ export default function () { ...@@ -57,11 +57,11 @@ 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", "lightgrey") .style("fill", d => d.strand === "+" ? "indianred": "steelblue")
.attr( .attr(
"transform", "transform",
({ strand, position: { width } }) => (strand === "-") ({ strand, position: { width } }) => (strand === "-")
? "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))
......
...@@ -44,7 +44,7 @@ const genes: Array<GeneData> = [ ...@@ -44,7 +44,7 @@ const genes: Array<GeneData> = [
function draw(centerGenome: number) { function draw(centerGenome: number) {
const svg = select<SVGSVGElement, any>("svg").attr("width", width + 100).attr("height", 900); const svg = select<SVGSVGElement, any>("svg").attr("width", width + 1).attr("height", 900);
const genomeAxisElem = svg.select<SVGElement>("#axis"); const genomeAxisElem = svg.select<SVGElement>("#axis");
const geneElem = svg.select<SVGElement>("#genes"); const geneElem = svg.select<SVGElement>("#genes");
genomeAxisElem genomeAxisElem
......
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