svg

Can I define a linear gradient in SVG with a normal/bell-shaped blend?

Consider the following svg snippet: <linearGradient id="redgradient" x1="0%" x2="0%" y1="0%" y2="100%"> <stop offset="0%" stop-color="#ffffff"/> <stop offset="100%" stop-color="#ff0000"/> </linearGradient> <rect x="0" y="0" width="400" height="400" fill="url(#redgradient)"/> Is there a way of specifying that the colours should...

Is anyone storing raw SVG data inside mongodb?

I'm working on a project where I'm looking to store raw svg data inside my mongodb. Right now, it appears a bit goofy because I need to escape the svg string like so: { "_id" : ObjectId("4c61e60d4d02da615f175b6e"), "name" : "Triangle", "svg-data" : "<?xml version=\"1.0\" encoding=\"utf-8\"?> <!-- Generator: Adobe Illustrator 14.0.0, SV...

raphaeljs and iPhone: not working when embedded in bundle?

I cannot get Raphaël working in a UIWebView. I load a simple HTML-Webpage with this content: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Page Title</title> <script src="js/lib/raphael-min.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> alert("" + Raphael)...

Graphic elements not assigned parent elements on Safari iPad when using Google Closure

I'm using Google closure to create a simple interactive graphic in HTML/JS to be viewed on iPad Safari. The code sample below shows expected behavior on Safari Mac and all other major browsers (a circle appears that when clicked generates a console message), but not Safari iPad. No event handler is registered with the circle. Instead, a...

image in pattern in path in SVG in Mozilla Firefox?

I have the beginnings of a jigsaw demo in SVG that works in Opera, Chrome, and Safari, but not Firefox: the background rect shows, but the pieces are all entirely missing. The pieces consist of a path element whose fill property references a pattern that in turn contains a copy of the image translated so that the correct part of the ima...

Javascript createElement

Hi there, I want to create inline SVG graphics using Javascript. However, it seems like createElementNS function applies some normalization and transforms all tags to lowercase. That is fine for HTML but not for XML/SVG. The NS I used is http://www.w3.org/2000/svg. In particular I have problems creating a element. As it will be appen...

jQuery, SVG: How to animate an attribute value (not style property)?

Hi, I need to animate an attribute of an SVG element, which has no CSS counterpart - <circle cx="..." /> How can I achieve that? Or, I can use an alternative, e.g. if I could animate <g/> using CSS's top or similar. Any experience? Thanks, Ondra Note this is not a duplicate of http://stackoverflow.com/questions/911357/how-can-i-anim...

SVG interaction in python with cairo, opengl and rsvg

Hi, I render a huge SVG file with a lot of elements with Cairo, OpenGL and rsvg. I draw svg on cairo surface via rsvg and create an OpenGL texture to draw it. Everything is fine. And now I have to interact with elements from SVG. For example, I want to guess an element by coordinates. And I want to change the background of some path in S...

how do i increase the size of this SVG?

http://upload.wikimedia.org/wikipedia/commons/a/a5/Map_of_USA_with_state_names.svg is it possible to increase the size of this map? ...

Is there a way to add a case sensitive attribute using jQuery?

I'm working with jQuery to modify some svg files data on the fly... one of the things I need to do is modify the "viewBox" attribute. When using jQuery as in the snippet below, however, it is doing a toLower() on the attribute so "viewBox" becomes "viewbox". Normally I wouldn't care but this seems to break svg rendering (at least on Ma...

SVG and Internet Explorer?

Does anyone know if SVG is working in a recent version of IE? ...

Where can I find a valid SVG XML Schema (for ecore generation) ?

I tried importing the SVG XML Schema into EMF, to obtain the SVG metamodel in ecore. However, the import failed due to the schema not being valid: indeed, svg.xsd references XMLSchema.dtd, which itself references datatypes.dtd, which does not exist! Consequently, I tried downloading the necessary files from the svg website (svg.xsd, XML...

svg: not working with IE?

i am trying to open this site in IE: http://www.petercollingridge.co.uk/data-visualisation/interactive-svg-map and it is not showing the SVG on it how do i get it to work with IE? ...

Best device for SVG graphics in R?

Hi all, I'd like to export SVG graphics from R. There appear to be two alternatives: RSvgDevice and Cairo. Can anyone comment on these packages? Is either the default, or clearly better than the other? Many thanks, ...

Most Comprehensive Python SVG Library

I'd like to generate SVG images (e.g. general artwork, not just charts or graphs) using Python. What's the best Python SVG library that supports broadest range of SVG's feature set? ...

Is it safe to wrap all immediate children of an svg document into <g> for zooming?

In my app I load different SVG files and need to zoom them. As I see it I need to apply a transformation matrix to an element to have it zoomed, but this doesn't work on SVG element, so I need to wrap everything in a <g> and transform it instead. So my question is is it safe to do this? Is it allowed for elements like <defs> be not im...

What are the pros and cons of HTML5 Canvas vs. SVG + Raphael.js?

I just started a project using the Canvas. But one of the things I need is to keep track of movable, clickable boxes as in this example : http://raphaeljs.com/graffle.html so I'm wondering if Raphael-js + SVG would be better. Which would you use? And why? ...

What Library Can I Use to Manipulate SVG Files?

I'm searching for a library that will allow me to perform graphical manipulations on SVG files. By "manipulations" I mean things like: Merge two overlapping shapes into a single shape Find the geometric center of a shape Draw a copy of a shape that is 25% of the original shape's size ...and other sorts of things that one can do in I...

embedding javascript and CSS in an SVG

i have a map of the US: http://upload.wikimedia.org/wikipedia/commons/a/a5/Map_of_USA_with_state_names.svg i am trying to embed this code in it: http://sixrevisions.com/tutorials/javascript_tutorial/create_lightweight_javascript_tooltip/ as you can see it has CSS and javascript however, i am having a very diffficult time trying to p...

SVG - Cut out one path out of another one

I have several SVG paths looking like this: M204.21121687607624,196.94037184487675L329.92080751248244,195.46306542867487A130,130,0,0,0,244.46261863233696,77.83995929783192Z M198.39145828733604,195.04941765207442L235.83285625620988,75.03597952801854A130,130,0,0,0,97.55860203112616,119.9640082076644Z I now want to add another path, ...