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

Method parse

src/scale/Ordinal.ts:160–176  ·  view source on GitHub ↗
(this: OrdinalScale, val: OrdinalRawValue | OrdinalNumber)

Source from the content-addressed store, hash-verified

158 }
159
160 private static parse(this: OrdinalScale, val: OrdinalRawValue | OrdinalNumber): OrdinalNumber {
161 // Caution: Math.round(null) will return `0` rather than `NaN`
162 if (val == null) {
163 val = NaN;
164 }
165 else if (isString(val)) {
166 val = this._ordinalMeta.getOrdinal(val);
167 if (val == null) {
168 val = NaN;
169 }
170 }
171 else {
172 // The val from user input might be float.
173 val = mathRound(val);
174 }
175 return val;
176 }
177
178 static decoratedMethods: DecoratedScaleMapperMethods<OrdinalScale> = {
179

Callers

nothing calls this directly

Calls 1

getOrdinalMethod · 0.80

Tested by

no test coverage detected