MCPcopy Index your code
hub / github.com/apache/echarts / parseTSVContents

Function parseTSVContents

src/component/toolbox/feature/DataView.ts:204–226  ·  view source on GitHub ↗

* @param {string} tsv * @return {Object}

(tsv: string)

Source from the content-addressed store, hash-verified

202 * @return {Object}
203 */
204function parseTSVContents(tsv: string) {
205 const tsvLines = tsv.split(/\n+/g);
206 const headers = trim(tsvLines.shift()).split(itemSplitRegex);
207
208 const categories: string[] = [];
209 const series: {name: string, data: string[]}[] = zrUtil.map(headers, function (header) {
210 return {
211 name: header,
212 data: []
213 };
214 });
215 for (let i = 0; i < tsvLines.length; i++) {
216 const items = trim(tsvLines[i]).split(itemSplitRegex);
217 categories.push(items.shift());
218 for (let j = 0; j < items.length; j++) {
219 series[j] && (series[j].data[i] = items[j]);
220 }
221 }
222 return {
223 series: series,
224 categories: categories
225 };
226}
227
228function parseListContents(str: string) {
229 const lines = str.split(/\n+/g);

Callers 1

parseContentsFunction · 0.85

Calls 2

trimFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…