liusuyi
2023-04-24 4737f1e038743ced243c9e52423404d9034d6107
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { Source } from '../Source.js';
import { ArrayLike } from 'zrender/lib/core/types.js';
import { DimensionName, DimensionIndex, OptionSourceData, OptionDataItem, OptionDataValue, SourceFormat, SeriesLayoutBy, ParsedValue, DimensionLoose, NullUndefined } from '../../util/types.js';
import SeriesData from '../SeriesData.js';
export interface DataProvider {
    /**
     * true: all of the value are in primitive type (in type `OptionDataValue`).
     * false: Not sure whether any of them is non primitive type (in type `OptionDataItemObject`).
     *     Like `data: [ { value: xx, itemStyle: {...} }, ...]`
     *     At present it only happen in `SOURCE_FORMAT_ORIGINAL`.
     */
    pure?: boolean;
    /**
     * If data is persistent and will not be released after use.
     */
    persistent?: boolean;
    getSource(): Source;
    count(): number;
    getItem(idx: number, out?: OptionDataItem): OptionDataItem;
    fillStorage?(start: number, end: number, out: ArrayLike<ParsedValue>[], extent: number[][]): void;
    appendData?(newData: ArrayLike<OptionDataItem>): void;
    clean?(): void;
}
export interface DefaultDataProvider {
    fillStorage?(start: number, end: number, out: ArrayLike<ParsedValue>[], extent: number[][]): void;
}
/**
 * If normal array used, mutable chunk size is supported.
 * If typed array used, chunk size must be fixed.
 */
export declare class DefaultDataProvider implements DataProvider {
    private _source;
    private _data;
    private _offset;
    private _dimSize;
    pure: boolean;
    persistent: boolean;
    static protoInitialize: void;
    constructor(sourceParam: Source | OptionSourceData, dimSize?: number);
    getSource(): Source;
    count(): number;
    getItem(idx: number, out?: ArrayLike<OptionDataValue>): OptionDataItem;
    appendData(newData: OptionSourceData): void;
    clean(): void;
    private static internalField;
}
declare type RawSourceItemGetter = (rawData: OptionSourceData, startIndex: number, dimsDef: {
    name?: DimensionName;
}[], idx: number, out?: ArrayLike<OptionDataValue>) => OptionDataItem | ArrayLike<OptionDataValue>;
export declare function getRawSourceItemGetter(sourceFormat: SourceFormat, seriesLayoutBy: SeriesLayoutBy): RawSourceItemGetter;
declare type RawSourceDataCounter = (rawData: OptionSourceData, startIndex: number, dimsDef: {
    name?: DimensionName;
}[]) => number;
export declare function getRawSourceDataCounter(sourceFormat: SourceFormat, seriesLayoutBy: SeriesLayoutBy): RawSourceDataCounter;
declare type RawSourceValueGetter = (dataItem: OptionDataItem, dimIndex: DimensionIndex, property: DimensionName) => OptionDataValue;
export declare function getRawSourceValueGetter(sourceFormat: SourceFormat): RawSourceValueGetter;
export declare function retrieveRawValue(data: SeriesData, dataIndex: number, dim?: DimensionLoose | NullUndefined): OptionDataValue | OptionDataItem;
/**
 * Compatible with some cases (in pie, map) like:
 * data: [{name: 'xx', value: 5, selected: true}, ...]
 * where only sourceFormat is 'original' and 'objectRows' supported.
 *
 * // TODO
 * Supported detail options in data item when using 'arrayRows'.
 *
 * @param data
 * @param dataIndex
 * @param attr like 'selected'
 */
export declare function retrieveRawAttr(data: SeriesData, dataIndex: number, attr: string): any;
export {};