mneumann
Scenic.FromSVG - Rapid UI prototyping for Scenic
TLDR; Prototype your Scenic UI scenes in Inkscape or other SVG editors, then quickly fire it up in Scenic for display or generate code representing Scenic primitives that you can then hand-modify to your needs.
While it can display SVG already pretty well, by translating SVG to Scenic drawing primitives, either at runtime or compile-time, it’s not intended to be a general purpose SVG viewer.
More information, sources and packages:
Most Liked
Eiji
That’s very interesting! If you don’t mind here are some ideas:
-
It’s fine that it converts
SVGcode like it does now, but another interesting feature would be to generate the fullScenepage, so the generated code could be easy to modify. -
It would be amazing if you could support also
SMILespecially together with 1st point would allow to convert automatically generatedSVGimages and import them inscenic-based project, see exampleSVG+SMILgenerator: https://loaders.holasvg.com/ -
I believe that
parse_color/1should support allHTMLcolor names + they should be lowercased before matching on them, see: Color Names – HTML Color Codes -
Functions in module
Scenic.FromSVG.Pathdoes not have any documentation and specification. I would also consider to add at least one example to each function since not everyone interested in library may known wellscenic. -
Consider using
String.t()instead ofbinary. I would even write asvgtype, so in specification users would firstly seesvginstead ofbinary. If you do not want to introduce a new type you can always writesvg :: binaryin the function specification.
mneumann
Hi Eiji,
Thanks a lot for your valuable input.
- A mix “generator” task, right? mix scenic.from_svg.gen …
- SMIL - that sounds like a separate project :). Definitively interesting. Are there any open-source editors that produce SMIL animations?
- Good point. Will add all HTML color codes.
- I will simplify the interface and only expose one public function, and document it. The
Scenic.FromSVG.Pathwas actually intended to be a private module… bu that’s something that Elixir doesn’t have, I guess
- Having separate type for
svgmakes sense!
Thanks again for you input!
axelson
Nice library!
In the past for fun I’ve experimented with SVG parsing for scenic by using nimble parsec. I’m not sure if any of the details will be especially interesting to you but here is the code:
Although I guess I don’t parsed named web colors.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










