16
16
* - `canvas`: a canvas element
17
17
* - `src`: an optional filename or pathname of an image for background
18
18
*=== Methods ===
19
- *### 1) resizing and background ###
19
+ *### 1) Resizing and background ###
20
20
* - `resize(w,h,src)`; it sets canvas size and background image
21
21
* - `setDivisions(x,y)`; it sets horizontal and vertical divisions
22
22
* - `w` and `h`: new values for canvas width and canvas height
23
23
* - `src`: filename or pathname of an image; 'none' is default value
24
24
* - `x` and `y`: numbers for horizontal and vertical divisions
25
- *### 2) colors ###
25
+ *### 2) Colors ###
26
26
* - `setColor(rgb,alpha)`; it sets rgb color and alpha value
27
27
* - `rgb`: rgb color value
28
28
* - `alpha`: an optional value between 0.0 (fully transparent) and 1.0 (fully opaque)
29
- *### 3) focus area ###
29
+ *### 3) Focus area ###
30
30
* - `xy(x,y)`; it puts focus on a area that is specified using integer coordinates
31
31
* - `x` and `y`: positive integer indices for horizontal and vertical divisions
32
- *### other methods ###
32
+ *### Other methods ###
33
33
* - `clear()`; it clears canvas
34
34
* - `next()`; it returns coordinates for the next focus area as form of [x,y]
35
35
* - `info()`; it returns the current state of sampling
@@ -65,7 +65,7 @@ function dataMappingGuide(canvas,src){
65
65
cvs . img = ! src ?'none' :src ;
66
66
canvas . style . backgroundRepeat = 'no-repeat' ;
67
67
canvas . style . backgroundImage = ! src ?'none' :'url(' + src + ')' ;
68
- //### 1) resizing and background ###
68
+ //### 1) Resizing and background ###
69
69
//it sets canvas size and background image
70
70
cvs . resize = function ( w , h , src ) {
71
71
// - w and h: new values for canvas width and canvas height
@@ -94,7 +94,7 @@ function dataMappingGuide(canvas,src){
94
94
cvs . dh = + canvas . height / cvs . Ny ;
95
95
return [ cvs . Nx , cvs . Ny ] ;
96
96
} ;
97
- //### 2) colors ###
97
+ //### 2) Colors ###
98
98
//it sets rgb color and alpha value
99
99
cvs . setColor = function ( rgb , alpha ) {
100
100
// - rgb: rgb color value
@@ -103,7 +103,7 @@ function dataMappingGuide(canvas,src){
103
103
cvs . alpha = ! alpha ?cvs . alpha :alpha ;
104
104
return [ cvs . color , cvs . alpha ] ;
105
105
} ;
106
- //### 3) focus area ###
106
+ //### 3) Focus area ###
107
107
//it puts focus on a area that is specified using integer coordinates
108
108
cvs . xy = function ( x , y ) {
109
109
// - `x` and `y`: positive integer indices for horizontal and vertical divisions
@@ -138,7 +138,7 @@ function dataMappingGuide(canvas,src){
138
138
ctx = null ;
139
139
return [ cvs . X , cvs . Y ] ;
140
140
} ;
141
- //### other methods ###
141
+ //### Other methods ###
142
142
//it clears canvas
143
143
cvs . clear = function ( ) {
144
144
var ctx = canvas . getContext ( '2d' ) ;
0 commit comments