On 7/26/16, 8:19 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>Both.
>
>In SVG we're actually struggling with the same (or rather similar) issue.
>
>There’s a big difference between:
><div><svg><rect/></svg><svg><circle/></svg></div>
>
>and 
><div><svg><g><rect/><circle/></g></svg></div>
>
>Each svg has its own coordinate space, and svg elements cannot have
>transform properties. This is proving to be quite difficult in terms of
>transformations.
>
>Ideally, it should be easy to pick whether you want to wrap each shape in
>its own SVG element or have them all in the same svg element (or g
>element). Currently GraphicShape draws each shape with its own svg
>wrapper. CompoundShape, on the other hand, draws separate objects within
>a single svg element. GraphicContainer takes svg-type elements as
>children, but does not care exactly which type.
>
>I think there should also be a GraphicGroup object which would be a g
>element and take children.
>
>I’m struggling with how to specify whether svg element have the svg
>wrapper and not. (Ideas welcome!)

IMO, I suspect there exist SVG snippets in the world that folks might want
to repurpose into their FlexJS apps.  Having a simple 1:1 mapping between
tags is probably the best strategy.  Are folks worried about the overhead
of that verbosity?  IMO, it is always possible to provide aggregations,
but aggregations make assumptions and often someone will come back and ask
for the low-level.

For example, in Flex Spark (and FlexJS) specifying a layout for a
container takes 3 lines:

<Container>
  <layout>
    <VerticalLayout />
  </layout>
</Container>

In Flex MX, it is one line:

<Container layout="Vertical" />

The problem is that you can't specify other properties on the
VerticalLayout in MX, and Horizontal and Absolute layout are baked into
the MX container and are linked into your code, and you can't add new
layouts.

So for graphics, if I understand the issue, why not add a <g> or <Group>
tag and make folks use it where they need it?

My 2 cents,
-Alex

Reply via email to