Constructor
new Box(xmin, ymin, xmax, ymax)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
xmin |
number
|
minimal x coordinate |
ymin |
number
|
minimal y coordinate |
xmax |
number
|
maximal x coordinate |
ymax |
number
|
maximal y coordinate |
Classes
Members
Methods
equal_to(other_box) → {boolean}
Returns true if this box is equal to other box, false otherwise
- Source:
Parameters:
Name | Type | Description |
---|---|---|
other_box |
Box
|
query box |
Returns:
- Type:
-
boolean
intersect(other_box) → {boolean}
Returns true if intersected with other box
- Source:
Parameters:
Name | Type | Description |
---|---|---|
other_box |
Box
|
Query box |
Returns:
- Type:
-
boolean
less_than(other_box) → {boolean}
Defines predicate "less than" between two boxes. Need for interval index
- Source:
Parameters:
Name | Type | Description |
---|---|---|
other_box |
Box
|
other box |
Returns:
- Type:
-
boolean
- true if this box less than other box, false otherwise
merge(other_box) → {Box}
Returns new box merged with other box
- Source:
Parameters:
Name | Type | Description |
---|---|---|
other_box |
Box
|
Other box to merge with |
Returns:
- Type:
-
Box
not_intersect(other_box) → {boolean}
Returns true if not intersected with other box
- Source:
Parameters:
Name | Type | Description |
---|---|---|
other_box |
Box
|
other box to test |
Returns:
- Type:
-
boolean
set(xmin, ymin, xmax, ymax)
Set new values to the box object
- Source:
Parameters:
Name | Type | Description |
---|---|---|
xmin |
number
|
miminal x coordinate |
ymin |
number
|
minimal y coordinate |
xmax |
number
|
maximal x coordinate |
ymax |
number
|
maximal y coordinate |
svg(attrs) → {string}
Return string to draw circle in svg
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attrs |
Object
|
an object with attributes of svg rectangle element,
like "stroke", "strokeWidth", "fill" Defaults are stroke:"black", strokeWidth:"1", fill:"none" |
Returns:
- Type:
-
string
toPoints() → {Array.<Point>}
Transform box into array of points from low left corner in counter clockwise
- Source:
Returns:
- Type:
-
Array.<Point>