(
scale: Scale, value: number, considerMappingExtent: boolean
)
| 136 | * Check if the axis cross a specific value. |
| 137 | */ |
| 138 | export function getScaleValuePositionKind( |
| 139 | scale: Scale, value: number, considerMappingExtent: boolean |
| 140 | ): ScaleValuePositionKind { |
| 141 | const dataExtent = considerMappingExtent |
| 142 | ? getScaleExtentForMappingUnsafe(scale, null) |
| 143 | : scale.getExtentUnsafe(SCALE_EXTENT_KIND_EFFECTIVE, null); |
| 144 | const min = dataExtent[0]; |
| 145 | const max = dataExtent[1]; |
| 146 | return !isValidBoundsForExtent(min, max) ? SCALE_VALUE_POSITION_KIND_OUTSIDE |
| 147 | : (min === value || max === value) ? SCALE_VALUE_POSITION_KIND_EDGE |
| 148 | : (min < value && max > value) ? SCALE_VALUE_POSITION_KIND_INSIDE |
| 149 | : SCALE_VALUE_POSITION_KIND_OUTSIDE; |
| 150 | } |
| 151 | export type ScaleValuePositionKind = |
| 152 | typeof SCALE_VALUE_POSITION_KIND_INSIDE |
| 153 | | typeof SCALE_VALUE_POSITION_KIND_EDGE |
no test coverage detected
searching dependent graphs…