How do I render an SVG string?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How do I render an SVG string?

Hannes Hirzel
Hello

A quick question:
How do I output some SVG code?

(http://www.w3.org/Graphics/SVG/)

mySVGstring := '<svg width="100%" height="100%" version="1.1"
xmlns="http://www.w3.org/2000/svg">

<path d="M250 150 L150 350 L350 350 Z"
style="fill:yellow;stroke:red;stroke-width:24"/>

</svg>'.

   html ........ mySVGstring.

What do I need to put on the place of ....... ?

Regards and thank you in advance
Hannes



Note: The class WASvgFunctionalTest

has the example

renderContentOn: html
        html object
                type: 'image/svg+xml' seasideMimeType;
                width: 600;
                height: 800;
                standby: 'loading tiger';
                url: 'http://croczilla.com/bits_and_pieces/svg/samples/tiger/tiger.svg';
                with: 'Your browser doesn''t support SVG'
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How do I render an SVG string?

Johan Brichau-2
Take a look at the SeasideDynamicSVG project, available on squeaksource

On 29 Mar 2011, at 12:44, Hannes Hirzel wrote:

> Hello
>
> A quick question:
> How do I output some SVG code?
>
> (http://www.w3.org/Graphics/SVG/)
>
> mySVGstring := '<svg width="100%" height="100%" version="1.1"
> xmlns="http://www.w3.org/2000/svg">
>
> <path d="M250 150 L150 350 L350 350 Z"
> style="fill:yellow;stroke:red;stroke-width:24"/>
>
> </svg>'.
>
>   html ........ mySVGstring.
>
> What do I need to put on the place of ....... ?
>
> Regards and thank you in advance
> Hannes
>
>
>
> Note: The class WASvgFunctionalTest
>
> has the example
>
> renderContentOn: html
> html object
> type: 'image/svg+xml' seasideMimeType;
> width: 600;
> height: 800;
> standby: 'loading tiger';
> url: 'http://croczilla.com/bits_and_pieces/svg/samples/tiger/tiger.svg';
> with: 'Your browser doesn''t support SVG'
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How do I render an SVG string?

Hannes Hirzel
Johan,

I had a look at
MCHttpRepository
        location: 'http://www.squeaksource.com/SeasideDynamicSVG'
        user: ''
        password: ''

It is geared towards beeing a graphics API to work with an SVG canvas.
This will be useful for me later.

The thing I am looking for at this very moment is just how do I  "pass
through" an existing XML svg string.

Or put the question otherwise: how do I pass through XHTML or SVG
strings unaltered?

--Hannes



On 3/29/11, Johan Brichau <[hidden email]> wrote:

> Take a look at the SeasideDynamicSVG project, available on squeaksource
>
> On 29 Mar 2011, at 12:44, Hannes Hirzel wrote:
>
>> Hello
>>
>> A quick question:
>> How do I output some SVG code?
>>
>> (http://www.w3.org/Graphics/SVG/)
>>
>> mySVGstring := '<svg width="100%" height="100%" version="1.1"
>> xmlns="http://www.w3.org/2000/svg">
>>
>> <path d="M250 150 L150 350 L350 350 Z"
>> style="fill:yellow;stroke:red;stroke-width:24"/>
>>
>> </svg>'.
>>
>>   html ........ mySVGstring.
>>
>> What do I need to put on the place of ....... ?
>>
>> Regards and thank you in advance
>> Hannes
>>
>>
>>
>> Note: The class WASvgFunctionalTest
>>
>> has the example
>>
>> renderContentOn: html
>> html object
>> type: 'image/svg+xml' seasideMimeType;
>> width: 600;
>> height: 800;
>> standby: 'loading tiger';
>> url: 'http://croczilla.com/bits_and_pieces/svg/samples/tiger/tiger.svg';
>> with: 'Your browser doesn''t support SVG'
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

SeasideDynamicSVG.PNG (57K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How do I render an SVG string?

Holger Kleinsorgen-4
renderContentOn: html
    html html: self svgString

svgString
   ^ '<svg xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      height="800">
        ......'

>
> Or put the question otherwise: how do I pass through XHTML or SVG
> strings unaltered?
>
> --Hannes
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside