More and more users create SVG pictures to be used in HTML5 animations, or to replace classic linear presentation applications (like PREZI, but on SOZI with HTML5 compliance). We have to create multilayer SVG pictures to manage animation. But even if we create different layers in Draw, there are no more layers when it is exported to SVG format. (We still have to use Inkscape which provides real multilayers SVG pictures)
Which w3.org standard svg elements provides "layers"? In ODF, "The animation elements are based upon §3.5 and §12.5 of [SMIL20], and section §19.2 of [SVG]." with [SMIL20]=http://www.w3.org/TR/2005/REC-SMIL2-20050107/ [SVG]=http://www.w3.org/TR/2003/REC-SVG11-20030114/ For details see section "15 SMIL Animations" in http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html Can you please provide a standard conform svg document using "layers"? Inkscape "svg" <> standard svg. Draw does not have animation and Impress has no layers. It is not clear, what do you mean.
Standard SVG does not implement specific "layers" but groups with <g>, and layers can be seen as groups. I don't want to integrate animation in the SVG file, but to distinguish layers (groups) in order to animate then with a HTML5 page. Inkscape can find his layers while opening his SVG files by : <g id="layer2" inkscape:groupmode="layer" inkscape:label="..." DRAW could do the same : <g id="layer2" draw:groupmode="layer" or <g class="layer" id="layer2" Then, an application could detect these layers an create some animations by hiding, showing, moving groups, like SOZI does : http://sozi.baierouge.fr/images/tutorial-layers/sozi-layers-tutorial-full.svg
To me it looks like your request is not about "layers" but about groups. I think, introducing an own namespace should not be done; svg is rich enough to do all needed things in standard svg. Namespace "draw" would be a bad choice anyway, because it can be confused with ODF. Currently neither a page nor a group gets an identifier but only the individual shapes. I would support a request, that svg export should make the name of a group to an id-attribute of the <g>-element in svg. Such could be used in Impress too, where no user layers exists. It would be possible to put the layer into a class attribute, but it does not work well, because a group in Draw can contain shapes from different layers. Therefore the layer-information would only be meaningful for a single shape, but not for a group. Do you agree to take this bug report as request for an id-attribute for the <g>-element, which is generated for a group in Draw? If yes, the subject line should be changed accordingly.
Created attachment 120492 [details] Draw file with 4 objects, and 1 custom layer
(In reply to Regina Henschel from comment #3) > To me it looks like your request is not about "layers" but about groups. Yes. The Draw layers have to be exported as groups. > an own namespace should not be done OK > Currently neither a page nor a group gets an identifier but only the > individual shapes. I would support a request, that svg export should make > the name of a group to an id-attribute of the <g>-element in svg. Such could > be used in Impress too, where no user layers exists. Good ! > It would be possible to put the layer into a class attribute, but it does > not work well, because a group in Draw can contain shapes from different > layers. Oh ! I didn't know. OK. > Do you agree to take this bug report as request for an id-attribute for the > <g>-element, which is generated for a group in Draw? If yes, the subject > line should be changed accordingly. In a first step, yes. Is it enough to define "layers" ? Layers could be defined by : - a SVG goup (OK) - with an id (OK with the new request) - and that is *a direct child of the root SVG element*. ---- In the current SVG export, you can find the first SVG Child group as : <g> <g id="id2" class="Master_Slide"> <g id="bg-id2" class="Background"/> <g id="bo-id2" class="BackgroundObjects"/> </g> </g> What is it for ? ---- And then the next (and last) SVG child group with the SlideGroup class as : <g class="SlideGroup"> <g> <g id="id1" class="Slide" clip-path="url(#presentation_clip_path)"> <g class="Page"> <g class="com.sun.star.drawing.CustomShape"> <g id="id3"> [...] </g> </g> <g class="com.sun.star.drawing.TextShape"> <g id="id4"> [...] </g> </g> <g class="Group"> <g class="com.sun.star.drawing.CustomShape"> <g id="id5"> [...] </g> </g> <g class="com.sun.star.drawing.CustomShape"> <g id="id6"> [...] </g> </g> </g> </g> </g> </g> </g> Is there always only ONE SlideGroup ? Could the layers objects be separated in different SlideGroups with their own ID ? Thanks
You can have a look to an article about how Adobe Illustrator exports its layers : http://www.adobe.com/inspire/2013/09/exporting-svg-illustrator.html (At the bottom of the page)
The description of the request is detailed enough now, therefore I set it to new. At least using the id attribute of the <g>-element in svg would be a useful enhancement. I have no answer to your other questions.
(In reply to Regina Henschel from comment #7) > The description of the request is detailed enough now, therefore I set it to > new. At least using the id attribute of the <g>-element in svg would be a > useful enhancement. Thanks :-) > I have no answer to your other questions. I hope ID-ed groups (= layers) will be direct children of SVG element.
After working more on layers I think, my first idea to use the <g> element is not good. In Draw groups and layers are orthogonally to each others, because it is possible, that the elements in a group belong to different layers. You can group a shape together with a measure line, for example. Therefore I'll remove "group" from the subject. But I have a different idea. The purpose of layers is only to have the properties "visible", "printable" and "locked". You can define css rules for each layer and use the class attributes on the elements.
*** Bug 144848 has been marked as a duplicate of this bug. ***
(In reply to Regina Henschel from comment #9) > After working more on layers I think, my first idea to use the <g> element > is not good. In Draw groups and layers are orthogonally to each others, > because it is possible, that the elements in a group belong to different > layers. You can group a shape together with a measure line, for example. > Therefore I'll remove "group" from the subject. > > But I have a different idea. The purpose of layers is only to have the > properties "visible", "printable" and "locked". You can define css rules for > each layer and use the class attributes on the elements. Thanks Regina. I tried to clarify the "group by layer" idea in bug 144869, which you made clear has to be either a destructive option on the existing layer, or an alternative filter. I like the idea of supporting layer properties via CSS here. Given that it would add a good amount of repeated tagging to the SVG code (CSS rules + class tags on each object), I think this should be made optional. Although focusing this report on supporting layer _properties_ makes this a duplicate of bug 53864. (Use of CSS and classes hasn't been mentioned there yet.)