Rev 7838 | Rev 7842 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7838 | Rev 7839 | ||
---|---|---|---|
Line 131... | Line 131... | ||
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*/ |
136 | int use_mouse_coordinates = FALSE; |
- | |
137 | double angle = 0.0; |
136 | double angle = 0.0; |
138 | int translate_x = 0; |
137 | int translate_x = 0; |
139 | int translate_y = 0; |
138 | int translate_y = 0; |
140 | int clickfillmarge = 20; |
139 | int clickfillmarge = 20; |
141 | int animation_type = 9; /* == object type curve in drag library */ |
140 | int animation_type = 9; /* == object type curve in drag library */ |
Line 1265... | Line 1264... | ||
1265 | @example: trace_jsmath Math.pow(x,2)+4*x+16 |
1264 | @example: trace_jsmath Math.pow(x,2)+4*x+16 |
1266 | @example: trace_jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1265 | @example: trace_jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1267 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
1266 | @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 | @can not be combined with commands 'mouse color,fontsize' and 'intooltip tip_text' |
1269 | */ |
1268 | */ |
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 */ |
- | |
1273 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1269 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1274 | if( js_function[DRAW_LINES] != 1 ){ js_function[DRAW_LINES] = 1;} |
1270 | if( js_function[DRAW_LINES] != 1 ){ js_function[DRAW_LINES] = 1;} |
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); |
1271 | 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); |
1276 | break; |
1272 | break; |
1277 | case JSMATH: |
1273 | case JSMATH: |
Line 1282... | Line 1278... | ||
1282 | @example: jsmath Math.pow(x,2)+4*x+16 |
1278 | @example: jsmath Math.pow(x,2)+4*x+16 |
1283 | @example: jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1279 | @example: jsmath Math.sin(Math.pow(x,Math.Pi))+Math.sqrt(x) |
1284 | @no check is done on the validity of your function and/or syntax<br />use error console to debug any errors... |
1280 | @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 | @can not be combined with commands 'mouse color,fontsize' and 'intooltip tip_text' |
1286 | */ |
1282 | */ |
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 */ |
- | |
1290 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1283 | if( js_function[DRAW_CROSSHAIRS] != 1 ){ js_function[DRAW_CROSSHAIRS] = 1;} |
1291 | add_calc_y(js_include_file,canvas_root_id,get_string(infile,1)); |
1284 | add_calc_y(js_include_file,canvas_root_id,get_string(infile,1)); |
1292 | break; |
1285 | break; |
1293 | case CURVE: |
1286 | case CURVE: |
1294 | /* |
1287 | /* |
Line 2083... | Line 2076... | ||
2083 | case MOUSE: |
2076 | case MOUSE: |
2084 | /* |
2077 | /* |
2085 | @ mouse color,fontsize |
2078 | @ mouse color,fontsize |
2086 | @ will display the cursor coordinates in 'color' and 'font size'<br /> using default fontfamily Ariel |
2079 | @ will display the cursor coordinates in 'color' and 'font size'<br /> using default fontfamily Ariel |
2087 | */ |
2080 | */ |
2088 | if(use_mouse_coordinates == TRUE){canvas_error("trace_jsmath can not be combined with command 'mouse'");} |
- | |
2089 | use_mouse_coordinates = TRUE; /* will add & call function "use_mouse_coordinates(){}" in current_canvas /current_context */ |
- | |
2090 | stroke_color = get_color(infile,0); |
2081 | stroke_color = get_color(infile,0); |
2091 | font_size = (int) (get_real(infile,1)); |
2082 | font_size = (int) (get_real(infile,1)); |
- | 2083 | tmp_buffer = my_newmem(26); |
|
- | 2084 | snprintf(tmp_buffer,25,"use_mouse_coordinates();\n");add_to_buffer(tmp_buffer); |
|
2092 | add_js_mouse(js_include_file,MOUSE_CANVAS,canvas_root_id,precision,stroke_color,font_size,stroke_opacity); |
2085 | add_js_mouse(js_include_file,MOUSE_CANVAS,canvas_root_id,precision,stroke_color,font_size,stroke_opacity); |
2093 | break; |
2086 | break; |
2094 | case INTOOLTIP: |
2087 | case INTOOLTIP: |
2095 | /* |
2088 | /* |
2096 | @ intooltip link_text |
2089 | @ intooltip link_text |
Line 2747... | Line 2740... | ||
2747 | 2740 | ||
2748 | /* if needed, add generic draw functions (grid / xml etc) to buffer : these are no draggable shapes / objects ! */ |
2741 | /* if needed, add generic draw functions (grid / xml etc) to buffer : these are no draggable shapes / objects ! */ |
2749 | add_javascript_functions(js_function,canvas_root_id); |
2742 | add_javascript_functions(js_function,canvas_root_id); |
2750 | /* add read_canvas() etc functions if needed */ |
2743 | /* add read_canvas() etc functions if needed */ |
2751 | if( reply_format > 0 ){ add_read_canvas(reply_format);} |
2744 | if( reply_format > 0 ){ add_read_canvas(reply_format);} |
2752 | /* using mouse coordinate display ? */ |
- | |
2753 | if( use_mouse_coordinates == TRUE ){ |
- | |
2754 | tmp_buffer = my_newmem(26); |
- | |
2755 | snprintf(tmp_buffer,25,"use_mouse_coordinates();\n");add_to_buffer(tmp_buffer); |
- | |
2756 | } |
- | |
2757 | if( use_pan_and_zoom == TRUE ){ |
2745 | if( use_pan_and_zoom == TRUE ){ |
2758 | /* in case of zooming ... */ |
2746 | /* in case of zooming ... */ |
2759 | fprintf(js_include_file,"\n<!-- some extra global stuff : need to rethink panning and zooming !!! -->\n\ |
2747 | fprintf(js_include_file,"\n<!-- some extra global stuff : need to rethink panning and zooming !!! -->\n\ |
2760 | precision = %d;var xmin_start=xmin;var xmax_start=xmax;\ |
2748 | precision = %d;var xmin_start=xmin;var xmax_start=xmax;\ |
2761 | var ymin_start=ymin;var ymax_start=xmax;\ |
2749 | var ymin_start=ymin;var ymax_start=xmax;\ |