There's a conflict with RGraph and the Moodle minifier

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Dan Marsden on 11th October 2015
Great library - thanks!

I'm using RGraph in a Moodle project which uses the Minify lib to compress and serve all JS.

RGraph.line.js Line 1526 has the following code:
+ (0).toFixed(

Which Minify converts to:
+ 0.toFixed(

Personally I think Minify shouldn't do this but unfortunately Minify have closed the issue that relates to this as won't fix:

Any chance you could modify the code to use a param instead of a number within the brackets - or modify that further to avoid this issue with minify? - I looked for a source code repo for Rgraph so I could submit a pull request but couldn't find one.

Posted by Richard on 11th October 2015

If you update the bit of the line to this:


And try minifying it again - does it come out OK? If it does I'll update the code to that.

Posted by Dan Marsden on 11th October 2015
Thanks Richard,

Yes - changing that to Number(0) prevents Minify from screwing with it.

our client has posted about the use of RGraph in their blog here if that's useful:

Posted by Richard on 13th October 2015
Thanks for that. Doug Crockfords jsmin is what I use to create the minified libraries here:

Posted by Dan Marsden on 15th October 2015

There has been a few discussions between the devs here at Moodle for a new graphing lib to include in core because the one we have currently is old/not maintained.

One of the significant difficulties I see in recommending RGraph is that there doesn't appear to be a public source-code repository for it - is there any particular reason you don't have one?

If you're interested in contributing to our discussion the tracker issue related to this is:
Posted by Richard on 15th October 2015

I do use SVN - though not as you might hope. 99% of my commit messages are: "misc". The only thing I use it for is tracking changes so that I update my changelog appropriately (


Add a reply

« Back to message list