SnapSVG-Animator
SnapSVG-Animator copied to clipboard
Compress Output
There should be an option in the publish settings to output optimized compressed javascript.
Using r.js optimizer. This should run on the main.js file.
- [x] I need to set up build.js so that it includes the json within the build rather than the xhr request. Will probably send a sample output to show how the files need to be in that case.
Added an option to minify JSON output.
Changed publish setting option "Minify JSON" to "Minify". This option will allow users to minify both JSON and runtime. This option will be enabled by default.
Empty command will not be generated for frames with no change.
Few more changes to done to reduce output size:
- Added an option "Compact Data" in the publish settings. This can be used by the user to configure the desired precision of the floating point numbers. By default, this option is on and is set to "High" which means precision of 3 (maximum of 3 digits after decimal point) will be used.This results in significant reduction of JSON size. If this option is turned off, then the precision of 6 is used. Also, trailing zeroes in the floating point numbers are removed.
- Changed the path data to use relative co-ordinates for Curveto (bezier curve) and LineTo commands. Using relative co-ordinates reduces the JSON file size.
- Unnecessary white-spaces in the path string has been removed if "Minify" option is turned on.
Has this been added?