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

Function parseContents

src/component/toolbox/feature/DataView.ts:272–297  ·  view source on GitHub ↗
(str: string, blockMetaList: SeriesGroupMeta[])

Source from the content-addressed store, hash-verified

270}
271
272function parseContents(str: string, blockMetaList: SeriesGroupMeta[]) {
273 const blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g'));
274 const newOption: ECUnitOption = {
275 series: []
276 };
277 zrUtil.each(blocks, function (block, idx) {
278 if (isTSVFormat(block)) {
279 const result = parseTSVContents(block);
280 const blockMeta = blockMetaList[idx];
281 const axisKey = blockMeta.axisDim + 'Axis';
282
283 if (blockMeta) {
284 newOption[axisKey] = newOption[axisKey] || [];
285 (newOption[axisKey] as any)[blockMeta.axisIndex] = {
286 data: result.categories
287 };
288 newOption.series = (newOption.series as SeriesOption[]).concat(result.series);
289 }
290 }
291 else {
292 const result = parseListContents(block);
293 (newOption.series as SeriesOption[]).push(result);
294 }
295 });
296 return newOption;
297}
298
299export interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption {
300 readOnly?: boolean

Callers 1

onclickMethod · 0.85

Calls 4

isTSVFormatFunction · 0.85
parseTSVContentsFunction · 0.85
parseListContentsFunction · 0.85
eachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…