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

Class RelationalConditionInternal

src/util/conditionalExpression.ts:277–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275 }
276}
277class RelationalConditionInternal implements ParsedConditionInternal {
278 valueGetterParam: ValueGetterParam;
279 valueParser: ReturnType<typeof getRawValueParser>;
280 // If no parser, be null/undefined.
281 getValue: ConditionalExpressionValueGetter;
282 subCondList: FilterComparator[];
283
284 evaluate() {
285 const needParse = !!this.valueParser;
286 // Call getValue with no `this`.
287 const getValue = this.getValue;
288 const tarValRaw = getValue(this.valueGetterParam);
289 const tarValParsed = needParse ? this.valueParser(tarValRaw) : null;
290
291 // Relational cond follow "and" logic internally.
292 for (let i = 0; i < this.subCondList.length; i++) {
293 if (!this.subCondList[i].evaluate(needParse ? tarValParsed : tarValRaw)) {
294 return false;
295 }
296 }
297 return true;
298 }
299}
300
301function parseOption(
302 exprOption: ConditionalExpressionOption,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…