SnapSVG-Animator icon indicating copy to clipboard operation
SnapSVG-Animator copied to clipboard

Compress Output

Open cjgammon opened this issue 9 years ago • 6 comments

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.

cjgammon avatar Jun 02 '15 04:06 cjgammon

  • [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.

cjgammon avatar Jun 13 '15 06:06 cjgammon

Added an option to minify JSON output.

kundugoutam avatar Jul 22 '15 06:07 kundugoutam

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.

kundugoutam avatar Jul 23 '15 06:07 kundugoutam

Empty command will not be generated for frames with no change.

kundugoutam avatar Jul 25 '15 07:07 kundugoutam

Few more changes to done to reduce output size:

  1. 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.
  2. 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.
  3. Unnecessary white-spaces in the path string has been removed if "Minify" option is turned on.

kundugoutam avatar Jul 27 '15 09:07 kundugoutam

Has this been added?

Mactastic1-5 avatar Mar 22 '17 19:03 Mactastic1-5