org.jplot2d.element.impl
Class AxisRangeUtils
- java.lang.Object
-
- org.jplot2d.element.impl.AxisRangeUtils
-
public class AxisRangeUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static org.jplot2d.element.impl.RangeStatus<java.lang.Boolean>calcNiceVirtualRange(java.util.Map<AxisTransformEx,NormalTransform> vtMap)Find a nice normalized range to make sure all corresponding world range only contain valid values.static java.util.Map<AxisTransformEx,NormalTransform>createNormalTransformMap(java.util.Collection<AxisTransformEx> axes)static java.util.Map<AxisTransformEx,NormalTransform>createVirtualTransformMap(java.util.Collection<AxisTransformEx> axes)Create a set of virtual NormalTransform correspond to the NormalTransform of the given axes.static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState>ensureCircleSpan(Range prange, java.util.Collection<AxisTransformEx> axes)static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState>ensureCircleSpan(Range prange, java.util.Map<AxisTransformEx,NormalTransform> vtMap)static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState>ensurePrecision(Range prange, java.util.Collection<AxisTransformEx> axes)The actually range maybe different from the given range to satisfy the precision limit.static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState>ensurePrecision(Range prange, java.util.Map<AxisTransformEx,NormalTransform> vtMap)static RangevalidateNormalRange(Range range, java.util.Collection<AxisTransformEx> axes, boolean findNearsetData)Adjust the given range and to make sure all corresponding user range only contain valid values.static RangevalidateNormalRange(Range range, java.util.Map<AxisTransformEx,NormalTransform> axisMap, boolean findNearsetData)Find a nice norm range inside the given range and to make sure all corresponding user range only contain valid values.
-
-
-
Method Detail
-
createVirtualTransformMap
public static java.util.Map<AxisTransformEx,NormalTransform> createVirtualTransformMap(java.util.Collection<AxisTransformEx> axes)
Create a set of virtual NormalTransform correspond to the NormalTransform of the given axes. The virtual NormalTransform will try to remove the offset to minimize the double calculation round error.- Parameters:
axes-- Returns:
-
createNormalTransformMap
public static java.util.Map<AxisTransformEx,NormalTransform> createNormalTransformMap(java.util.Collection<AxisTransformEx> axes)
-
calcNiceVirtualRange
public static org.jplot2d.element.impl.RangeStatus<java.lang.Boolean> calcNiceVirtualRange(java.util.Map<AxisTransformEx,NormalTransform> vtMap)
Find a nice normalized range to make sure all corresponding world range only contain valid values.- If any corresponding world range of layer span invalid value, the end of the given normalized range is adjusted inward to match the data that most close to boundary.
- If there is no valid data inside the given range,
nullwill be returned. - No margin added to the result.
- Returns:
- a RangeStatus contain the nice normalized range. The Boolean status to indicate if there are some data points outside the value bounds
-
validateNormalRange
public static Range validateNormalRange(Range range, java.util.Collection<AxisTransformEx> axes, boolean findNearsetData)
Adjust the given range and to make sure all corresponding user range only contain valid values.- If there is no intersection among the given range and valid boundaries, null is returned.
- If all corresponding world range of layers are valid, the given norm range is returned without any adjustment.
- If any corresponding world range of layers spans over invalid value, the end of given range is adjusted inward to the valid boundary.
- If the given range start/end at INFINITY, then "nearest data" well be found instead of the valid boundary.
- If there is no valid data inside the valid range,
nullwill be returned. - A margin is appended on the "nearest data" end.
- If there is no valid data inside the valid range,
- Parameters:
range- The caller should guarantee pLo < pHi- Returns:
- a RangeStatus contain the adjusted normalized range. The RangeAdjustTag status indicate if the given range is adjusted.
-
validateNormalRange
public static Range validateNormalRange(Range range, java.util.Map<AxisTransformEx,NormalTransform> axisMap, boolean findNearsetData)
Find a nice norm range inside the given range and to make sure all corresponding user range only contain valid values.- If there is no intersection among the given range and valid boundaries, null is returned.
- If all corresponding world range of layers are valid, the given norm range is returned without any adjustment.
- If any corresponding world range of layers spans over invalid value, the end of given range is adjusted
inward to the data that most close to boundary.
- If there is no valid data inside the valid range,
nullwill be returned. - A margin is appended on the "nearest data" end.
- If there is no valid data inside the valid range,
- Parameters:
range- The caller should guarantee pLo < pHi- Returns:
- a RangeStatus contain the nice normalized range. The RangeAdjustTag status indicate if the given range is adjusted.
-
ensurePrecision
public static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState> ensurePrecision(Range prange, java.util.Collection<AxisTransformEx> axes)
The actually range maybe different from the given range to satisfy the precision limit.- Parameters:
pLo- the normalized range low valuepHi- the normalized range high valuelockedAxes-- Returns:
- the new range that satisfy the precision limit. The status object is PrecisionException if the range is adjusted.
-
ensurePrecision
public static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState> ensurePrecision(Range prange, java.util.Map<AxisTransformEx,NormalTransform> vtMap)
-
ensureCircleSpan
public static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState> ensureCircleSpan(Range prange, java.util.Collection<AxisTransformEx> axes)
-
ensureCircleSpan
public static org.jplot2d.element.impl.RangeStatus<org.jplot2d.element.impl.PrecisionState> ensureCircleSpan(Range prange, java.util.Map<AxisTransformEx,NormalTransform> vtMap)
-
-
DMelt 3.0 © DataMelt by jWork.ORG