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

Method getRepresentValue

src/component/visualMap/PiecewiseModel.ts:333–351  ·  view source on GitHub ↗

* @private * @param piece piece.value or piece.interval is required. * @return Can be Infinity or -Infinity

(piece: InnerVisualPiece)

Source from the content-addressed store, hash-verified

331 * @return Can be Infinity or -Infinity
332 */
333 getRepresentValue(piece: InnerVisualPiece) {
334 let representValue;
335 if (this.isCategory()) {
336 representValue = piece.value;
337 }
338 else {
339 if (piece.value != null) {
340 representValue = piece.value;
341 }
342 else {
343 const pieceInterval = piece.interval || [];
344 representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity)
345 ? 0
346 : (pieceInterval[0] + pieceInterval[1]) / 2;
347 }
348 }
349
350 return representValue;
351 }
352
353 getVisualMeta(
354 getColorVisual: (value: number, valueState: VisualState) => string

Callers 2

setStopMethod · 0.80
doRenderMethod · 0.80

Calls 1

isCategoryMethod · 0.80

Tested by

no test coverage detected