raphael

how to set font-size font-family

i have code like this but its not working var t = r.text(100, 100, 'test'); t.attr({font-size: 16}); giving me error missing : after property id here is documentation for raphael.js http://raphaeljs.com/reference.html ...

Update pie slice size in Raphael pie chart

I'm working on making a pie chart that shows results over time. As such it needs to animate between states to show how different slices change. I've figured out how to change all the slices en masse (using this example as a starting point), but I would like to be able to select and manage a particular slice (or sector as Raphael calls it...

Connecting Raphael with Rails

This is a high-level question about web frameworks, that as a desktop app developer, I don't have much knowledge of. I am planning to build a web application which visualizes some data stored in a database. I plan on using Rails for user query. For visualization, the Raphael JS library looks good. Would it be a considerable task trying...

Using Raphael javascript for hovering with arrays

Hi, using Raphael, I'm trying to get a shape to appear when you hover over an invisible area near the shape. The following code does not work - where am I going wrong? Each shape has two Raphael paths associated with it: one for the visible shape, and the other for the invisible area. <script type="text/javascript" charset="utf-8"> $("...

Selecting a node in Raphael javascript

Hi, the following code mostly works (thanks to a good answer a couple of days ago!) all except for the last little bit: things.square[1].node.setAttribute("id","clicker"); $("#clicker").click(function(){ $("#canvas_things1").fadeOut(); $("#canvas_things2").fadeIn(); }); I think the problem is this line: things.square[1].node....

Using setAttribute with an array of Raphael paths

When 'things' in the following code is an array of paths... things.square = [ RM.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr), RM.path("m 271.25132,77.933263 58.07304,0 0,56.409037 -58.07304,0 0,-56.409037 z").attr(attr2) ]; ...then this code does not work: things....

Click event fired twice

I don't know if this is to do with Raphael, ColorBox or jQuery. Here's my the relevant code: var image = paper.image(p.url_, tx, ty, img.width, img.height); image[0].style.cursor = "pointer"; image.node.onclick = function() { $.colorbox({ title: "Some Random Title", href: function() { $.post("test.php", {...

Raphael JS Question

I am following a tutorial from netuts about raphael js and I dont understand one of the examples, could some one possibly explain this to me in plainer english. I know I should learn more about javascript first. for(var i = 0; i < 5; i+=1) { var multiplier = i*5; paper.circle(250 + (2*multiplier), 100 + multiplier, 50 - multip...

SVG Background animation and frame rate

I've made an animation with SVG. It's like a slowly changing wallpaper. The idea is that you should barely notice it is changing. It's purely decorative, and I don't want it to drain any resources. Is there a way to set the frame rate in SVG? I thought setting it to a very low number might do the trick? I'm using Raphael, by the way. ...

external loaded SVG broken in IE (Raphael JS)

Hi everyone, I am using jQuery to load an external SVG (a map of France) and parse it into paths with raphaël.js the following code. But it is not doing anything in IE. Any ideas? $(document).ready(function(){ var paper = Raphael("canvas", 450, 380); var map = paper.set(); // load svgz map $.ajax({ type: "GET",...

Raphael generated SVG, path render issue.

I was asked to develop a "Flashy" graph for a cliënt. I grasped the chance to try raphaeljs for this project. All worked out fine but now the mousover labels don't get rendered in Chrome. Only the part where there is text on top of the path it gets rendered. The development version is placed on http://85.145.85.127/projects/ilsf-graph/ ...

How can one add drop shadows to Raphael.js objects?

I would like to find out how to add blurry edged drop shadows to Raphael.js objects/paths. As far as I know it is not possible with the library as is but is there a work around? ...

How to convert Illustrator or Inkscape SVG drawings into Raphael.js objects?

I am trying to figure out the best most reliable way to convert my SVG drawings from Illustrator or Inkscape into Raphael.js object code. I suppose I am looking for some type of parser but do not know of any. None are suggested on the Raphael.js site. Any suggestions? ...

Checking to see if object is out of canvas (Raphael.js)

Hello all, currently I am using Raphael.js to drag and drop a circle around a canvas. However, I would like to disallow the user to drag the circle out of the canvas. My code is generally as follows: <script type="text/javascript" src="Javascript/raphael.js"></script> <script type="text/javascript"> window.onload = function(...

How do you make an element undragable in Raphael?

I made an element dragable using element.drag(start, move, up); When I want to make the element undragable, I can somewhat achieve this using the method from the documentation: element.undrag(f); // Any undefined variable works as the argument This makes it so that the element cannot be moved anymore. This method has 2 problems: ...

Combining Raphael and jQuery to achieve browser compatibility

Having discovered that IE does not handle javascript onmouseout, I determined to use jQuery instead so the cross-browser compatibility would be taken care of automatically. I am making an area defined by an svg path light up when the mouse hovers over it, and I adapted the code provided on the Raphael website from the Australia example: ...

What does fn mean when used in Raphael?

I saw a fn use in raphael, which is a javascript lab. Raphael.fn.g.piechart = function (cx, cy, r, values, opts) { // blah...blah } it extend raphael, so people can uses like r = Raphael; r.g.piechart. I search google and have nothing seem to be clear my mind. hope you help. ...

What is a good place to host a community-driven examples site?

I'm a contributer to the Raphael project, and one thing we need is a central place for documentation and, IMHO, a good place for people to add examples of how to use the library to accomplish various tasks. One of the contributers has done a great job of managing all this information himself so far, on his own personal site, but of cou...

How can I dynamically set the image size ratio depending on the returned image in raphael?

How can I dynamically set the image size ratio depending on the returned image in raphael? Here is some code to give you an idea: var viewer = Raphael(0,0,scrWidth, scrHeight); viewer.image(dynamicUrl, 140, 140,300, scaledHeight); Thank you ...

Paint rounded border around image using Raphael

Hi, I'm using the Raphael JavaScript library. I'd like to draw a border with rounded edges around an image (which is a Raphael object) but I can't seem to figure out how to do that. I tried to set a stroke but it doesn't appear. I have this: var paper = Raphael(10, 50, 500, 500); var google_img = paper.image("http://www.google.com/imag...