Commit 11c41956 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

Format the selectedChromosome interval values

parent 9b7af3ff
...@@ -3,12 +3,12 @@ import { select, event } from "d3-selection"; ...@@ -3,12 +3,12 @@ import { select, event } from "d3-selection";
import { scaleOrdinal } from "d3-scale"; import { scaleOrdinal } from "d3-scale";
import GenomeBrowser from "./component/genome-browser"; import GenomeBrowser from "./component/genome-browser";
import { color } from "d3"; import { color } from "d3";
import { format as d3Format } from "d3-format";
import { schemeSet1, schemeDark2, schemeCategory10 } from "d3-scale-chromatic"; import { schemeSet1, schemeDark2, schemeCategory10 } from "d3-scale-chromatic";
const width = 1500; const width = 1500;
const height = 300; const height = 300;
const genomeBrowserComponent = GenomeBrowser(); const genomeBrowserComponent = GenomeBrowser();
const geneColor = scaleOrdinal( const geneColor = scaleOrdinal(
// schemeDark2 // schemeDark2
// schemeCategory10 // schemeCategory10
...@@ -129,7 +129,7 @@ function getGenomeBrowserData(state: State) { ...@@ -129,7 +129,7 @@ function getGenomeBrowserData(state: State) {
chromosome: { title: chromosomeTitle }, chromosome: { title: chromosomeTitle },
selectedChromosome: { title: selectedChromosomeTitle } selectedChromosome: { title: selectedChromosomeTitle }
} = state; } = state;
const intervalFormatter = d3Format(".3s");
// Callback when brushed => modify data and redraw the genome + axis // Callback when brushed => modify data and redraw the genome + axis
const brushedCallback = function (scale: any) { const brushedCallback = function (scale: any) {
if (!event.sourceEvent) return; if (!event.sourceEvent) return;
...@@ -182,7 +182,7 @@ function getGenomeBrowserData(state: State) { ...@@ -182,7 +182,7 @@ function getGenomeBrowserData(state: State) {
}), }),
rule: { rule: {
title: selectedChromosomeTitle title: selectedChromosomeTitle
+ " [" + window[0] + ", " + window[1] + "]", + " [" + intervalFormatter(window[0]) + ", " + intervalFormatter(window[1]) + "]",
interval: window interval: window
} }
}, },
......
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