Skip to main content

useController

Home > @anocca/sequence-viewer-react-shared > useController

Will add mouse and keyboard interactions to the sequence viewer.

See: SequenceControllerRef, Annotations, DrawFunction, RenderData, CircularSelection, SelectionRange, SearchComponent

Signature:

useController: ({ isProtein, chromatogramData, clickedAnnotation, renderData, circularSelection, setCircularSelection, getCaretPosition, updateScroll, resetAngularScroll, zoomToSearchResult, draw, ref, width, height, sequence, allAnnotations, codons, Search, FilterChromatogram, openAnnotationDialog, isCircularView }: {
ref: React.ForwardedRef<SequenceControllerRef>;
width: number;
height: number;
sequence: string;
allAnnotations: Annotations;
codons: {
[k: string]: string;
};
Search?: SearchComponent | undefined;
FilterChromatogram?: FilterChromatogramType | undefined;
openAnnotationDialog?: ((annotationId: string) => void) | undefined;
draw: DrawFunction;
zoomToSearchResult: (nextViewRange: SelectionRange, zoom: boolean) => void;
resetAngularScroll?: (() => void) | undefined;
updateScroll: (deltaX: number, deltaY: number, mouseX: number, mouseY: number, shift: boolean) => void;
getCaretPosition: () => number;
renderData: React.MutableRefObject<RenderData | null>;
circularSelection: CircularSelection[];
setCircularSelection: (annotationId: undefined | string, cc: CircularSelection[]) => void;
clickedAnnotation: string | undefined;
isProtein: boolean;
chromatogramData?: ChromatogramData | undefined;
isCircularView: boolean;
}) => {
canvas: JSX.Element;
selectedAnnotations: string[];
circularSelection: CircularSelection[];
setCircularSelection: (annotationId: undefined | string, cc: CircularSelection[]) => void;
clickedAnnotation: string | undefined;
search: JSX.Element | undefined;
filterChromatogram: JSX.Element | undefined;
canvasRef: (buffer: HTMLCanvasElement | null) => void;
zoomToSearchResult: (nextViewRange: SelectionRange, zoom: boolean) => void;
setSearchResults: React.Dispatch<React.SetStateAction<SearchResult[]>>;
render: () => void;
}