There are any way to display dynamically loaded SVG in FLEX?
Flexbox can organize non-SVG DOM elements: You can't use Flexbox to arrange elements within SVG. That is, if you have a bunch of rect elements within your SVG, Flexbox can't move them. But, if you have several, separate SVG elements (think small multiples), Flexbox can arrange them for you.
Flex Start positions element at the start of the page. Flex End sets the element to the end of the page. Space Around arranges the items evenly but with spaces between them. The spaces will be equal among all the elements inside a flex-box container, but not outside them.
However, with flexbox, the images are fully responsive—you can test it by resizing the browser window. Another advantage is that now the images (flex items) can be easily positioned in different ways (we'll see how to do it below).
There's no "native" way to load and display SVG files dynamically.
From the latest flex documentation:
SVG drawing restrictions
- You can only embed an SVG file in an application; you cannot load one at run time
- SMIL and animation are not supported
- Masking and filters are not supported
- Pattern Fill and some advanced Gradients are not supported
- Interactivity and scripting is not supported
- SVG text is rendered as nonsearchable and nonselectable SWF shape outlines, meaning it is not rendered as native text in Flash Player or AIR
Alternatively you can use third-party libs to do the work, such as:
did you try spark.primitives.Path
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With