Rev 11355 | Rev 11419 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 11355 | Rev 11356 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !if $wims_read_parm!=slib_header |
1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
2 | !goto proc |
3 | !endif |
3 | !endif |
4 | 4 | ||
5 | slib_parms=4\ |
5 | slib_parms=4\ |
6 | ,[min_x, max_y,size_x,size_y] |
6 | ,[min_x, max_y,size_x,size_y] in real coord and in pixels\ |
7 | ,3- or 5- vector for [d1,q1,mediane,q2,d2] or [q1,mediane,q2] \ |
7 | ,3- or 5- vector for [d1,q1,mediane,q2,d2] or [q1,mediane,q2] \ |
8 | ,3- or 5-vector with m (mobile) or f (fixed) at each position\ |
8 | ,3- or 5-vector with m (mobile) or f (fixed) at each position\ |
9 | ,option:number="", raw anstype stick |
9 | ,option:number="", raw anstype stick |
10 | slib_comment=<ul><li>option <span class="tt">number</span> is useful in case of several boxplots \ |
10 | slib_comment=<ul><li>option <span class="tt">number</span> is useful in case of several boxplots \ |
11 | in the same html page, by default nothing</li>\ |
11 | in the same html page, by default nothing</li>\ |
12 | <li>option <span class="tt">raw</span> gives the javascript code</li>\ |
12 | <li>option <span class="tt">raw</span> gives the javascript code</li>\ |
13 | <li>option <span class="tt">anstype</span> gives the code necessary to use with anstype <span class="tt">jsxgraph</span></li>\ |
13 | <li>option <span class="tt">anstype</span> gives the code necessary to use with anstype <span class="tt">jsxgraph</span></li>\ |
14 | <li>option <span class="tt">stick</span> gives the sticks to show, by default 1.</li> |
14 | <li>option <span class="tt">stick</span> gives the sticks to show, by default 1.</li></ul> |
15 | 15 | ||
16 | slib_out=Box plot. Some points can be fixed or mobile. |
16 | slib_out=Box plot. Some points can be fixed or mobile. |
17 | slib_author=Bernadette, Perrin-Riou |
17 | slib_author=Bernadette, Perrin-Riou |
18 | slib_title=Box plot |
18 | slib_title=Box plot |
19 | slib_example=[0,10],[4,6,7],,number=1\ |
19 | slib_example=[0,10],[4,6,7],,number=1\ |
20 | [0,10,500,200],[4,6,7],[m,f],number=2\ |
20 | [0,10,500,200],[4,6,7],[m,f],number=2\ |
21 | [0,10],[1,4,6,7,8],,number=3\ |
21 | [0,10],[1,4,6,7,8],,number=3\ |
22 | [ |
22 | [10,100,800,200],[21,54,66,77,89],[m,f,f,m,f],number=4 stick=10\ |
23 | [0,10],[1,2,6],,raw |
23 | [0,10],[1,2,6],,raw |
24 | 24 | ||
25 | !exit |
25 | !exit |
26 | 26 | ||
27 | :proc |
27 | :proc |
Line 52... | Line 52... | ||
52 | !set slib_brd=brd$slib_nb |
52 | !set slib_brd=brd$slib_nb |
53 | !set slib_jx=jxgbox$slib_nb |
53 | !set slib_jx=jxgbox$slib_nb |
54 | 54 | ||
55 | !! the following definition of $slib_jxr and $slib_jxv is cruxial when use with the |
55 | !! the following definition of $slib_jxr and $slib_jxv is cruxial when use with the |
56 | !! anstype jsxgraph. Do not change it. |
56 | !! anstype jsxgraph. Do not change it. |
- | 57 | !set slib_jxP=$(slib_jx)_P |
|
57 | !set slib_jxr=$(slib_jx)_rep |
58 | !set slib_jxr=$(slib_jx)_rep |
58 | !set slib_jxv=$(slib_jx)_var |
59 | !set slib_jxv=$(slib_jx)_var |
59 | !set slib_h=3 |
60 | !set slib_h=3 |
60 | !set slib_h1=$[$slib_h-1] |
61 | !set slib_h1=$[$slib_h-1] |
61 | !set slib_h2=$[$slib_h+1] |
62 | !set slib_h2=$[$slib_h+1] |
Line 66... | Line 67... | ||
66 | xaxis = $slib_brd.create('axis', [[0, 0], [1, 0]], {\ |
67 | xaxis = $slib_brd.create('axis', [[0, 0], [1, 0]], {\ |
67 | ticks: {ticksDistance: $slib_stick, insertTicks: false}});\ |
68 | ticks: {ticksDistance: $slib_stick, insertTicks: false}});\ |
68 | yaxis = $slib_brd.create('axis', [[0, 0], [0, 3]],{\ |
69 | yaxis = $slib_brd.create('axis', [[0, 0], [0, 3]],{\ |
69 | ticks: {ticksDistance:2, insertTicks: false,visible:false},visible:false}); |
70 | ticks: {ticksDistance:2, insertTicks: false,visible:false},visible:false}); |
70 | !set slib_font=face:'o', name:'', size:2, showInfobox: true |
71 | !set slib_font=face:'o', name:'', size:2, showInfobox: true |
- | 72 | !set slib_script1=$slib_script1\ |
|
- | 73 | Axe=$slib_brd.create('line',[[$slib_xmin,$slib_h],[$slib_xmax,$slib_h]],{visible:false}); |
|
71 | !for slib_i=1 to $slib_ch |
74 | !for slib_i=1 to $slib_ch |
72 | !if $(slib_fix[$slib_i])=f |
75 | !if $(slib_fix[$slib_i])=f |
73 | !set slib_fixme=,fixed:true,visible:false |
76 | !set slib_fixme=,fixed:true,visible:false |
74 | !else |
77 | !else |
75 |
|
78 | !set slib_fixme=,snapToGrid:true |
76 | !endif |
79 | !endif |
77 | !if raw notwordof $slib_opt and anstype notwordof $slib_opt |
80 | !if raw notwordof $slib_opt and anstype notwordof $slib_opt |
78 | !set slib_script1=$slib_script1\ |
81 | !set slib_script1=$slib_script1\ |
79 | $( |
82 | $(slib_jxP)$slib_i=$slib_brd.create('point',[$(slib_p[$slib_i]),$slib_h], {$slib_font$slib_fixme}); |
80 | !else |
83 | !else |
81 | !set slib_script1=$slib_script1\ |
84 | !set slib_script1=$slib_script1\ |
82 | $( |
85 | $(slib_jx)glider$slib_i=$slib_brd.create('glider',[$(slib_jxv)$slib_i,$slib_h,Axe],{$slib_font$slib_fixme});\ |
83 | - | ||
- | 86 | $(slib_jxP)$slib_i=brd.create('point',[function(){return $(slib_jx)glider$slib_i.X()},function(){return $(slib_jx)glider$slib_i.Y()}],{$slib_font$slib_fixme}); |
|
84 | !endif |
87 | !endif |
85 | !next |
88 | !next |
- | 89 | ||
86 | !if $slib_ch=5 |
90 | !if $slib_ch=5 |
87 | !set slib_scriptmove=$slib_brd.on('move', function(){\ |
91 | !set slib_scriptmove=$slib_brd.on('move', function(){\ |
88 | $( |
92 | $(slib_jxP)1.moveTo([Math.min($(slib_jxP)1.X(),$(slib_jxP)2.X()), $slib_h]);\ |
89 | $( |
93 | $(slib_jxP)2.moveTo([Math.min($(slib_jxP)2.X(),$(slib_jxP)3.X()), $slib_h]);\ |
90 | $( |
94 | $(slib_jxP)3.moveTo([Math.min($(slib_jxP)3.X(),$(slib_jxP)4.X()), $slib_h]);\ |
91 | $( |
95 | $(slib_jxP)4.moveTo([Math.min($(slib_jxP)4.X(),$(slib_jxP)5.X()), $slib_h]);\ |
92 | $( |
96 | $(slib_jxP)5.moveTo([Math.max($(slib_jxP)4.X(),$(slib_jxP)5.X()), $slib_h]); |
93 | 97 | ||
94 | !else |
98 | !else |
95 | !set slib_scriptmove=$slib_brd.on('move', function(){\ |
99 | !set slib_scriptmove=$slib_brd.on('move', function(){\ |
96 | $( |
100 | $(slib_jxP)1.moveTo([Math.min($(slib_jxP)1.X(),$(slib_jxP)2.X()), $slib_h]);\ |
97 | $( |
101 | $(slib_jxP)2.moveTo([Math.min($(slib_jxP)2.X(),$(slib_jxP)3.X()), $slib_h]);\ |
98 | $( |
102 | $(slib_jxP)3.moveTo([$(slib_jxP)3.X(), $slib_h]); |
99 | !endif |
103 | !endif |
100 | 104 | ||
101 | !set slib_scriptmove=$slib_scriptmove }); |
105 | !set slib_scriptmove=$slib_scriptmove }); |
102 | !if $slib_ch=5 |
106 | !if $slib_ch=5 |
103 | !set slib_script2=\ |
107 | !set slib_script2=\ |
104 | $(slib_jx)_pt1m=$slib_brd.create('point',[function(){return $( |
108 | $(slib_jx)_pt1m=$slib_brd.create('point',[function(){return $(slib_jxP)1.X()},$slib_h2], {$slib_font,visible:false});\ |
105 | $(slib_jx)_pt1p=$slib_brd.create('point',[function(){return $( |
109 | $(slib_jx)_pt1p=$slib_brd.create('point',[function(){return $(slib_jxP)1.X()},$slib_h1], {$slib_font,visible:false});\ |
106 | $(slib_jx)_pt5m=$slib_brd.create('point',[function(){return $( |
110 | $(slib_jx)_pt5m=$slib_brd.create('point',[function(){return $(slib_jxP)5.X()},$slib_h2], {$slib_font,visible:false});\ |
107 | $(slib_jx)_pt5p=$slib_brd.create('point',[function(){return $( |
111 | $(slib_jx)_pt5p=$slib_brd.create('point',[function(){return $(slib_jxP)5.X()},$slib_h1], {$slib_font,visible:false});\ |
108 | $(slib_jx)_pt2m=$slib_brd.create('point',[function(){return $( |
112 | $(slib_jx)_pt2m=$slib_brd.create('point',[function(){return $(slib_jxP)2.X()},$slib_h4], {$slib_font,visible:false});\ |
109 | $(slib_jx)_pt2p=$slib_brd.create('point',[function(){return $( |
113 | $(slib_jx)_pt2p=$slib_brd.create('point',[function(){return $(slib_jxP)2.X()},$slib_h3], {$slib_font,visible:false});\ |
110 | $(slib_jx)_pt3m=$slib_brd.create('point',[function(){return $( |
114 | $(slib_jx)_pt3m=$slib_brd.create('point',[function(){return $(slib_jxP)3.X()},$slib_h4], {$slib_font,visible:false});\ |
111 | $(slib_jx)_pt3p=$slib_brd.create('point',[function(){return $( |
115 | $(slib_jx)_pt3p=$slib_brd.create('point',[function(){return $(slib_jxP)3.X()},$slib_h3], {$slib_font,visible:false});\ |
112 | $(slib_jx)_pt4m=$slib_brd.create('point',[function(){return $( |
116 | $(slib_jx)_pt4m=$slib_brd.create('point',[function(){return $(slib_jxP)4.X()},$slib_h4], {$slib_font,visible:false});\ |
113 | $(slib_jx)_pt4p=$slib_brd.create('point',[function(){return $( |
117 | $(slib_jx)_pt4p=$slib_brd.create('point',[function(){return $(slib_jxP)4.X()},$slib_h3], {$slib_font,visible:false});\ |
114 | 118 | ||
115 | !set slib_script3=\ |
119 | !set slib_script3=\ |
116 | $slib_brd.create('line',[$( |
120 | $slib_brd.create('line',[$(slib_jxP)1,$(slib_jxP)2],{straightFirst:false, straightLast:false});\ |
117 | $slib_brd.create('line',[$( |
121 | $slib_brd.create('line',[$(slib_jxP)4,$(slib_jxP)5],{straightFirst:false, straightLast:false});\ |
118 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt1p],{straightFirst:false, straightLast:false});\ |
122 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt1p],{straightFirst:false, straightLast:false});\ |
119 | $slib_brd.create('line',[$(slib_jx)_pt5m,$(slib_jx)_pt5p],{straightFirst:false, straightLast:false});\ |
123 | $slib_brd.create('line',[$(slib_jx)_pt5m,$(slib_jx)_pt5p],{straightFirst:false, straightLast:false});\ |
120 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt2p],{straightFirst:false, straightLast:false});\ |
124 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt2p],{straightFirst:false, straightLast:false});\ |
121 | $slib_brd.create('line',[$(slib_jx)_pt3m,$(slib_jx)_pt3p],{straightFirst:false, straightLast:false});\ |
125 | $slib_brd.create('line',[$(slib_jx)_pt3m,$(slib_jx)_pt3p],{straightFirst:false, straightLast:false});\ |
122 | $slib_brd.create('line',[$(slib_jx)_pt4m,$(slib_jx)_pt4p],{straightFirst:false, straightLast:false});\ |
126 | $slib_brd.create('line',[$(slib_jx)_pt4m,$(slib_jx)_pt4p],{straightFirst:false, straightLast:false});\ |
123 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt4m],{straightFirst:false, straightLast:false});\ |
127 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt4m],{straightFirst:false, straightLast:false});\ |
124 | $slib_brd.create('line',[$(slib_jx)_pt2p,$(slib_jx)_pt4p],{straightFirst:false, straightLast:false}); |
128 | $slib_brd.create('line',[$(slib_jx)_pt2p,$(slib_jx)_pt4p],{straightFirst:false, straightLast:false}); |
125 | 129 | ||
126 | !else |
130 | !else |
127 | !set slib_script2=\ |
131 | !set slib_script2=\ |
128 | $(slib_jx)_pt1m=$slib_brd.create('point',[function(){return $( |
132 | $(slib_jx)_pt1m=$slib_brd.create('point',[function(){return $(slib_jxP)1.X()},$slib_h4], {$slib_font,visible:false});\ |
129 | $(slib_jx)_pt1p=$slib_brd.create('point',[function(){return $( |
133 | $(slib_jx)_pt1p=$slib_brd.create('point',[function(){return $(slib_jxP)1.X()},$slib_h3], {$slib_font,visible:false});\ |
130 | $(slib_jx)_pt2m=$slib_brd.create('point',[function(){return $( |
134 | $(slib_jx)_pt2m=$slib_brd.create('point',[function(){return $(slib_jxP)2.X()},$slib_h4], {$slib_font,visible:false});\ |
131 | $(slib_jx)_pt2p=$slib_brd.create('point',[function(){return $( |
135 | $(slib_jx)_pt2p=$slib_brd.create('point',[function(){return $(slib_jxP)2.X()},$slib_h3], {$slib_font,visible:false});\ |
132 | $(slib_jx)_pt3m=$slib_brd.create('point',[function(){return $( |
136 | $(slib_jx)_pt3m=$slib_brd.create('point',[function(){return $(slib_jxP)3.X()},$slib_h4], {$slib_font,visible:false});\ |
133 | $(slib_jx)_pt3p=$slib_brd.create('point',[function(){return $( |
137 | $(slib_jx)_pt3p=$slib_brd.create('point',[function(){return $(slib_jxP)3.X()},$slib_h3], {$slib_font,visible:false});\ |
134 | 138 | ||
135 | !set slib_script3=\ |
139 | !set slib_script3=\ |
136 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt1p],{straightFirst:false, straightLast:false});\ |
140 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt1p],{straightFirst:false, straightLast:false});\ |
137 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt2p],{straightFirst:false, straightLast:false});\ |
141 | $slib_brd.create('line',[$(slib_jx)_pt2m,$(slib_jx)_pt2p],{straightFirst:false, straightLast:false});\ |
138 | $slib_brd.create('line',[$(slib_jx)_pt3m,$(slib_jx)_pt3p],{straightFirst:false, straightLast:false});\ |
142 | $slib_brd.create('line',[$(slib_jx)_pt3m,$(slib_jx)_pt3p],{straightFirst:false, straightLast:false});\ |
139 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt3m],{straightFirst:false, straightLast:false});\ |
143 | $slib_brd.create('line',[$(slib_jx)_pt1m,$(slib_jx)_pt3m],{straightFirst:false, straightLast:false});\ |
Line 145... | Line 149... | ||
145 | $slib_script2\ |
149 | $slib_script2\ |
146 | $slib_script3 |
150 | $slib_script3 |
147 | 151 | ||
148 | !if anstype iswordof $slib_opt |
152 | !if anstype iswordof $slib_opt |
149 | slib_out=$slib_jx $slib_brd Y=$slib_h\ |
153 | slib_out=$slib_jx $slib_brd Y=$slib_h\ |
150 |
|
154 | $slib_out |
- | 155 | ||
- | 156 | slib_out=$slib_out |
|
- | 157 | ||
151 |
|
158 | !for slib_i=1 to $slib_ch |
- | 159 | slib_out=$slib_out$(slib_jxr)$slib_i=$(slib_jxP)$slib_i; |
|
- | 160 | !next |
|
- | 161 | slib_out=$slib_out\ |
|
- | 162 | ||
152 | !for |
163 | !for slib_i=1 to $slib_ch |
153 |
|
164 | slib_out=$slib_out$(slib_jxv)$slib_i=$(slib_p[$slib_i]); |
154 | !next |
165 | !next |
155 | !else |
166 | !else |
156 | !if raw notwordof $slib_opt |
167 | !if raw notwordof $slib_opt |
157 | !readproc slib/geo2D/jsxgraph $slib_jx,$(slib_xsize) x $(slib_ysize),$slib_out |
168 | !readproc slib/geo2D/jsxgraph $slib_jx,$(slib_xsize) x $(slib_ysize),$slib_out |
158 | !endif |
169 | !endif |