Commit 5f7e628c authored by Remi  PLANEL's avatar Remi PLANEL

Add type for genomeBrowserData layout callbacks

parent 516db5ff
Pipeline #12133 passed with stage
in 56 seconds
import { GenomeBrowserState, GeneData, GenomeBrowserData } from "../types";
import {
GenomeBrowserState,
GeneData,
GenomeBrowserData
} from "../types";
import { format as d3Format } from "d3-format";
import { scaleOrdinal } from "d3-scale";
import { color } from "d3";
......@@ -11,8 +15,8 @@ const geneColor = scaleOrdinal(
);
export default function genomeBrowserData(
state: GenomeBrowserState,
brushHandler: any,
clickHandler: any
brushHandler: (scale: any, state: GenomeBrowserState) => void,
clickHandler: (geneLocation: [number, number], state: GenomeBrowserState) => void
): GenomeBrowserData {
const {
window,
......
import GenomeBrowser from "../src/scripts/component/genome-browser";
import genomeBrowserDataLayout from "../src/scripts/layout/genome-browser";
import { GenomeBrowserData, GeneData } from "../src/scripts/types";
import { GenomeBrowserData, GeneData, GenomeBrowserState } from "../src/scripts/types";
import { select } from "d3-selection";
describe("Test Genome Browser", () => {
......@@ -47,10 +47,11 @@ describe("Test Genome Browser", () => {
}
}
const genomeBrowserData = genomeBrowserDataLayout(
genomeBrowserState,
() => console.log("brush"),
() => console.log("click")
(scale, state: GenomeBrowserState) => console.log(scale),
(geneLocation, state: GenomeBrowserState) => console.log(geneLocation)
);
const data: GenomeBrowserData[] = [genomeBrowserData];
document.body.innerHTML =
......
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