Skip to content

GraphicSVG 6.0.0

Compare
Choose a tag to compare
@CSchank CSchank released this 07 Dec 22:34
· 38 commits to master since this release

The transformation update!
GraphicSVG 6.0.0 fundamentally changes the way that transformations are handled compared to older versions (as well as Elm's old Graphics package on which GraphicSVG is based). Transformations are now handled in the order that they appear, better matching your mathematical intuition as well as providing better performance and more power to transform shapes in new ways.

What does this mean for you? Some of your old code may break if you have places where you've chained together many transformations. For simple cases where you use one transformation, you should be unaffected. To fix your code, it should be sufficient to simply rearrange your transformations. In particular, moves were essentially done after scales and rotates in the old system, so if you change your code such that moves happen last, that should help you make your code compatible with this release.

It also means you can more easily do fancy things like move a rectangle's end to the origin, then rotate it to make a pendulum! Here's a simple example that doesn't follow real physics:

pendulum t =
    rect 2 30
       |> filled brown
       |> move(0,-15)
       |> rotate (degrees <| 15 * sin t)

Other improvements / additions:

  • New transformations! Use functions like skewX and skewY to skew your shapes to your heart's content.
  • Custom transformations -- for advanced users, create your own transformations matrices and use them to transform your shapes
  • Outlining of groups! You can now use addOutline on groups to get outlines. There are a few caveats and limitations outlined in the documentation.
  • Better handling of notifications with outlined shapes
  • Miscellaneous other improvements

We thank all that helped to create and test this release, especially @GordonBGood for providing many of the features listed above.

Have fun! And as always, please post a GitHub issue if you find a bug.

Happy holidays!