Methods
DV2dArrMinMax(Xs) → {Array()}
get the min and max for a 2d array
Parameters:
Name | Type | Description |
---|---|---|
Xs |
Array(Array(double)) | the 2d Array |
- Source:
Returns:
[min,max] - the minium and maxium of the 2D array.
- Type
- Array()
DVgetRandomColor(lens, alphaopt) → {Array()}
get a series of DVColor
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lens |
int | how many colors you want. | ||
alpha |
double |
<optional> |
0.7 | the alpha component |
- Source:
Returns:
randomN - the random color set
- Type
- Array()
DVgetRightTextStyle(dv, length) → {string}
get the fitted font style according to the height of text
Parameters:
Name | Type | Description |
---|---|---|
dv |
DVisual | the Dvisual instance you want to draw |
length |
double | the height limit of text |
- Source:
Returns:
font - the fitted font string.
- Type
- string
DVgetRightTextStyleByStrLenght(dv, str, length) → {string}
get the fitted font style according to text and the length limit of text
Parameters:
Name | Type | Description |
---|---|---|
dv |
DVisual | the Dvisual instance you want to draw |
str |
string | the text you want to draw |
length |
double | the height limit of text |
- Source:
Returns:
font - the fitted font string.
- Type
- string
DVGetSpan(margin) → {double}
get the span for a settled margin
Parameters:
Name | Type | Description |
---|---|---|
margin |
double | the margin |
- Source:
Returns:
Span - the span for the input margin
- Type
- double
DVMedian(Y)
calculate the median of an array
Parameters:
Name | Type | Description |
---|---|---|
Y |
Array(double) | the data to be calculate |
- Source:
getEventPosition() → {Object}
get the eventPosition on canvas
- Source:
Returns:
{x:x,y:y}
- Type
- Object
getrandom(N) → {double}
get a random number in certain margin
Parameters:
Name | Type | Description |
---|---|---|
N |
double | the margin of random number you want |
- Source:
Returns:
randomN - the random number
- Type
- double