react-mutation-mapper
Version:
Generic Mutation Mapper
101 lines (100 loc) • 4.08 kB
TypeScript
import { MobxCache, Mutation } from 'cbioportal-utils';
import * as React from 'react';
import { LollipopPlotControlsConfig } from '../../model/LollipopPlotControlsConfig';
import { LollipopPlacement, LollipopSpec } from '../../model/LollipopSpec';
import { MutationMapperStore } from '../../model/MutationMapperStore';
import { TrackDataStatus, TrackName, TrackVisibility } from '../track/TrackSelector';
import './lollipopMutationPlot.scss';
import { AxisScale } from './AxisScaleSwitch';
export declare type LollipopMutationPlotProps<T extends Mutation> = {
store: MutationMapperStore<T>;
controlsConfig?: LollipopPlotControlsConfig;
pubMedCache?: MobxCache;
mutationAlignerCache?: MobxCache<string>;
getLollipopColor?: (mutations: Partial<T>[]) => string;
isPutativeDriver?: (mutation: Partial<T>) => boolean;
getMutationCount?: (mutation: Partial<T>) => number;
topYAxisSymbol?: string;
bottomYAxisSymbol?: string;
topYAxisDefaultMax?: number;
topYAxisDefaultMin?: number;
yMaxFractionDigits?: number;
yMaxLabelPostfix?: string;
showYAxis?: boolean;
yAxisSameScale?: boolean;
bottomYAxisDefaultMax?: number;
bottomYAxisDefaultMin?: number;
yAxisLabelPadding?: number;
lollipopTooltipCountInfo?: (count: number, mutations?: Partial<T>[], axisMode?: AxisScale, group?: string) => JSX.Element;
yAxisLabelFormatter?: (symbol?: string, groupName?: string) => string;
axisMode?: AxisScale;
onScaleToggle?: (selectedScale: AxisScale) => void;
customControls?: JSX.Element;
onXAxisOffset?: (offset: number) => void;
geneWidth: number;
vizHeight?: number;
trackVisibility?: TrackVisibility;
tracks?: TrackName[];
trackDataStatus?: TrackDataStatus;
showTrackSelector?: boolean;
onTrackVisibilityChange?: (selectedTrackIds: string[]) => void;
autoHideControls?: boolean;
showYMaxSlider?: boolean;
showLegendToggle?: boolean;
showDownloadControls?: boolean;
showPercentToggle?: boolean;
filterResetPanel?: JSX.Element;
legend?: JSX.Element;
loadingIndicator?: JSX.Element;
collapsePtmTrack?: boolean;
collapseUniprotTopologyTrack?: boolean;
};
export default class LollipopMutationPlot<T extends Mutation> extends React.Component<LollipopMutationPlotProps<T>, {}> {
static defaultProps: Partial<LollipopMutationPlotProps<any>>;
private mouseInPlot;
private yMaxInputFocused;
private geneXOffset;
private _trackVisibility;
private _controlsConfig;
private handlers;
private divContainer;
private get showControls();
private get trackVisibility();
private get controlsConfig();
private lollipopTooltip;
protected get groups(): string[] | undefined;
protected get lollipops(): LollipopSpec[];
protected getLollipopSpecs(mutationsByPosition: {
[pos: number]: T[];
}, countsByPosition: {
[pos: number]: number;
}, group?: string, placement?: LollipopPlacement): LollipopSpec[];
private createInitialSpecs;
private getNumLabelCandidates;
private labelOneLollipopByDefault;
private getNumLabelsToShow;
private isInvalidPosition;
private getRemainingDomains;
private createLabel;
private get domains();
private get domainColorMap();
private get domainMap();
private get proteinLength();
private sequenceTooltip;
private get sequence();
private getSVG;
get hugoGeneSymbol(): string;
get countRange(): [number, number];
get bottomCountRange(): [number, number];
constructor(props: LollipopMutationPlotProps<T>);
get yMaxSlider(): number;
get yMaxStep(): number;
get yMaxSliderStep(): number;
get bottomYMaxSlider(): number;
get bottomYMaxSliderStep(): number;
get yMaxInput(): number;
get bottomYMaxInput(): number;
private onXAxisOffset;
protected onTrackVisibilityChange(selectedTrackNames: string[]): void;
render(): JSX.Element;
}