@apptane/react-ui-charts
Version:
Chart components in Apptane React UI framework
38 lines (37 loc) • 1.83 kB
TypeScript
/// <reference types="react" />
import { Color } from "@apptane/react-ui-core";
import { ScaleLinear } from "d3-scale";
import { Datum, Domain, DomainType, DomainXValue, DomainYValue } from "../common/Types.js";
import { ChartData } from "../parts/ChartDataContext.js";
import { XYChartDatum, XYChartPanePropsBase, XYChartPanePropsEx, XYChartValue } from "./XYChart.types.js";
export declare type XYZComputedValue = {
index: number;
c?: {
x: number;
y: number;
d: number;
};
};
export declare type XYZChartValueEx<X extends DomainXValue, Y extends DomainYValue> = XYChartValue<X, Y> & XYZComputedValue;
export declare type XYZDatumEx<X extends DomainXValue, Y extends DomainYValue, Data = void> = Datum<Data> & {
index: number;
color: Color;
loColor: Color;
hiColor: Color;
pri: XYZChartValueEx<X, Y>[];
sec?: XYZChartValueEx<X, Y>[];
};
/**
* Generates puzzle pieces for XY pane with Z dimension.
*/
export declare function useXYZPaneData<X extends DomainXValue, Y extends DomainYValue, Data = void>(context: ChartData<X>, scaleY: (v: Y) => number | undefined, compareY: ((a: Y, b: Y) => number) | undefined, domainYType: DomainType, minDomainZ: number | undefined, maxDomainZ: number | undefined, minExtentZ: number, maxExtentZ: number, props: XYChartPanePropsBase<X, Y, Data> & XYChartPanePropsEx<X>, exact?: boolean): [
XYZDatumEx<X, Y, Data>[] | undefined,
Domain<X> | undefined,
Domain<Y> | undefined,
ScaleLinear<number, number> | undefined,
React.ReactNode[]
];
/**
* Finds bubble datum via (X,Y) coordinates.
*/
export declare function findDatum<X extends DomainXValue, Y extends DomainYValue, Data = void>(cx: number, cy: number, data: XYChartDatum<X, Y, Data>[]): XYChartDatum<X, Y, Data> | undefined;