* @private * @param piece piece.value or piece.interval is required. * @return Can be Infinity or -Infinity
(piece: InnerVisualPiece)
| 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 |
no test coverage detected