Conflict with RGraph and Minify


« 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:
github.com/mrclay/minify/issues/459

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.

thanks!
Posted by Richard on 11th October 2015
Hi,

If you update the bit of the line to this:

Number(0).toFixed(

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

Richard
If RGraph has helped you - please share the website and give your feedback - thanks! You can give your feedback or leave a testimonial by adding a forum post
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:

eblog.stac.school.nz/2015/10/09/integrating-student-data-into-moodle/

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

www.rgraph.net/RGraph.minified.zip

Richard
Posted by Dan Marsden on 15th October 2015
Thanks!

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: tracker.moodle.org/browse/MDL-35686
Posted by Richard on 15th October 2015
Hi,

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 (www.rgraph.net/changelog).


Richard
If RGraph has helped you - please share the website and give your feedback - thanks!

www.rgraph.net/testimonials

Add a reply

 




« Back to message list
RGraph on social media