| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- import { Theme } from './theme';
- import { Coordinate } from './coordinate';
- import { Interaction } from './interaction';
- import { Transform } from './transform';
- import { Scale } from './scale';
- import { Data } from './data';
- import { LabelTransform } from './labelTransform';
- import { Closeable, Literal2Object, Padding } from './utils';
- import { AxisComponent, LegendComponent, ScrollbarComponent, SliderComponent, TitleComponent, TooltipComponent } from './component';
- import { AtheisticChanelTypes, Mark, PositionChannelTypes } from './mark';
- export type Composition = ViewComposition | GeoViewComposition | GeoPathComposition | SpaceLayerComposition | SpaceFlexComposition | RepeatMatrixComposition | FacetRectComposition | FacetCircleComposition | TimingKeyframeComposition;
- export type CompositionTypes = 'view' | 'getView' | 'geoPath' | 'spaceLayer' | 'spaceFlex' | 'facetRect' | 'facetCircle' | 'repeatMatrix' | 'timingKeyframe';
- export type ViewComposition = {
- type?: 'view';
- x?: number;
- y?: number;
- width?: number;
- height?: number;
- data?: Data;
- key?: string;
- class?: string;
- padding?: Padding;
- paddingLeft?: Padding;
- paddingRight?: Padding;
- paddingTop?: Padding;
- paddingBottom?: Padding;
- margin?: number;
- marginLeft?: number;
- marginBottom?: number;
- marginTop?: number;
- marginRight?: number;
- inset?: number;
- insetLeft?: number;
- insetTop?: number;
- insetBottom?: number;
- insetRight?: number;
- coordinate?: Coordinate;
- interaction?: Literal2Object<Interaction>;
- transform?: Transform[];
- theme?: Theme;
- children?: Mark[];
- scale?: Record<string, Scale>;
- frame?: boolean;
- labelTransform?: LabelTransform[];
- axis?: Closeable<Partial<Record<PositionChannelTypes, Closeable<AxisComponent>>>>;
- legend?: Closeable<Partial<Record<AtheisticChanelTypes, Closeable<LegendComponent>>>>;
- tooltip?: TooltipComponent;
- slider?: Closeable<Partial<Record<PositionChannelTypes, Closeable<SliderComponent>>>>;
- scrollbar?: Closeable<Partial<Record<PositionChannelTypes, Closeable<ScrollbarComponent>>>>;
- title?: string | TitleComponent;
- style?: Record<string, any>;
- clip?: boolean;
- };
- export type GeoViewComposition = Omit<ViewComposition, 'type'> & {
- type?: 'geoView';
- coordinate?: Record<string, any>;
- };
- export type GeoPathComposition = Omit<ViewComposition, 'type'> & {
- type?: 'geoPath';
- coordinate?: Record<string, any>;
- [key: string]: any;
- };
- export type SpaceLayerComposition = {
- type?: 'spaceLayer';
- key?: string;
- data?: any;
- children?: Node[];
- };
- export type SpaceFlexComposition = {
- type?: 'spaceFlex';
- key?: string;
- data?: Data;
- direction?: 'col' | 'row';
- ratio?: number[];
- padding?: Padding;
- children?: Node[];
- };
- export type FacetContext = {
- columnField?: string | number;
- columnIndex?: number;
- columnValue?: string | number;
- columnValuesLength?: number;
- rowField?: string | number;
- rowIndex?: number;
- rowValue?: string | number;
- rowValuesLength?: number;
- };
- export type FacetRectComposition = {
- type?: 'facetRect';
- transform?: Transform;
- data?: Data;
- padding?: Padding;
- paddingLeft?: Padding;
- paddingRight?: Padding;
- paddingTop?: Padding;
- paddingBottom?: Padding;
- margin?: number;
- marginLeft?: number;
- marginBottom?: number;
- marginTop?: number;
- marginRight?: number;
- key?: string;
- title?: string | TitleComponent;
- encode?: {
- x?: string;
- y?: string;
- };
- scale?: {
- x?: Scale;
- y?: Scale;
- color?: Scale;
- };
- shareData?: boolean;
- shareSize?: boolean;
- children?: Node[] | ((facet: FacetContext) => Node);
- axis?: Record<string, any> | boolean;
- legend?: Record<string, any> | boolean;
- };
- export type RepeatMatrixComposition = {
- type?: 'repeatMatrix';
- padding?: Padding;
- paddingLeft?: Padding;
- paddingRight?: Padding;
- paddingTop?: Padding;
- paddingBottom?: Padding;
- margin?: number;
- marginLeft?: number;
- marginBottom?: number;
- marginTop?: number;
- marginRight?: number;
- transform?: Transform;
- title?: string | TitleComponent;
- data?: Data;
- key?: string;
- encode?: {
- x?: string[] | string;
- y?: string[] | string;
- position?: string[];
- };
- scale?: {
- x?: Scale;
- y?: Scale;
- color?: Scale;
- };
- axis?: Record<string, any> | boolean;
- legend?: Record<string, any> | boolean;
- children?: Node[] | ((facet: FacetContext) => Node);
- };
- export type FacetCircleComposition = {
- type?: 'facetCircle';
- padding?: Padding;
- paddingLeft?: Padding;
- paddingRight?: Padding;
- paddingTop?: Padding;
- paddingBottom?: Padding;
- margin?: number;
- marginLeft?: number;
- marginBottom?: number;
- marginTop?: number;
- marginRight?: number;
- transform?: Transform;
- title?: string | TitleComponent;
- data?: Data;
- key?: string;
- encode?: {
- position?: string;
- };
- scale?: {
- x?: Scale;
- y?: Scale;
- color?: Scale;
- };
- children?: Node[] | ((facet: FacetContext) => Node);
- axis?: Record<string, any> | boolean;
- legend?: Record<string, any> | boolean;
- };
- export type TimingKeyframeComposition = {
- type?: 'timingKeyframe';
- duration?: number;
- key?: string;
- easing?: string;
- iterationCount?: 'infinite' | number;
- direction?: 'normal' | 'reverse' | 'alternate' | 'reverse-alternate';
- children?: Node[];
- };
- type Node = Mark | Composition;
- export {};
|