raphael

Scaling SVG (Raphael.js) like an SWF

妖精的绣舞 提交于 2019-11-27 09:30:40
问题 I started using Raphael.js a few days ago and I'm really enjoying it. The only thing I haven't been able to figure out is how to get the "paper" or svg/vml tag to fill the browser window like an swf. See this example. Note the way the above example resizes with the browser window I was able to get the "paper" to resize with the browser window, but no luck getting all the vector graphics to adjust their size. Any feedback would be greatly appreciated. EDIT I tried a bunch of different routes

How to remove a path duplicate created by pressure sensitive pens?

有些话、适合烂在心里 提交于 2019-11-27 08:43:35
问题 I am new to svg and js. I have some svg files that have been drawn using pressure sensitive pens, and they have paths with fills inside them and are having duplicated paths( to contain the fills). In Illustrator you can select the entire paths, and then change the pen to basic pen( no pressure sensitivity) and this changes the paths to simple paths(paths with no duplicated paths for each line). The below svg example shows that each line is having 2 paths in parallel: http://jsfiddle.net/Y35sV

How to debug or see VML ouput in IE? (e.g. from Raphael)

*爱你&永不变心* 提交于 2019-11-27 07:55:29
问题 I'm working with Raphael.js to make cross-browser interactive vector graphics, trying to add a new feature with separate code to make the feature work in 'SVG mode' and 'VML mode'. My problem is, I can't see any way to inspect, debug, change or even see the defining properties of the actual IE VML output that Raphael creates. In SVG, it's easy - you just dig into the DOM with Firebug or Inspect Element and the SVG is right there with the right markup. In IE7 and IE8 in VML however, after

Choosing the right technology/library for adding user specified text on a path in previously defined regions

不羁岁月 提交于 2019-11-27 07:29:53
问题 I am building an admin area using CodeIgniter 2, where the admin has the ability to add specific images that are "blank", when it comes to text overlay. When they upload the image, they should have a way of defining certain paths on which regular users can add desired text. Basically, this can be used for shirts, mugs...any type of custom printable surfaces. The paths need to support straight lines, bezier curves and circles. And one base image needs to support multiple paths. I used the

Raphael JS : how to remove events?

泄露秘密 提交于 2019-11-27 06:57:56
问题 I use the Raphael .mouseover() and .mouseout() events to highlight some elements in my SVG. This works fine, but after I click on an element, I want it to stop highlighting. In the Raphael documentation I found : To unbind events use the same method names with “un” prefix, i.e. element.unclick(f); but I can't get this to work and I also don't understand the 'f' parameter. This doesn't work , but what does?? obj.click( function() { this.unmouseover(); }); 回答1: Ok, what you have to do is pass

How to access id attribute of any element in Raphael

与世无争的帅哥 提交于 2019-11-27 06:10:40
问题 I'm using Raphael for drawing some elements on a website. The elements include rectangle, line (path). I have given an id to the path element and trying to access it in the onclick event of that line. but when I do an alert of the id, nothing is visible. Following is the code snippet function createLine() { var t = paper.path("M" + xLink + " " + yLink +"L" + linkWidth + " " + linkHeight); t.attr('stroke-width','3'); t.attr('id','Hello'); t.node.onclick = processPathOnClick; } function

jQuery SVG vs. Raphael [closed]

旧街凉风 提交于 2019-11-27 05:45:17
I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to decide between Raphael and jQuery SVG . I'd like to know What the trade-offs are between the two Where the development momentum seems to be. I don't need the VML/IE support in Raphael, or the plotting abilities of jQuery SVG. I'm primarily interested in the most elegant way to create, animate, and manipulate individual items on an SVG canvas. Anatoly G I've recently used both Raphael and jQuery SVG - and here are my thoughts: Raphael Pros: a good starter library, easy to do a LOT of things with SVG

how to use attr's stroke-dasharray,stroke-linecap,stroke-linejoin in raphaeljs

巧了我就是萌 提交于 2019-11-27 05:35:49
问题 Can anyone give me an example of these attributes in action: stroke-dasharray, stroke-linecap, stroke-linejoin i tried using them, but i don't quite understand the sentext structure for their values. 回答1: stroke-linecap Legal Values: butt | round | square | inherit Example stroke-linejoin Legal Values: miter | round | bevel | inherit Example stroke-dasharray Legal Values: comma- or space-delimited list of lengths or percentages, e.g. "100 20 0 20" Example (using above values) 回答2: Phrogz's

Convert Raphael SVG to image (png etc) client side [duplicate]

久未见 提交于 2019-11-27 05:35:44
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Convert SVG to image (JPEG, PNG, etc.) in the browser I have a small project where users construct a diagram using Raphael and then export the composed diagram to an image to save. Problem is it has to run offline. http://www.nihilogic.dk/labs/canvas2image/ will not work as it requires a canvas, not the Raphael generated SVG. Is there a way (javascript) that I can export an image from the SVG? 回答1: Yes, that

Raphael JS : how to move/animate a path object?

守給你的承諾、 提交于 2019-11-27 05:34:10
问题 Somehow this doesn't work... var paper = Raphael("test", 500, 500); var testpath = paper.path('M100 100L190 190'); var a = paper.rect(0,0,10,10); a.attr('fill', 'silver'); a.mousedown( function() { testpath.animate({x: 400}, 1000); }); I can move rects this way but not paths, why is that, and how do I move a path object then?! 回答1: With the latest version of Raphael, you can do this: var _transformedPath = Raphael.transformPath('M100 100L190 190', 'T400,0'); testpath.animate({path: