td-plots 1.7.1 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BoxPlot.d.ts +32 -0
- package/dist/components/LegendUtils.d.ts +10 -0
- package/dist/components/LinePlot.d.ts +24 -0
- package/dist/components/PairedComparisonsBoxPlot.d.ts +22 -0
- package/dist/components/StatsDonut.d.ts +2 -1
- package/dist/components/SummaryComparisonPlot.d.ts +30 -0
- package/dist/components/Utils.d.ts +3 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.esm.js +769 -15
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +773 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PlotParams } from "react-plotly.js";
|
|
3
|
+
import "./plotStyles.scss";
|
|
4
|
+
interface BoxPlotDataSummary {
|
|
5
|
+
lowerWhisker: number;
|
|
6
|
+
q1: number;
|
|
7
|
+
median: number;
|
|
8
|
+
q3: number;
|
|
9
|
+
upperWhisker: number;
|
|
10
|
+
mean?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface BoxPlotDataTrace {
|
|
13
|
+
label: string;
|
|
14
|
+
values: number[] | BoxPlotDataSummary;
|
|
15
|
+
color?: string;
|
|
16
|
+
fill?: "auto" | "none";
|
|
17
|
+
y?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface BoxPlotProps {
|
|
20
|
+
data: BoxPlotDataTrace[];
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
title?: string;
|
|
24
|
+
plotId?: string;
|
|
25
|
+
xAxisTitle?: string;
|
|
26
|
+
yAxisTitle?: string;
|
|
27
|
+
containerStyleOverrides?: React.CSSProperties;
|
|
28
|
+
extraLayoutConfig?: Partial<PlotParams["layout"]>;
|
|
29
|
+
}
|
|
30
|
+
declare const BoxPlot: (props: BoxPlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function isBoxPlotDataSummary(value: any): value is BoxPlotDataSummary;
|
|
32
|
+
export default BoxPlot;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type BoxProps = {
|
|
2
|
+
color: string;
|
|
3
|
+
boxStyle: "filled" | "outlined" | "shaded";
|
|
4
|
+
};
|
|
5
|
+
export type LegendItemProps = {
|
|
6
|
+
label: string;
|
|
7
|
+
color: string;
|
|
8
|
+
boxStyle: "filled" | "outlined" | "shaded";
|
|
9
|
+
};
|
|
10
|
+
export declare const LegendBoxPlotItem: (props: LegendItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PlotParams } from "react-plotly.js";
|
|
3
|
+
import "./plotStyles.scss";
|
|
4
|
+
export interface LinePlotDataTrace {
|
|
5
|
+
x: number[] | Date[];
|
|
6
|
+
y: number[];
|
|
7
|
+
label?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LinePlotProps {
|
|
11
|
+
data: LinePlotDataTrace[];
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
title?: string;
|
|
15
|
+
plotId?: string;
|
|
16
|
+
xAxisTitle?: string;
|
|
17
|
+
yAxisTitle?: string;
|
|
18
|
+
containerStyleOverrides?: React.CSSProperties;
|
|
19
|
+
extraLayoutConfig?: Partial<PlotParams["layout"]>;
|
|
20
|
+
additionalContextTrace?: Partial<PlotParams["data"]>[0];
|
|
21
|
+
additionalYAxis?: Partial<PlotParams["layout"]>["yaxis2"];
|
|
22
|
+
}
|
|
23
|
+
declare const LinePlot: (props: LinePlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default LinePlot;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./plotStyles.scss";
|
|
3
|
+
import { BoxPlotDataTrace } from "./BoxPlot";
|
|
4
|
+
export interface PairedComparisonsBoxPlotGroup {
|
|
5
|
+
groupLabel: string;
|
|
6
|
+
boxes: BoxPlotDataTrace[];
|
|
7
|
+
color?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PairedComparisonsBoxPlotProps {
|
|
10
|
+
groups: PairedComparisonsBoxPlotGroup[];
|
|
11
|
+
pairLabels: string[];
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
title?: string;
|
|
15
|
+
xAxisTitle?: string;
|
|
16
|
+
yAxisTitle?: string;
|
|
17
|
+
containerStyleOverrides?: React.CSSProperties;
|
|
18
|
+
showLegend?: boolean;
|
|
19
|
+
plotId?: string;
|
|
20
|
+
}
|
|
21
|
+
declare const PairedComparisonsBoxPlot: (props: PairedComparisonsBoxPlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export default PairedComparisonsBoxPlot;
|
|
@@ -10,4 +10,5 @@ export type StatsDonutProps = {
|
|
|
10
10
|
legendPosition?: "right" | "bottom";
|
|
11
11
|
containerStyle?: React.CSSProperties;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
declare const StatsDonut: (props: StatsDonutProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default StatsDonut;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
type SummaryComparisonData = {
|
|
2
|
+
comparedMedian?: number;
|
|
3
|
+
summarizedMin?: number;
|
|
4
|
+
summarizedMax?: number;
|
|
5
|
+
summarizedMean?: number;
|
|
6
|
+
};
|
|
7
|
+
type SummaryComparisonGroup = {
|
|
8
|
+
groupLabel: string;
|
|
9
|
+
data: SummaryComparisonData;
|
|
10
|
+
color?: string;
|
|
11
|
+
};
|
|
12
|
+
export type SummaryComparisonPlotProps = {
|
|
13
|
+
groups: SummaryComparisonGroup[];
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
title?: string;
|
|
17
|
+
xAxisTitle?: string;
|
|
18
|
+
yAxisTitle?: string;
|
|
19
|
+
containerStyleOverrides?: React.CSSProperties;
|
|
20
|
+
plotId?: string;
|
|
21
|
+
tooltipPosition?: "left" | "right";
|
|
22
|
+
startXAxisAtZero?: boolean;
|
|
23
|
+
};
|
|
24
|
+
declare const SummaryComparisonPlot: (props: SummaryComparisonPlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default SummaryComparisonPlot;
|
|
26
|
+
export declare const SummaryComparisonPlotLegend: ({ comparedDataLabel, summarizedDataLabel, color, }: {
|
|
27
|
+
comparedDataLabel: string;
|
|
28
|
+
summarizedDataLabel: string;
|
|
29
|
+
color?: string;
|
|
30
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,3 +11,6 @@ export declare const roundToNextDay: (timestamp: number) => string;
|
|
|
11
11
|
export declare const roundToPrevDay: (timestamp: number) => string;
|
|
12
12
|
export declare const plotlyMToMilliseconds: (mString: string) => number;
|
|
13
13
|
export declare const convertDateDescriptionToTimestamp: (startValue: string | number) => number;
|
|
14
|
+
export declare const colorToRGBA: (color: string, opacity: number) => string;
|
|
15
|
+
export declare const computeMedian: (data: number[]) => number;
|
|
16
|
+
export declare const computeQuartile: (data: number[], quartile: 1 | 2 | 3) => number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import "./components/plotStyles.scss";
|
|
2
|
-
export { HistogramPlot } from "./components/Histogram";
|
|
2
|
+
export { default as HistogramPlot } from "./components/Histogram";
|
|
3
3
|
export type { HistogramPlotProps } from "./components/Histogram";
|
|
4
|
-
export { RadialHistogramPlot } from "./components/RadialHistogram";
|
|
4
|
+
export { default as RadialHistogramPlot } from "./components/RadialHistogram";
|
|
5
5
|
export type { RadialHistogramPlotProps } from "./components/RadialHistogram";
|
|
6
|
-
export { StatsDonut } from "./components/StatsDonut";
|
|
6
|
+
export { default as StatsDonut } from "./components/StatsDonut";
|
|
7
7
|
export type { StatsDonutProps } from "./components/StatsDonut";
|
|
8
|
+
export { default as PairedComparisonsBoxPlot } from "./components/PairedComparisonsBoxPlot";
|
|
9
|
+
export type { PairedComparisonsBoxPlotProps } from "./components/PairedComparisonsBoxPlot";
|
|
10
|
+
export { default as BoxPlot } from "./components/BoxPlot";
|
|
11
|
+
export type { BoxPlotProps } from "./components/BoxPlot";
|
|
12
|
+
export { default as SummaryComparisonPlot } from "./components/SummaryComparisonPlot";
|
|
13
|
+
export type { SummaryComparisonPlotProps } from "./components/SummaryComparisonPlot";
|
|
14
|
+
export { SummaryComparisonPlotLegend } from "./components/SummaryComparisonPlot";
|
|
15
|
+
export { default as LinePlot } from "./components/LinePlot";
|
|
16
|
+
export type { LinePlotProps } from "./components/LinePlot";
|
|
8
17
|
export { default as TestPlot } from "./components/TestPlot";
|
|
9
18
|
export { isDateArray, isNumberArray } from "./components/Utils";
|
|
10
19
|
export type { PlotParams } from "react-plotly.js";
|