#N struct pieslicer float x float y float cx float cy float x1 float
y1 float r float flag float x2 float y2 float r1 float g float b float
s float tx float ty;
#N canvas 0 19 929 640 10;
#X scalar pieslicer 380 -50 300 300 500 300 200 1 237.416 489.956 10
80 250 1 0 0 \;;
#X scalar pieslicer 380 -50 300 300 237.416 489.956 200 0 491.793 356.705
255 0 255 1 0 0 \;;
#X scalar pieslicer 380 -50 300 300 491.793 356.705 200 0 500 300 255
50 10 1 0 0 \;;
#X obj 227 275 classinfo draw;
#X msg 227 253 size;
#X msg 345 228 size;
#X obj 345 249 classinfo canvas;
#X msg 362 279 size;
#X obj 362 300 classinfo curve;
#X obj 331 346 +;
#X obj 348 385 +;
#X floatatom 349 415 5 0 0 1 total - -, f 5;
#X floatatom 184 447 5 0 0 0 angleplus - -, f 5;
#X obj 228 368 t a;
#X obj 228 389 * 360;
#X obj 228 420 /;
#X msg 280 441 0;
#X obj 265 477 f;
#N canvas 178 176 726 457 sector 0;
#X obj 60 35 inlet;
#X text 100 36 cx;
#X obj 130 35 inlet;
#X text 170 36 cy;
#X obj 200 35 inlet;
#X text 240 36 r;
#X obj 270 35 inlet;
#X text 310 36 angle;
#X obj 370 35 inlet;
#X text 410 36 angle+angleplus;
#X obj 124 139 v cx;
#X obj 162 100 v cy;
#X obj 228 97 v r;
#X obj 295 99 v startangle;
#X obj 406 94 v endangle;
#X obj 60 56 t b a;
#X obj 567 50 loadbang;
#X obj 567 93 / 180;
#X obj 470 279 loadbang;
#X obj 470 321 pointer;
#X obj 60 270 t b b b a;
#X obj 96 313 v r;
#X obj 66 313 v cy;
#X obj 26 313 v cx;
#X obj 567 114 v rad;
#X obj 51 378 append pieslicer cx cy r x1 x2 y1 y2 flag;
#X floatatom 321 313 5 0 0 0 - - -, f 5;
#X floatatom 251 313 5 0 0 0 - - -, f 5;
#X floatatom 201 313 5 0 0 0 - - -, f 5;
#X floatatom 525 117 5 0 0 0 - - -, f 5;
#X floatatom 161 313 5 0 0 0 - - -, f 5;
#X obj 60 197 expr cx + r * cos(-1 * startangle * rad) \; cx + r *
cos(-1 * endangle * rad) \; cy + r * sin(-1 * startangle * rad) \;
cy + r * sin(-1 * endangle * rad) \; (endangle - startangle) > 180
;
#X msg 470 300 traverse pieslice-canvas \, bang;
#X msg 567 71 3.14159;
#X connect 0 0 15 0;
#X connect 2 0 11 0;
#X connect 4 0 12 0;
#X connect 6 0 13 0;
#X connect 8 0 14 0;
#X connect 15 0 31 0;
#X connect 15 1 10 0;
#X connect 16 0 33 0;
#X connect 17 0 24 0;
#X connect 17 0 29 0;
#X connect 18 0 32 0;
#X connect 19 0 25 8;
#X connect 20 0 23 0;
#X connect 20 1 22 0;
#X connect 20 2 21 0;
#X connect 20 3 25 3;
#X connect 21 0 25 2;
#X connect 22 0 25 1;
#X connect 23 0 25 0;
#X connect 31 0 20 0;
#X connect 31 1 25 4;
#X connect 31 1 30 0;
#X connect 31 2 25 5;
#X connect 31 2 28 0;
#X connect 31 3 25 6;
#X connect 31 3 27 0;
#X connect 31 4 25 7;
#X connect 31 4 26 0;
#X connect 32 0 19 0;
#X connect 33 0 17 0;
#X restore 183 541 pd sector;
#X floatatom 89 474 0 0 0 0 cx - -;
#X floatatom 139 474 0 0 0 0 cy - -;
#X floatatom 184 474 5 0 0 0 r - -, f 5;
#X obj 228 477 +;
#X obj 69 200 draw path M cx cy L x1 y1 A r r 0 flag 0 x2 y2 z;
#X obj 228 441 t a b;
#X obj 69 143 loadbang;
#X obj 69 55 route enter leave;
#X obj 69 115 set pieslicer tx ty s;
#X msg 69 166 fill r1 g b \, fill-opacity 0.4 \, stroke black \, stroke-width
3 \, stroke-opacity 0.4 \, transform translate tx ty scale s;
#X obj 69 8 struct pieslicer float x float y float cx float cy float
x1 float y1 float r float flag float x2 float y2 float r1 float g float
b float s float tx float ty;
#X msg 69 84 -30 -30 1.1 \$1;
#X msg 174 84 0 0 1 \$1;
#X text 638 3 draw;
#X text 906 282 curve;
#X text 787 452 canvas;
#X text 367 474 A quick graph based on a Raphael demo. I left the messy
patch I used to generate the data from the sizes for the draw \, curve
\, and canvas classes. As you can see draw class is rather bloated
\, even compared to the canvas class.;
#X text 367 524 But it should be possible to make this more general
\, so you can plug in any classes and generate a pie chart.;
#X text 367 554 With this many members for the struct \, it becomes
obvious that the scalar "Properties" dialog needs to be more user-friendly.
Editing a long list of floats is simply too prone to error.;
#X text 778 516 Based on:;
#X obj 778 537 pddp/pddplink http://raphaeljs.com/pie.html;
#X obj 69 -16 namecanvas pieslice-canvas;
#X connect 3 0 9 0;
#X connect 3 0 13 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 9 1;
#X connect 6 0 13 0;
#X connect 7 0 8 0;
#X connect 8 0 10 1;
#X connect 8 0 13 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 10 0 15 1;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 12 0;
#X connect 15 0 24 0;
#X connect 16 0 17 1;
#X connect 17 0 18 3;
#X connect 17 0 22 1;
#X connect 19 0 18 0;
#X connect 20 0 18 1;
#X connect 21 0 18 2;
#X connect 22 0 18 4;
#X connect 22 0 17 1;
#X connect 24 0 22 0;
#X connect 24 1 17 0;
#X connect 25 0 28 0;
#X connect 26 0 30 0;
#X connect 26 1 31 0;
#X connect 28 0 23 0;
#X connect 29 0 26 0;
#X connect 30 0 27 0;
#X connect 31 0 27 0;
