custom_params: Create and implement a custom JS library.

Description Usage Arguments Value Note Author(s) Examples

View source: R/fishdraw.R

Description

Programmatically generated fish drawings via ggplot2 based on JavaScript library https://github.com/LingDong-/fishdraw.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
custom_params(
  path = "./fishdraw.js",
  save = getwd(),
  body_curve_type = 0,
  body_curve_amount = 0.85,
  body_length = 420,
  body_height = 90,
  scale_type = 1,
  scale_scale = 1,
  pattern_type = 3,
  pattern_scale = 1,
  dorsal_texture_type = 1,
  dorsal_type = 0,
  dorsal_length = 100,
  dorsal_start = 8,
  dorsal_end = 27,
  wing_texture_type = 0,
  wing_type = 0,
  wing_start = 6,
  wing_end = 6,
  wing_y = 0.7,
  wing_length = 130,
  wing_width = 10,
  pelvic_start = 9,
  pelvic_end = 14,
  pelvic_length = 85,
  pelvic_type = 0,
  pelvic_texture_type = 0,
  anal_start = 19,
  anal_end = 29,
  anal_length = 50,
  anal_type = 0,
  anal_texture_type = 0,
  tail_type = 0,
  tail_length = 75,
  finlet_type = 0,
  neck_type = 0,
  nose_height = 0,
  mouth_size = 8,
  head_length = 30,
  head_texture_amount = 60,
  has_moustache = 1,
  moustache_length = 10,
  has_beard = 0,
  has_teeth = 1,
  teeth_length = 8,
  teeth_space = 3.5,
  beard_length = 30,
  eye_type = 0,
  eye_size = 10,
  jaw_size = 1,
  jaw_open = 1
)

Arguments

path

Path for JavaScript fishdraw.js

save

Save path for custom JavaScript fishdraw.js(e.g.getwd())

body_curve_type

numeric body_curve_type options:0 or 1.

body_curve_amount

numeric body_curve_amount options:0.5,0.85 or 0.98.

body_length

numeric body_length options:200,350 or 420.

body_height

numeric body_height options:45,90 or 150.

scale_type

numeric scale_type options:0,1,2 or 3.

scale_scale

numeric scale_scale options:0.8,1 or 1.5.

pattern_type

numeric pattern_type options:0,1,2,3 or 4.

pattern_scale

numeric pattern_scale options:0.5,1 or 2.

dorsal_texture_type

numeric dorsal_texture_type options:0 or 1.

dorsal_type

numeric dorsal_type options:0 or 1.

dorsal_length

numeric dorsal_length options:30,90 or 180.

dorsal_start

numeric dorsal_start options:7,8,15;11,12,16.

dorsal_end

numeric dorsal_end options:20,27,28;19,21,24.

wing_texture_type

numeric wing_texture_type options:0 or 1.

wing_type

numeric wing_type options:0 or 1.

wing_start

numeric wing_start options:5,6 or 8.

wing_end

numeric wing_end options:5,6 or 8.

wing_y

numeric wing_y options:0.45,0.7 or 0.85.

wing_length

numeric wing_length options:40,130,200;40,150,350.

wing_width

numeric wing_width options:7,10,20;20,30,50.

pelvic_start

numeric pelvic_start options:7,9,11;7,9,12.

pelvic_end

numeric pelvic_end options:13,14,15

pelvic_length

numeric pelvic_length options:0 or 1.

pelvic_type

numeric pelvic_type options:0 or 1.

pelvic_texture_type

numeric pelvic_texture_type options:0 or 1.

anal_start

numeric anal_start options:16,19 or 23.

anal_end

numeric anal_end options:25,29 or 31.

anal_length

numeric anal_length options:20,50 or 80.

anal_type

numeric anal_type options:0 or 1.

anal_texture_type

numeric anal_texture_type options:0 or 1.

tail_type

numeric tail_type options:0,1,2,3,4 or 5.

tail_length

numeric tail_length options:50,75 or 180.

finlet_type

numeric finlet_type options:0,1,2 or 3.

neck_type

numeric neck_type options:0 or 1.

nose_height

numeric nose_height options:-50,0 or 35.

mouth_size

numeric mouth_size options:6,8 or 11.

head_length

numeric head_length options:20,30 or 50.

head_texture_amount

numeric head_texture_amount options:30,60 or 160.

has_moustache

numeric has_moustache options:0,0,0,1.

moustache_length

numeric moustache_length options:10,20,40.

has_beard

numeric has_beard options:0,0,0,0,0,1.

has_teeth

numeric has_teeth options:0,1,1.

teeth_length

numeric teeth_length options:5,8 or 15.

teeth_space

numeric teeth_space options:3,3.5 or 6.

beard_length

numeric beard_length options:20,30 or 50.

eye_type

numeric eye_type options:0 or 1.

eye_size

numeric eye_size options:8,10 or 28.

jaw_size

numeric jaw_size options:0.7,1 or 1.4.

jaw_open

numeric jaw_open options:0 or 1.

Value

Custom JS library.

Note

Note that some fish species might not be representable with this system, and passing "bad" params might produce weird results or crash the program.

Author(s)

Liuyong Ding ly_ding@126.com

Examples

1
2
3
4
5
6
## Not run: 
# create and implement a custom JS library
custom_params(path = "./fishdraw.js",save = getwd())


## End(Not run)

rfishdraw documentation built on Sept. 8, 2021, 5:08 p.m.