Commit 9f901ffc authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Put the style in the css

parent 66ebea22
...@@ -36,37 +36,35 @@ export default function () { ...@@ -36,37 +36,35 @@ export default function () {
_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<SVGGElement, GenomeBrowserData>("g.genome-browser") .selectAll<SVGElement, GenomeBrowserData>(".genome-browser")
.data(_data); .data(_data);
//ENTER //ENTER
const genomeBrowerE = genomeBrowser const genomeBrowserE = genomeBrowser
.enter() .enter()
.append<SVGGElement>("g") .append<SVGElement>("g")
.classed("genome-browser", true); .classed("genome-browser", true);
genomeBrowerE.append("rect") genomeBrowserE.append("rect")
.classed("genome-browser-background", true) .classed("genome-browser-background", true);
.style("fill-opacity", 0);
genomeBrowerE.append("g").classed("axis", true); genomeBrowserE.append("g").classed("axis", true);
genomeBrowerE.append("g").classed("genes", true); genomeBrowserE.append("g").classed("genes", true);
//EXIT //EXIT
genomeBrowser.exit().remove(); genomeBrowser.exit().remove();
//UPDATE //UPDATE
const genomesBrowserU = genomeBrowser.merge(genomeBrowerE); const genomesBrowserU = genomeBrowser.merge(genomeBrowserE);
genomesBrowserU genomesBrowserU
.select<SVGRectElement>("rect.genome-browser-background") .select<SVGRectElement>("rect.genome-browser-background")
.attr("width", width) .attr("width", width)
.attr("height", height) .attr("height", height).call(
.call(
drag<SVGRectElement, GenomeBrowserData>() drag<SVGRectElement, GenomeBrowserData>()
.on("start", d => { .on("start", (d: GenomeBrowserData) => {
if (d.eventHandler) { if (d.eventHandler) {
console.log(this);
d.eventHandler.dragstarted(this); d.eventHandler.dragstarted(this);
} }
}) })
......
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