MCPcopy
hub / github.com/apache/echarts / createSource

Function createSource

src/data/Source.ts:197–224  ·  view source on GitHub ↗
(
    sourceData: OptionSourceData,
    thisMetaRawOption: SourceMetaRawOption,
    // can be null. If not provided, auto detect it from `sourceData`.
    sourceFormat: SourceFormat
)

Source from the content-addressed store, hash-verified

195 * NOTE: Created source is immutable. Don't change any properties in it.
196 */
197export function createSource(
198 sourceData: OptionSourceData,
199 thisMetaRawOption: SourceMetaRawOption,
200 // can be null. If not provided, auto detect it from `sourceData`.
201 sourceFormat: SourceFormat
202): Source {
203 sourceFormat = sourceFormat || detectSourceFormat(sourceData);
204 const seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;
205 const determined = determineSourceDimensions(
206 sourceData,
207 sourceFormat,
208 seriesLayoutBy,
209 thisMetaRawOption.sourceHeader,
210 thisMetaRawOption.dimensions
211 );
212 const source = new SourceImpl({
213 data: sourceData,
214 sourceFormat: sourceFormat,
215
216 seriesLayoutBy: seriesLayoutBy,
217 dimensionsDefine: determined.dimensionsDefine,
218 startIndex: determined.startIndex,
219 dimensionsDetectedCount: determined.dimensionsDetectedCount,
220 metaRawOption: clone(thisMetaRawOption)
221 });
222
223 return source;
224}
225
226/**
227 * Wrap original series data for some compatibility cases.

Callers 5

SeriesData.test.tsFile · 0.90
testArrayRowsInSourceFunction · 0.90
applySingleDataTransformFunction · 0.90
_createSourceMethod · 0.90

Calls 3

cloneFunction · 0.85
detectSourceFormatFunction · 0.70

Tested by 1

testArrayRowsInSourceFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…