[RkWard-devel] grid inplot_options

Prasenjit Kapat kapatp at gmail.com
Wed Mar 21 07:10:36 UTC 2007


Hi,

On Sunday 18 March 2007 11:11:39 am Thomas Friedrichsmeier wrote:
> P.S.: Are you planning to work on making the grid() plugin embeddable and
> embedding it into plot_options before 0.4.7? If not, I'll move it form
> under_development to x11device.

I have given this a shot. Not very elegant though. But does the job. It is 
implemented in the following way:

1. grid.xml has an external id: is_embed to notify whether it is embeded or 
not. This needs to be set from the embedding plugin (plot_options.xml in this 
case)
2. grid.php's printout function echos the neccessary code: grid(...).
3. plot_options.xml uses another external id allow_grid to control whether 
grid options are to be shown at all or not.
4. If allow_grid is true then a checkbox (add_grid) controls whether grid is 
to be added to the current plot or not.
5. Now, from the main plugin (say, plot_beta_distribution.xml) we set 
plot_options.allow_grid to 'true'.
6. The calculate() function of plot_beta_distribution.php obtains the 
neccessary code from plot_options.grid_options.code.printout and stores it 
into a global variable.
7. Finally, to actually draw the grid, the aobve variable is echoed after the 
try(curve(..)) function call.

As of now, I have only included in plot_beta_distribution plugin. Any 
improvements are welcome.

Regards
PK




More information about the Rkward-devel mailing list