Skip to content

Commit cd16cfd

Browse files
authored
Update README.md
1 parent eb207d4 commit cd16cfd

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,34 @@ ______
99
- `dataMappingGuide.js`
1010

1111
## 2. Synopsis
12+
`var obj=dataMappingGuide(canvas,src);`
13+
This function returns an object with some methods to control.
14+
15+
### Parameters
16+
- `canvas`: a canvas element
17+
- `src`: an optional filename or pathname of an image for background
18+
19+
### Main methods
20+
#### 1) resizing and background
21+
- `resize(w,h,src)`; it sets canvas size and background image
22+
- `setDivisions(x,y)`; it sets horizontal and vertical divisions
23+
- `w` and `h`: new values for canvas width and canvas height
24+
- `src`: filename or pathname of an image; 'none' is default value
25+
- `x` and `y`: numbers for horizontal and vertical divisions
26+
27+
#### 2) colors
28+
- `setColor(rgb,alpha)`; it sets rgb color and alpha value
29+
- `rgb`: rgb color value
30+
- `alpha`: an optional value between 0.0 (fully transparent) and 1.0 (fully opaque)
31+
32+
#### 3) focus area
33+
- `xy(x,y)`; it puts focus on a area that is specified using integer coordinates
34+
- `x` and `y`: positive integer indices for horizontal and vertical divisions
35+
36+
#### Focus area indices
37+
An example of 3x3 divided focus area:
38+
_|1|2|3|
39+
1|x|x|x|
40+
2|x|x|x|
41+
3|x|x|x|
42+

0 commit comments

Comments
 (0)