Rev 7823 | Rev 7838 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7823 | Rev 7833 | ||
---|---|---|---|
Line 125... | Line 125... | ||
125 | int font_size = 12; |
125 | int font_size = 12; |
126 | int dashtype[2] = { 2 , 2 }; |
126 | int dashtype[2] = { 2 , 2 }; |
127 | int js_function[MAX_JS_FUNCTIONS]; /* javascript functions include objects on demand basis : only once per object type */ |
127 | int js_function[MAX_JS_FUNCTIONS]; /* javascript functions include objects on demand basis : only once per object type */ |
128 | for(i=0;i<MAX_JS_FUNCTIONS;i++){js_function[i]=0;} |
128 | for(i=0;i<MAX_JS_FUNCTIONS;i++){js_function[i]=0;} |
129 | int arrow_head = 8; /* size in px*/ |
129 | int arrow_head = 8; /* size in px*/ |
130 | int crosshair_size = |
130 | int crosshair_size = 5; /* size in px*/ |
131 | int plot_steps = 250; |
131 | int plot_steps = 250; |
132 | int found_size_command = 0; |
132 | int found_size_command = 0; |
133 | int click_cnt = 1; |
133 | int click_cnt = 1; |
134 | int clock_cnt = 0; /* counts the amount of clocks used -> unique object clock%d */ |
134 | int clock_cnt = 0; /* counts the amount of clocks used -> unique object clock%d */ |
135 | int linegraph_cnt = 0; /* identifier for command 'linegraph' ; multiple line graphs may be plotted in a single plot*/ |
135 | int linegraph_cnt = 0; /* identifier for command 'linegraph' ; multiple line graphs may be plotted in a single plot*/ |
Line 1258... | Line 1258... | ||
1258 | case TRACE_JSMATH: |
1258 | case TRACE_JSMATH: |
1259 | /* |
1259 | /* |
1260 | @trace_jsmath some_javascript_math_function |
1260 | @trace_jsmath some_javascript_math_function |
1261 | @will use a crosshair to trace the jsmath curve |
1261 | @will use a crosshair to trace the jsmath curve |
1262 | @two inputfields will display the current x/y-values (approximated) |
1262 | @two inputfields will display the current x/y-values (approximated) |
- | 1263 | @default labels 'x' and 'y'<br />the commands 'xlabel some_x_axis_name' and 'ylabel some_y_axis_name' will set the label for the input fields |
|
1263 | @use linewidth,strokecolor,crosshairsize to adjust the corsshair. |
1264 | @use linewidth,strokecolor,crosshairsize to adjust the corsshair. |
1264 | @example: trace_jsmath Math.pow(x,2)+4*x+16 |
1265 | @example: trace_jsmath Math.pow(x,2)+4*x+16 |
1265 | @example: trace_jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1266 | @example: trace_jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1266 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
1267 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
- | 1268 | @can not be combined with commands 'mouse color,fontsize' and 'intooltip tip_text' |
|
1267 | */ |
1269 | */ |
- | 1270 | if(use_mouse_coordinates == TRUE){canvas_error("trace_jsmath can not be combined with command 'mouse'");} |
|
- | 1271 | if(use_tooltip == TRUE){canvas_error("trace_jsmath can not be combined with command 'tooltip':it uses the same 'tooltip div' placeholeder");}; |
|
- | 1272 | use_mouse_coordinates = TRUE; /* will add & call function "use_mouse_coordinates(){}" in current_canvas /current_context */ |
|
1268 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1273 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
- | 1274 | if( js_function[DRAW_LINES] != 1 ){ js_function[DRAW_LINES] = 1;} |
|
1269 | add_trace_js_mouse(js_include_file,TRACE_CANVAS,canvas_root_id,stroke_color,get_string(infile,1),font_size,stroke_opacity,line_width,crosshair_size); |
1275 | add_trace_js_mouse(js_include_file,TRACE_CANVAS,canvas_root_id,stroke_color,get_string(infile,1),font_size,stroke_opacity,line_width,crosshair_size); |
1270 | if(use_mouse_coordinates == TRUE){canvas_error("trace_jsmath can not be combined with command 'mouse'");} |
- | |
1271 | use_mouse_coordinates = TRUE; /* will add & call function "use_mouse_coordinates(){}" in current_canvas /current_context */ |
- | |
1272 | - | ||
1273 | break; |
1276 | break; |
1274 | case JSMATH: |
1277 | case JSMATH: |
1275 | /* |
1278 | /* |
1276 | @jsmath some_javascript_math_function |
1279 | @jsmath some_javascript_math_function |
1277 | @will calculate an y-value from a userinput x-value and draws a crosshairs on these coordinates. |
1280 | @will calculate an y-value from a userinput x-value and draws a crosshairs on these coordinates. |
- | 1281 | @default labels 'x' and 'y'<br />the commands 'xlabel some_x_axis_name' and 'ylabel some_y_axis_name' will set the label for the input fields |
|
1278 | @example: jsmath Math.pow(x,2)+4*x+16 |
1282 | @example: jsmath Math.pow(x,2)+4*x+16 |
1279 | @example: jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1283 | @example: jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1280 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
1284 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
- | 1285 | @can not be combined with commands 'mouse color,fontsize' and 'intooltip tip_text' |
|
1281 | */ |
1286 | */ |
- | 1287 | if(use_mouse_coordinates == TRUE){canvas_error("trace_jsmath can not be combined with command 'mouse'");} |
|
- | 1288 | if(use_tooltip == TRUE){canvas_error("trace_jsmath can not be combined with command 'tooltip':it uses the same 'tooltip div' placeholeder");}; |
|
- | 1289 | use_mouse_coordinates = TRUE; /* will add & call function "use_mouse_coordinates(){}" in current_canvas /current_context */ |
|
1282 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1290 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1283 | add_calc_y(js_include_file,canvas_root_id,get_string(infile,1)); |
1291 | add_calc_y(js_include_file,canvas_root_id,get_string(infile,1)); |
1284 | break; |
1292 | break; |
1285 | case CURVE: |
1293 | case CURVE: |
1286 | /* |
1294 | /* |