(str: string, blockMetaList: SeriesGroupMeta[])
| 270 | } |
| 271 | |
| 272 | function 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 | |
| 299 | export interface ToolboxDataViewFeatureOption extends ToolboxFeatureOption { |
| 300 | readOnly?: boolean |
no test coverage detected
searching dependent graphs…