This class can be used to easily model an orthogonal border line or sky-line.
Remarks
Type Details
- yfiles module
- algorithms
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.algorithms.BorderLine
See Also
Constructors
Creates a new BorderLine with the given value from -Number.MAX_VALUE to +Number.MAX_VALUE.
Parameters
A map of options to pass to the method.
- value - number
- the value of the segment
Creates a new BorderLine from a single segment.
Parameters
A map of options to pass to the method.
- min - number
- the beginning of this borderline
- max - number
- the ending of this borderline
- value - number
- the value of the segment
Creates a new BorderLine from a single segment.
Parameters
A map of options to pass to the method.
- min - number
- the beginning of this borderline
- max - number
- the ending of this borderline
- valueAtMin - number
- the value of the segment at the beginning of this borderline
- valueAtMax - number
- the value of the segment at the ending of this borderline
Properties
Methods
Convenience method that copies the actual data from the given argument to this instance.
Parameters
A map of options to pass to the method.
- other - BorderLine
- the argument to retrieve the values from
Creates a copy of this borderline.
Remarks
Parameters
A map of options to pass to the method.
- negateValues - boolean
- whether the values are negated
- negateOffsets - boolean
- whether the offsets are negated
Returns
- ↪BorderLine
- the copy of the borderline
Merges this borderline with the given borderline using the "maximum" policy.
Remarks
Parameters
A map of options to pass to the method.
- other - BorderLine
- the other borderline
Returns
- ↪BorderLine
- a new borderline that is the result of the merge
Merges this borderline with the given borderline using the "minimum" policy.
Remarks
Parameters
A map of options to pass to the method.
- other - BorderLine
- the other borderline
Returns
- ↪BorderLine
- a new borderline that is the result of the merge
Returns the first segment or null
if there is no such segment.
Calculates the minimal distance between this borderline and the other one.
Remarks
Returns the maximum position of the given segment.
Calculates the maximum value in the interval from->to.
from
value is larger or equal to the to
value, the algorithm always returns -Number.MAX_VALUE.Returns the minimum position of the given segment.
Calculates the minimum value in the interval from->to.
from
value is larger or equal to the to
value, the algorithm always returns Number.MAX_VALUE.Returns the segment at the given position.
Parameters
A map of options to pass to the method.
- pos - number
- the position
Returns the slope of the given segment.
Returns the value of the minimum of the given segment.
Remarks
Parameters
A map of options to pass to the method.
- s - BorderLineSegment
- the segment
Returns the value that is set on this borderline at the specified position.
Parameters
A map of options to pass to the method.
- pos - number
- the position
Returns
- ↪number
- the value
Throws
- Exception({ name: 'IndexOutOfRangeError' })
- if the position is outside of the borderline.
Returns the value that is set on this borderline at the specified position.
Remarks
cell
.Parameters
A map of options to pass to the method.
- cell - ListCell
- The list cell containing the segment whose value shall be returned.
- pos - number
- the position
Returns
- ↪number
- the value
Throws
- Exception({ name: 'ArgumentError' })
- if
pos
is outside the segment's range that is stored incell
.
Returns the value that is set on this borderline at the specified position.
Remarks
Parameters
A map of options to pass to the method.
- segment - BorderLineSegment
- The segment whose value shall be returned.
- pos - number
- the position where the value will be retrieved.
Returns
- ↪number
- the value
Throws
- Exception({ name: 'ArgumentError' })
- if
pos
is outside the segment's range.
Grows this borderline horizontally, so that the values of the borderline stay the same however their start and end points are moved in the direction of toMin
and toMax
.
Remarks
This is useful for scenarios where a borderline is needed that consists of an enlarged border.
Note that this method normalizes the segments, i.e., it transforms each segment with slope != 0 to a segment with slope == 0.
Parameters
A map of options to pass to the method.
- toMin - number
- the delta by which the border should be extended towards -Infinity
- toMax - number
- the delta by which the border should be extended towards +Infinity
- positive - boolean
- whether the borderline should be interpreted to point in positive direction. This influences the direction into which a segment's border is extended.
Returns the last segment or null
if there is no such segment.
Merges this borderline with the given borderline using the "maximum" policy.
Parameters
A map of options to pass to the method.
- other - BorderLine
- the other borderline
Merges this borderline with the given borderline using the "minimum" policy.
Parameters
A map of options to pass to the method.
- other - BorderLine
- the other borderline
Returns the next segment or null
if there is no such segment.
Returns the previous segment or null
if there is no such segment.
Assures that all values in the given interval are greater or equal than the given value.
Parameters
A map of options to pass to the method.
- min - number
- the lower end of the interval
- max - number
- the upper end of the interval
- value - number
- the smallest possible value for the interval
Assures that all values in the given interval are less or equal than the given value.
Parameters
A map of options to pass to the method.
- min - number
- the lower end of the interval
- max - number
- the upper end of the interval
- value - number
- the greatest possible value for the interval
Sets a specific interval to a slope starting at a given value.
Parameters
A map of options to pass to the method.
- min - number
- the left side of the interval.
- max - number
- the right side of the interval.
- value - number
- the value at
min
where the slope starts. - slope - number
- the slope of the segment in the given interval.
Throws
- Exception({ name: 'ArgumentError' })
- if
min
is greater thanmax
.
Sets a specific interval described by min
and max
to a given value.
Parameters
A map of options to pass to the method.
- min - number
- the left side of the interval.
- max - number
- the right side of the interval.
- value - number
- the value for the whole interval.