raphael

raphaeljs drag and drop

≯℡__Kan透↙ 提交于 2020-01-10 09:29:09
问题 I am using rapaeljs for my web app. I want to set dropable boundries of the object. Object can move in dropable area. Once an object come in dropable area, there should be no way out for the object. 回答1: Raphael has built in drag and drop support through .drag() . Use it in the form element.drag(start, move, up); Where the 3 arguments are 3 function references to the functions you write that deal with the mousedown, movement, and mouseup events respectively. Note how this.ox and this.oy is

adding ID's to raphael objects

雨燕双飞 提交于 2020-01-09 10:51:28
问题 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

Raphael multiple line in Text to shift downward rather than upward

狂风中的少年 提交于 2020-01-07 05:34:07
问题 I am trying to add dynamic text into the raphael paper using textArea and then copying it to the raphael text. The problem is when are multiple lines the raphael text tends to move the starting point upward. Is there a attribute or method i can use to shift the multiple line text to downward? 来源: https://stackoverflow.com/questions/15736485/raphael-multiple-line-in-text-to-shift-downward-rather-than-upward

Where does graphael (line chart) calculates it's maximum value?

爷,独闯天下 提交于 2020-01-06 13:55:13
问题 I am facing a very serious bug using graphael. Therefore, I want to change the procedure it uses to calculate the maximum value for the y axis. However, It's way to confusing for me, and I cannot find it. Can anyone help me to change that procedure? 回答1: Sorry, I don't have any experience with gRaphael, but since no one else has answered, I might be able to help you somewhat... The code for gRaphael's LineChart is located here. Normally, I would suggest overriding the function that calculates

raphael's clip-rect property to get result on generated svg image

为君一笑 提交于 2020-01-06 13:04:30
问题 i have an image on my canvas in Raphael and i use clip-rect to crop parts that i dont need. Now i have generated a svg with raphael.serialize plugin, but i cannot get clip-rect working. thet part from php script that loop over created json: for ($i=0; $i <= count($json); $i++) { if ($json[$i]['type'] == "image" ) { $base64 = base64_encode(file_get_contents($json[$i]['src'])); $output .= '<image overflow="visible" x="'.$json[$i]["x"].'" y="'.$json[$i]["y"].'" width="'.$json[$i]["width"].'"

Raphael JS making sub-sets selectively clickable

那年仲夏 提交于 2020-01-06 03:59:11
问题 So I have a paper that has 6 types of symbols. Each symbol is a collection of circles and paths. I only want to make some of circles clickable to drag the set. For example, if a symbol has 2 circles and a path - I want to be able to click one of the circles to drag and drop the set(something that has been well documented). If the user clicks the other circle - nothing should happen. Since my Raphael elements are created dynamically by the user - I push each set as it's created onto an array.

How to prevent loss hover in Raphael?

我与影子孤独终老i 提交于 2020-01-05 04:31:08
问题 I'm developing some page when I use Raphael liblary to draw some items. my App So my problem is in that when I'm moving to some rect it growing up but when my mouse is on text which is positioning on my rect , it loss his hover. You can see it on my app example. var paper = new Raphael(document.getElementById('holder'), 500, object.length * 100); drawLine(paper, aType.length, bType.length, cType.length, cellSize, padding); process = function(i,label) { txt = paper.text(390,((i+1)* cellSize) -

Irregular anchors and shapes using JS in HTML/HTML5

a 夏天 提交于 2020-01-04 07:03:56
问题 Is it possible to have irregular shapes like anchors on some surface in JS that can be clickable and it becomes a ball on runtime on page loads? I want to animate that surface that can be a ball and also want to track that which anchor shape is at particular point. So is it possible using JS? How can this be achieved? I was unable to find any solution. Is there some JS library that can do this? Something like processing.js or Raphael js? 回答1: I suggest using SVG with excelent Raphael js

For-loop not working for JavaScript animation

烈酒焚心 提交于 2020-01-04 06:49:44
问题 I am trying to write a for-loop to repeat the animation of the 'explode' path when a shape button is clicked but the for loop isn't working/executing and I can't see where its gone wrong. Aim of the for loop: loop the process of animating the path and then reversing the animation back to its original path. I know that the problem is somewhere in the for loop as the explode.animate() method just before the loop works. Note: I am using Raphael.js for this animation var explode = paper.path("M

How to select a raphael svg tag with jQuery?

天大地大妈咪最大 提交于 2020-01-03 04:58:49
问题 I'm quite new to Raphael, and quite lost too in its documentation... I'd like to manipulate a Raphael object through jQuery: $(".handle").hover( function() { $("path[rel='"+$(this).attr('rel')+"']").addClass("pathhover"); }, function() { $("path").removeClass("pathhover"); } ); Path is a Raphael-generated path, and jQuery does not seem to be able to select this svg tag. Would you have an idea how to achieve this ? Thanks ;) 回答1: Here is a solution, thanks to jacktheripper help. The raphael