raphael

SVG draws outside canvas boundary in Internet Explorer 9

依然范特西╮ 提交于 2019-11-29 16:38:25
问题 I am using the Raphael Javascript library to do some rudimentary drawing for a web page. I am just drawing some lines that radiate out from a point. In Chrome, Firefox, and Opera, these lines are subject to the size of the SVG canvas. This is the desired behaviour, because I want to draw a ray as long as I want but I do not want it to affect the size of the page. If I draw a 5000px wide box, only the part inside the canvas will be visible. However, Internet Explorer (surprise surprise)

Snap.svg drag group along path

北城以北 提交于 2019-11-29 16:34:53
I need to do something along the lines of this , but I with Snap.svg and with the ability to: Drag the entire group along the path Preserving spacing during the drag Allow group drag from any group item Support any number of group items Support various different shaped paths I started this jsfiddle as a working starting point (and also posted below), but I'm at a loss at how best to attack the problem. var paper = Snap('#panel'); var path = paper.path('M44.16,44.16 L44.16,44.16 L73.6,14.719999999999999 L132.48,73.6 L14.719999999999999,191.35999999999999 L132.48,309.12 L103.03999999999999,338

pointer-events: none VML raphael solution

爷,独闯天下 提交于 2019-11-29 14:22:42
I have implemented pointer-events: none on a Raphael element using jQuery like this: var raphaelElement = Raphael.ellipse(x,y,w,h); $(raphaelElement.node).css({'pointer-events': 'none'}); This works fine but of course in IE8, Raphael uses VML instead of SVG and this solution fails. Does anyone have another solution to essentially make a Raphael element ignore events. Phrogz The only way to make this work for IE8 (and earlier) would be to actually catch the event, and in the event handler: hide the element ( .style.display='none' ) use the elementFromPoint() method to find the next element

Raphael JS: how to use jQuery selectors on objects in IE?

孤街醉人 提交于 2019-11-29 12:37:54
I'm trying to use Raphael JS, but jQuery selectors don't seem to work with Raphael JS in IE8. In Chrome and Firefox this works: var paper = ScaleRaphael("test", 500, 500); var c = paper.circle(50, 50, 40); c.node.setAttribute('class','bluecircle'); $('.bluecircle').attr({fill: 'blue'}); But in Internet Explorer (IE8, which uses VML instead of SVG) nothing is shown. Basically what I'm trying to do is to give each object a class, so I can use Jquery selectors to manipulate all objects at once that have a certain class... Does anybody know a way how to do this, that also works in IE ? This is not

Can someone clarify Raphael's documentation? (or know a place in which someone already has done it)

假如想象 提交于 2019-11-29 10:46:53
I´m working with Raphael, and I think that I´m using it in a way that does not take advantage of some features that seems to be useful. For example, I´m trying to add a listener on a Set (a group of elements), in a way that on mouse over on any of those elements, the script triggers an animation on the whole set. When you add a listener to a set, Raphael adds the listener to each of the elements and animates them separately. Like you see in this example http://jsfiddle.net/4VYHe/3/ in wich I want that all the rectangles in the same set (set = horizontal groups of 10 rectangles), change the

Raphael draw path with mouse

邮差的信 提交于 2019-11-29 03:35:34
问题 I'm using the raphael javascript library, and I'd like to draw a straight line using the mouse. I'd like to let the user click somewhere, place a single point of the path, and then have the line follow the mouse until they click again, at which point the line is placed permanently on the canvas. Right now the only way to do that seems to be to create a path when they click, constantly remove and redraw it when they move the mouse, and then create it once more when they click again, keeping

How to drag a shape along a given path

拥有回忆 提交于 2019-11-29 03:29:25
问题 I've this simple dummy file that I'm using to do some testing. The intended result is to drag the red circle along the path. The thing is that I can't figure out how to associate both shapes. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <script src="raphael-min.js"></script> </head> <body> <script type="text/javascript"> // Creates canvas 320 × 200 at 10, 50 var r = Raphael(10, 50, 320, 200); var p = r.path("M100,100c0,50 100-50 100,0c0,50 -100-50 -100,0z").attr({stroke: "

Applying rounded corners to paths/polygons

断了今生、忘了曾经 提交于 2019-11-29 02:28:21
问题 I'm gathering some info for a project that has to start within a few weeks. This project contains a browser-based drawing tool where users can add predefined shapes or forming shapes themselves. Shapes must be selectable, freely scalable and rotatable with a Illustrator-like transformtool (handles). Predefined shapes that we have in mind are: rectangles, ellipses, half ellipses and (isosceles) triangles. So far so good, to achieve this I was thinking of RaphaelJS or FabricJS but... Every

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

百般思念 提交于 2019-11-29 01:25:39
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? Adding a link to Raphael.blur in a separate answer, per the OP's request. http://github.com/DmitryBaranovskiy/raphael/blob/master/plugins/raphael.blur.js Updated code sample: var shadow = canvas.path(p); shadow.attr({stroke: "none", fill: "#555", translation: "4,4"}); shadow.blur(4); var shape = canvas.path(p); Note that in Dmitry's comments he mentions that there is no WebKit support. He uses the <filter> element and

How to animate a Raphael object along a path?

无人久伴 提交于 2019-11-28 20:52:17
The object could be simple, a rect or circle. But the path should be a bezier curve. Please provide javascript/ Raphael code if not too much trouble. It will be nice if there is trailing effect of the moving object during annimation. Just in case you are trying to use this with RaphaelJS 2 (animateAlong doesn't exist anymore), here you can see a possible solution: http://jsfiddle.net/gyeSf/17/ . And here the original discussion: https://groups.google.com/forum/#!searchin/raphaeljs/animatealong/raphaeljs/W9bA0SkArVY/KnPRKi8uFrsJ Edit: And here another example: http://raphaeljs.com/gear.html