Commit 1521f1d3 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Put genome browser in a svg group

parent 9fa7ea91
...@@ -17,24 +17,23 @@ export default function () { ...@@ -17,24 +17,23 @@ export default function () {
const selectedChromosomeComponent = SelectedChromosome(); const selectedChromosomeComponent = SelectedChromosome();
let width = 900; let width = 900;
let genomesBrowserU: Selection<SVGElement, GenomeBrowserData, SVGElement, any> | null = null; let genomesBrowserU: Selection<SVGGElement, GenomeBrowserData, SVGElement, any> | null = null;
function genomeBrowser( function genomeBrowser(
_selection: Selection<SVGElement, Array<GenomeBrowserData>, HTMLElement, any>, _selection: Selection<SVGGElement, Array<GenomeBrowserData>, HTMLElement, any>
w: number,
height: number
) { ) {
width = w; // width = w;
_selection.each(function (_data: Array<GenomeBrowserData>) { _selection.each(function (_data: Array<GenomeBrowserData>) {
const container = select(this); const container = select(this);
const genomeBrowser = container const genomeBrowser = container
.selectAll<SVGElement, GenomeBrowserData>(".genome-browser") .selectAll<SVGGElement, GenomeBrowserData>(".genome-browser")
.data(_data); .data(_data);
//ENTER //ENTER
const genomeBrowserE = genomeBrowser const genomeBrowserE = genomeBrowser
.enter() .enter()
.append<SVGElement>("g") .append<SVGGElement>("g")
.classed("genome-browser", true); .classed("genome-browser", true);
genomeBrowserE.append("g").classed(classes.chromosomeRuler, true); genomeBrowserE.append("g").classed(classes.chromosomeRuler, true);
......
...@@ -90,9 +90,11 @@ const state: State = { ...@@ -90,9 +90,11 @@ const state: State = {
} }
const svg = select<SVGElement, any>("svg") const genomeBrowsers = select<SVGElement, any>("svg")
.attr("width", width + 1) .attr("width", width + 1)
.attr("height", height); .attr("height", height)
.append<SVGGElement>("g")
.classed("genome-browsers", true);
draw(); draw();
...@@ -114,7 +116,7 @@ function draw() { ...@@ -114,7 +116,7 @@ function draw() {
// //
const computedGenomeBrowserData: GenomeBrowserData = const computedGenomeBrowserData: GenomeBrowserData =
getGenomeBrowserData(state); getGenomeBrowserData(state);
svg genomeBrowsers
.datum([computedGenomeBrowserData]) .datum([computedGenomeBrowserData])
.call(genomeBrowserComponent, width, height); .call(genomeBrowserComponent, width, height);
......
Markdown is supported
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