@apptane/react-ui-charts
Version:
Chart components in Apptane React UI framework
50 lines (49 loc) • 1.74 kB
TypeScript
/// <reference types="react" />
import { Color } from "@apptane/react-ui-core";
import { ScaleLinear } from "d3-scale";
import { Datum, Domain, DomainXValue } from "../common/Types.js";
import { ChartData } from "../parts/ChartDataContext.js";
import { XYChartBand, XYChartPanePropsBase, XYChartPanePropsEx, XYChartValue } from "./XYChart.types.js";
export declare type XYComputedValue = {
index: number;
stackedY: number;
c?: {
x: number;
y: number;
v: number;
};
};
export declare type XYComputedBand = {
index: number;
c?: {
x: number;
y0: number;
y1: number;
};
};
export declare type XYChartValueEx<X extends DomainXValue> = XYChartValue<X, number> & XYComputedValue;
export declare type XYChartBandEx<X extends DomainXValue> = XYChartBand<X, number> & XYComputedBand;
export declare type XYDatumEx<X extends DomainXValue, Data = void> = Datum<Data> & {
index: number;
color: Color;
areaColor: Color;
loColor: Color;
hiColor: Color;
gradientId: string;
pri: XYChartValueEx<X>[];
sec?: XYChartValueEx<X>[];
bands?: XYChartBandEx<X>[];
};
/**
* Generates puzzle pieces for XY pane with numeric range.
*/
export declare function useXYPaneData<X extends DomainXValue, Data = void>(context: ChartData<X>, props: XYChartPanePropsBase<X, number, Data> & XYChartPanePropsEx<X>): [
XYDatumEx<X, Data>[] | undefined,
Domain<X> | undefined,
ScaleLinear<number, number> | undefined,
React.ReactNode[]
];
/**
* Default formatting function for numeric values in the tooltip.
*/
export declare function formatNumericTooltip(v: number, lb?: number, ub?: number): string;