synapse-react-client
Version:
[](https://travis-ci.com/Sage-Bionetworks/Synapse-React-Client) [](https://badge.fury.io/js/synaps
41 lines (40 loc) • 1.37 kB
TypeScript
import * as React from 'react';
import { ProjectFilesStatisticsRequest, ProjectFilesStatisticsResponse, FilesCountStatistics } from '../utils/synapseTypes/';
export declare type StatisticsPlotProps = {
request: ProjectFilesStatisticsRequest;
title?: string;
xtitle?: string;
ytitle?: string;
isHorizontal?: boolean;
xaxistype?: string;
showlegend?: boolean;
};
declare type StatisticsPlotState = {
isLoaded: boolean;
plotData?: ProjectFilesStatisticsResponse;
};
declare class StatisticsPlot extends React.Component<StatisticsPlotProps, StatisticsPlotState> {
static contextType: React.Context<import("../utils/SynapseContext").SynapseContextType | undefined>;
constructor(props: StatisticsPlotProps);
componentDidMount(): void;
/**
* Get data for plotly
*
* @returns data corresponding to plotly widget
*/
fetchPlotlyData: () => Promise<void>;
getTrace: (traceName: string, stats: FilesCountStatistics[], orientation: string, markerColor: string) => {
orientation: string;
x: string[];
y: number[];
name: string;
type: string;
marker: {
color: string;
};
hovertemplate: string;
};
showPlot: () => JSX.Element | undefined;
render(): JSX.Element | null | undefined;
}
export default StatisticsPlot;