SVG use in STACK/Moolde

SVG use in STACK/Moolde

by Christopher Sangwin -
Number of replies: 5
Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear all,

I'm currently in the process of considering a change in the way STACK generates images.  In particular in moving away from .png images to SVG.

For example a current plot looks like this:

Plot of three functions.

These images are generated by GNUplot, which can also generate SVG, such as
Four plots.

I think SVG is really the way to go, especially on mobile devices. Does anyone have experience of using SVG?  Would anyone be able to offer advice or comment on native cross browser support for SVG?  Would any existing STACK users object to SVG becoming the default in STACK v4.1?

Thanks for your help,

Chris

Average of ratings: Useful (3)
In reply to Christopher Sangwin

Re: SVG use in STACK/Moolde

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

This would be an awesomely good change. Thanks Chris. (At the OU, and in core Moodle Themes, we are now using SVG for pretty much everything else.)

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: SVG use in STACK/Moolde

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Well, that was easy!  Thanks Tim.

I'll look at the prototype code and tighten this up.  PNG will remain a viable option, but unless people raise objections we will probably switch SVG to be the default in the near future.

Chris


Average of ratings: Useful (1)
In reply to Christopher Sangwin

Re: SVG use in STACK/Moolde

by Daniel Thies -
Picture of Core developers Picture of Plugin developers Picture of Testers

There is a function for detecting browser support core_useragent::supports_svg(). but I do not know that any currently supported browser does not support SVG.

In reply to Daniel Thies

Re: SVG use in STACK/Moolde

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks all,

It looks like I'm going to switch from .png as the default to .svg in the very near 4.0.1 release.  If you want SVG just hold of upgrading for a very short while.  If you don't want SVG as the default, please let me know soon!

Chris