Tiki and PluginR

Tiki and PluginR

plot height not auto increasing ?

posts: 68 France

It looks like all of the plotting tries to fit in a small box. Isn't there a way to make the facet size ratio fixed and the height of the output image to be automatic ?

See picture :
F2c17593d41e08040aa3fcae17c1c41a 1

Actually here the vertical faceting can vary in this page from 1 to 60 groups and I want that RR plugin adapts the output size depending on hte data ?

Is this possible or do I need a ggplot2, R, PHP hack ?

By the way our stats get nicer day to day :

posts: 1817 Catalan Countries

Hi Joël:

This is something I never learned how to do in R. Yes, it's kind of handy to be able to do that, but I have no clue how to do that in R.

I did a quick search again (after so many years) and the only thing I saw is this:

asp= The aspect ratio for the plot, as specified for plot.window.

See the example in plot.window.

But anyway, it's not what I expected: some param to lock the aspect ratio, so that when you change the width, the heigth is adapted accordingly to keep the same aspect ratio.

I wonder why this is not included in the base packages of R.

If you manage to do it with R (and any of its packages), tell me the solution, that I'll do my best to include it in future versions of PluginR.


posts: 1817 Catalan Countries
By the way, nice online reports with live wikispiral data! :-)

posts: 68 France

Thanks !

I'll have a look to this question and the underlying Grid package.

If we cannot find a solution in R we will try a php solution (set up a width depending on the number of our coordination groups).

I will as well ask you another question about the caching system.

posts: 68 France

An answer is to use ggsave to give the output of a resulting png :
ggsave(filename="plot.png", plot=plot, width=10, height=50, scale=2, units="cm")

Then how to tell R to load this picture in the webpage ? And how to manage caching ?

posts: 68 France

I'll test this, seems to answer to the question.

But wouldn't RR override this setting ?

posts: 1817 Catalan Countries

See this, Joël:


You can register there, I guess, to play with it, if you wish. We haven't advertised r.tiki.org officially yet, but it's working (Intertiki is still not setup due to a bug in Tiki; so you'll have to register a new local user to that tiki site).

The pluginR calls, as they are, can't display the png or pdf graphs produced from the pluginR. BUT PluginR allows the generation of those charts on disk at the corresponding temp/cache/domain/page/ folder, and therefore, they can be displayed with fairly standard Tiki means: img and plugin mediaplayer for the pdf.

For the pdf to be displayed, you have to add pdf to the list of allowed file types under cache. Edit the temp/.htaccess to leave it something like:

< FilesMatch ".*"> order deny,allow deny from all < /FilesMatch> < FilesMatch "\.png"> order deny,allow allow from all < /FilesMatch> < FilesMatch "\.pdf"> order deny,allow allow from all < /FilesMatch> < FilesMatch "\.html"> order deny,allow allow from all < /FilesMatch>

Remove the space after the " < " in these contents for the htaccess to work (I had to add the space to avoid Tiki removing them considering that they could be dangerous code or something).

posts: 68 France
Plugin pending approval... Sorry ggsave didn't get along with R rights...