Cogent Core Docs

0%

Loading...

Static preview:

SVG

An SVG widget renders SVG data.

If you have image files instead of SVG files, use an image widget. For more programmatic control of rendering, you can use a canvas. For rendering HTML, see HTML.

Properties

You should load SVG files by embedding them so that they work across all platforms:

Then, you can open an SVG file from your embedded filesystem:

You can change the size of an SVG:

You can make it so that users can pan and zoom the SVG:

You can directly set an SVG from an SVG data string:

You can also open SVGs directly from the system filesystem, but this is not recommended for SVGs built into your app, since they will end up in a different location on different platforms: