raphael

Scaling SVG (Raphael.js) like an SWF

北城余情 提交于 2019-11-28 16:01:15
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 with this. viewBox worked great but its SVG only. I just figured out how to do it using Raphael sets and

How Can i scale Raphael js elements on window resize using jquery

时光总嘲笑我的痴心妄想 提交于 2019-11-28 15:50:42
问题 How can i rescale all the element inside a Raphael canvas on window change ? considering the following code / DEMO if i re-size my window only div container scaled since i set its width to 50% of the window width and none of the ( rect , circle or path ) change CODE <div id="container"></div>​ #container{border : 1px solid black ; width : 50% ; height:300px}​ var con = $("#container"); var paper = Raphael(con.attr('id'), con.attr('width'), con.attr('height')); var win = paper.rect(0,0,400,300

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

≡放荡痞女 提交于 2019-11-28 13:46:44
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 hitting 'Refresh' in IE browser tools, there are lots of <shape/> entities - but they all claim to have

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

☆樱花仙子☆ 提交于 2019-11-28 13:10:18
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 library and SVG. Here is my current approach: I open up the base image in InkScape and draw a

Raphael JS : how to remove events?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 12:22:08
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(); }); Ok, what you have to do is pass the handler function to the unmouseover request: // Creates canvas 320 × 200 at 10, 50 var paper = Raphael(10

adding ID's to raphael objects

天涯浪子 提交于 2019-11-28 11:36:14
I have a fairly large map consisting of Raphael paths which im trying to make accessible to some jquery ajax scripts to be populated. I've tried to add an ID or anything to make it accessible from jquery in an organized fashion. As im new to Raphael I cant figure out a good way of achieving this. I've tried using .data() to add an ID for each dot with say "seat_1","seat_2" and so on but been unsuccessful so far. how would I go about organizing this code so I could manipulate it by looping? I realize that its a fairly open ended question but any suggestion is much appreciated Demo here: http:/

Raphaeljs: Copy element or set to another paper

孤街醉人 提交于 2019-11-28 11:24:45
问题 Is there a possibility of adding an element or set that exists within a paper to another paper, without creating each element twice from scratch? Background for this: I visualize a large node graph and want to create an "overview map" in a separate paper. 回答1: Raphael don't allow to move element from one paper to another directly. So it is better to create a new element with same property in the target paper. I have created following sample method. you can add the code in your page and use

How to access id attribute of any element in Raphael

孤人 提交于 2019-11-28 11:18:00
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 processPathOnClick() { alert($(this).attr("id")); } Can anyone please tell me what is the problem with the

Snap.svg drag group along path

偶尔善良 提交于 2019-11-28 10:35:00
问题 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

How to get the outline of a stroke? [duplicate]

风格不统一 提交于 2019-11-28 10:06:45
This question already has an answer here: svg: generate 'outline path' 3 answers I want to convert a stroked path to a filled object. (Programmatically, in JavaScript.) The line is just a simple curved line, a sequence of coordinates. I can render this line as a path, and give it a stroke of a certain thickness... but I'm trying to get a filled shape rather than a stroked line, so that I can do further modifications on it, such as warping it, so the resulting 'stroke' might vary in thickness or have custom bits cut out of it (neither of these things are possible with a real SVG stroke, as far