Loading ...
Sorry, an error occurred while loading the content.

cascading objects in SVG

Expand Messages
  • david.bellot
    Hi, I m working on a new version of SVG-cards (http://david.bellot.free.fr/svg-cards) and I would like to do the following: I would like to define a first
    Message 1 of 10 , Jul 2 2:17 AM
    • 0 Attachment
      Hi,

      I'm working on a new version of SVG-cards (http://david.bellot.free.fr/svg-cards) and I would like to do the following:

      I would like to define a first object which is a rectangle and then "inherits" from this object to define an empty card. Then I want to "inherit" again from this empty card to create different versions of my cards (Ace, 2, 3, etc...).

      I'm not sure if the term "inherit" is appropriate but the idea would be to have this hierarchy of objects, each one propagating its dimension and other properties to the following one.

      The final objects are the cards which are in fact a "composition" or "aggregation" of other parent objects.

      Any idea ?

      Cheers,
      David
    • Mark T
      Going from the simple to the less-simple... *) An svg can contain an svg. Though this may be looking a bit clumsy from a simple structure point of reading
      Message 2 of 10 , Jul 2 10:11 PM
      • 0 Attachment
        Going from the simple to the less-simple...

        *) An svg can contain an svg.
        Though this may be looking a bit clumsy from a simple structure point of
        reading .code.
        *) Another path is to build an svg dynamically with xhttp. Using layers
        possibly.
        This is a 'dynamic include' (?) Though assumes a browser.
        *) There may be a way to this using xslt. (Adventurous).

        Trying to shoe horn object oriented onto svg, not explored.

        I do a fair bit of OO with Ruby as a serving tool.
        Which allows pretty decent OO ;)
        Though (most) of the templating regimes inherit the code sections rather
        than template 'views'.

        MarkT
        --
        (+61 4) 0679 5734 :: skype: govirtual.com.au :: チェックアウトが、Jingle だ! ::It's a
        Jingle Out There!


        [Non-text portions of this message have been removed]
      • David Bellot
        So I was not too far from the solution. Apparently the idea is to use into . I cannot assume it s will be used by a browser. In fact the first
        Message 3 of 10 , Jul 2 10:29 PM
        • 0 Attachment
          So I was not too far from the solution. Apparently the idea is to use <svg>
          into <svg>.
          I cannot assume it's will be used by a browser. In fact the first versions
          of SVG-cards are used everywhere from publishing to iPhone games (given the
          feedback I have from users).

          I'll try this and see how it works
          Thanks a lot

          On Sat, Jul 3, 2010 at 07:11, Mark T <paradisaeidae@...> wrote:

          >
          >
          > Going from the simple to the less-simple...
          >
          > *) An svg can contain an svg.
          > Though this may be looking a bit clumsy from a simple structure point of
          > reading .code.
          > *) Another path is to build an svg dynamically with xhttp. Using layers
          > possibly.
          > This is a 'dynamic include' (?) Though assumes a browser.
          > *) There may be a way to this using xslt. (Adventurous).
          >
          > Trying to shoe horn object oriented onto svg, not explored.
          >
          > I do a fair bit of OO with Ruby as a serving tool.
          > Which allows pretty decent OO ;)
          > Though (most) of the templating regimes inherit the code sections rather
          > than template 'views'.
          >
          > MarkT
          > --
          > (+61 4) 0679 5734 :: skype: govirtual.com.au :: チェックアウトが、Jingle だ! ::It's
          > a
          > Jingle Out There!
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >



          --
          David Bellot, PhD
          david.bellot@...
          http://david.bellot.free.fr


          [Non-text portions of this message have been removed]
        • Holger Jeromin
          ... in works perfect in all browsers (ASV, Firefox, Opera, IE9, safari, mobile safari, opera mobile). My application uses more than 50
          Message 4 of 10 , Jul 5 3:57 AM
          • 0 Attachment
            David Bellot schrieb am 03.07.2010 07:29:
            > So I was not too far from the solution. Apparently the idea is to use <svg>
            > into <svg>.
            > I cannot assume it's will be used by a browser. In fact the first versions

            <svg> in <svg> works perfect in all browsers (ASV, Firefox, Opera, IE9,
            safari, mobile safari, opera mobile). My application uses more than 50
            <svg> Elements in one view without display problems.

            --
            best regards
            Holger
          • David Bellot
            so for example, if I make something like bla bla bla
            Message 5 of 10 , Jul 5 5:26 AM
            • 0 Attachment
              so for example, if I make something like

              <defs>

              <g id="parent_object">
              <svg>
              bla bla bla
              </svg>
              </g>

              <g id="child_object">
              <use id=xlink:href="#parent_object"/>
              bla bla bla
              </g>

              </defs>

              do you think it will force the child object to inherit the content and
              properties of the parent object ?




              On Mon, Jul 5, 2010 at 12:57, Holger Jeromin <mailgmane@...> wrote:

              >
              >
              > David Bellot schrieb am 03.07.2010 07:29:
              >
              > > So I was not too far from the solution. Apparently the idea is to use
              > <svg>
              > > into <svg>.
              > > I cannot assume it's will be used by a browser. In fact the first
              > versions
              >
              > <svg> in <svg> works perfect in all browsers (ASV, Firefox, Opera, IE9,
              > safari, mobile safari, opera mobile). My application uses more than 50
              > <svg> Elements in one view without display problems.
              >
              > --
              > best regards
              > Holger
              >
              >
              >



              --
              David Bellot, PhD
              david.bellot@...
              http://david.bellot.free.fr


              [Non-text portions of this message have been removed]
            • Mark T
              Hi David, SVG is a modularized language for describing two-dimensional vector and mixed vector/raster graphics in XML . It can effect change in a document a
              Message 6 of 10 , Jul 6 2:49 AM
              • 0 Attachment
                Hi David,

                SVG is 'a modularized language for describing two-dimensional vector
                and mixed vector/raster graphics in XML'.
                It can effect change in a document a number of ways.
                1) Significantly, it instructs the renderer to draw pretty pictures.
                Where the renderer has the ability.
                2) Modifications to this drawing can occur using xslt, animation and scripting.
                Though it is the operator in the operatee, the document.
                The document exists as an 'instance' of the window's DOM.
                The svg document is part of the document object model.
                So using terms such as object and inherit are more relevant in the
                context of the document.

                Firebug is a great way to peek into the structure of an svg doc.

                The above has not been checked for 'absolute correctness' in the sake
                of getting a response out.

                MarkT

                On Mon, Jul 5, 2010 at 10:26 PM, David Bellot <david.bellot@...> wrote:
                > so for example, if I make something like
                >
                > <defs>
                >  <g id="parent_object">
                >    <svg>
                >        bla bla bla
                >    </svg> </g>
                >
                > <g id="child_object">
                >   <use id=xlink:href="#parent_object"/>
                >   bla bla bla </g>
                >
                > </defs>
                >
                > do you think it will force the child object to inherit the content and
                > properties of the parent object ?
              • Mark T
                Having explored an SVG document with Firebug you may still have the same questions. Understandable! Are you trying to form a web site or an svg file? A web
                Message 7 of 10 , Jul 7 1:45 AM
                • 0 Attachment
                  Having explored an SVG document with Firebug you may still have the
                  same questions.

                  Understandable!

                  Are you trying to form a web site or an svg file?
                  A web site can have a server hosted portion which is object oriented.
                  Here I am a little biased in exampling.
                  In that I use Ruby in this way.
                  Then when I go to model in the svg file I can call back to the Ruby via xhttp.
                  This gets me a fair way.
                  Though when I need more functionality in the browser, there is
                  Javascript (aka: Ecmascript).
                  This is not quite object oriented. It is a prototype oriented language.
                  (Even though there is JSON, a Javascript Object Notation .data. format.).
                  http://en.wikipedia.org/wiki/JSON

                  Javascript is pretty good though.
                  So good that J Coglan has in act written a Ruby-Oriented Class wrapper
                  for Javascript!
                  http://jsclass.jcoglan.com/
                  So with this you can model in object ways.
                  Using a Ruby syntax.

                  MarkT

                  On Tue, Jul 6, 2010 at 7:49 PM, Mark T <paradisaeidae@...> wrote:
                  > Hi David,
                • David Bellot
                  No just a svg file. Like the one I already did for SVG-cards but I want to make it more modular now, and re-exploit objects as much as possible. My problem is
                  Message 8 of 10 , Jul 7 1:55 AM
                  • 0 Attachment
                    No just a svg file. Like the one I already did for SVG-cards but I want to
                    make it more modular now, and re-exploit objects as much as possible.
                    My problem is really how to make svg objects from other objects. But the
                    most important, as I was saying before, is to "propagate" objects dimensions
                    from one object to the other. So for example if I have an empty object with
                    the correct dimension, I want to create an empty card (that is a rectangle
                    with rounded border) that will take 100% of the empty object.

                    If I want an Ace, I will take an empty card (the one before) and put a
                    symbol in the middle (50%, 50%) and so on...
                    You know what I mean. But it's all done in the SVG file and this file is
                    then distributed without assuming any extra languages, just plain
                    SVG.Javascript is pretty good though.

                    Cheers,
                    David


                    [Non-text portions of this message have been removed]
                  • Mark T
                    Hi David, Which editor are you using? Would layers in Inkscape be applicable? MarkT [Non-text portions of this message have been removed]
                    Message 9 of 10 , Jul 9 3:45 AM
                    • 0 Attachment
                      Hi David,
                      Which editor are you using?
                      Would layers in Inkscape be applicable?

                      MarkT


                      [Non-text portions of this message have been removed]
                    • David Bellot
                      I don t use an editor for making my files. OK, in fact I use Inkscape and Illustrator to design the objects, then I just go through a text editor to make to
                      Message 10 of 10 , Jul 9 4:23 AM
                      • 0 Attachment
                        I don't use an editor for making my files. OK, in fact I use Inkscape and
                        Illustrator to design the objects, then I just go through a text editor to
                        make to whole thing.
                        In the previous version I wrote a program to generate my files.
                        I'm gonna try with Inkscape layers. Maybe it can help.

                        On Fri, Jul 9, 2010 at 12:45, Mark T <paradisaeidae@...> wrote:

                        >
                        >
                        > Hi David,
                        > Which editor are you using?
                        > Would layers in Inkscape be applicable?
                        >
                        > MarkT
                        >
                        >
                        > [Non-text portions of this message have been removed]
                        >
                        >
                        >



                        --
                        David Bellot, PhD
                        david.bellot@...
                        http://david.bellot.free.fr


                        [Non-text portions of this message have been removed]
                      Your message has been successfully submitted and would be delivered to recipients shortly.