SVGGroup

Part of wslib


see also: SVG, SVGFile


superclass : SVGObject


With SVGGroup SVGObjects can be grouped. It is similar to SVGFile, but works only inside an objects array.


creation


SVGGroup ( objects, name, transform )

creates a new object with the instance variables as described below and in the SVGObject helpfile



instance variables


objects

all SVGObjects in an array. The order of the array is the order of execution; the last item is always the frontmost layer.

(

SVGGroup( [

SVGEllipse( 200, 200, 100, 50, "my ellipse", "olive" ),

SVGRect( 10, 10, 300, 200, 0, 0, "my rect", "navajo_white", "none", 5 ).opacity_(0.5),

SVGCircle( 200, 200, 150, "my circle", "chocolate", "none", 10 ),

SVGLine( 200, 200, 150, 10, "my line", "dark_red", "none", 6 )

], "my group" ).plot;

)


instance methods


add ( object ), addAll (objects )

add an object or an Array of objects to the group


++ anSVGGroup

Concatenate the objects of 2 SVGGroups to a new SVGGroup.


at ( index ), copySeries ( first, second, last ), put (index, item )

calls .at and copySeries on objects, also to provide compatibility with the ..[..] syntax in SC


postTree

post a tre-like structure with all objects and groups contained in the objects array