raphael

RaphaelJS 2.1 vs. 1.5.2 getBBox Error

百般思念 提交于 2019-12-24 00:03:46
问题 I'm trying to create a draggable graph similar to http://raphaeljs.com/graffle.html (works in both 1.5.2 and 2.1), but I want to include text in the boxes. I added the text using the suggestion in another question: How can I combine objects in the Raphael javascript library? This solution works great with RaphaelJS 1.5.2, but it breaks in RaphaelJS 2.1. jsFiddle Example: http://jsfiddle.net/ScBtZ/ The only difference I have found is that Element.getBBox() returns a very different result.

Performance of RaphaelJS with thousands of paths/rectangles

无人久伴 提交于 2019-12-23 20:41:04
问题 I really only care about Webkit, but in general, is Raphael JS expected to perform well when building thousands of rectangles? Additionally, I would need to be able to handle events on each of these rectangles (yipes). I've got a C++ solution which works but I'd rather use RaphaelJS. Thanks :) 回答1: I don't know nothing about RaphaelJS but I can give you a performance hint with this code: <!DOCTYPE html> <html> <head> <meta charset = "utf-8"> <title></title> <script> window.onload = function (

Why is dragging in Raphaël broken by stopping propagation of mousemove in an enclosing element in the bubble phase?

亡梦爱人 提交于 2019-12-23 19:20:15
问题 I am trying to debug an event handling bug in a complicated web application, but I've reduced the problem to a simple example that demonstrates the behaviour that I'm confused by. My example page, based one of the Raphaël examples, is as follows: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Raphaël · Drag-n-drop Example</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script

Raphael Path Intersection not working

柔情痞子 提交于 2019-12-23 19:06:39
问题 I am having an issue with Raphael and the .pathIntersection() method. JSFiddle example You can see that there are two lines which both intersect the curvy line but only one of them is showing up as an intersection when I use the .pathIntersection() method. There is an opened issue in Github with a possible cause but I wanted to make sure I wasn't doing anything silly either. So if anyone can see a problem I have done or possibly confirm I am using it right and it is a problem with the library

Half circle using raphael

喜夏-厌秋 提交于 2019-12-23 12:01:46
问题 I'm very new to using raphael js library and I'm trying to figure it all out. I'm trying to create a chart based on percentages where 100% would be a full circle. The circle part I have figured out, but how would I go about changing it to show a half-circle for 50% or a quarter of a circle for 25%? 回答1: I recommend looking at the code behind this example on the Raphael home page. It should be easy enough to modify it to suit your needs. This function in particular is what you're looking for

RaphaelJS rotation not working

可紊 提交于 2019-12-23 11:39:26
问题 I'm banging my head against a wall with this one. I have raphael js version 2.0 and I need to make images rotate in a way that's cross-browser. I would love to do it in CSS3, but not all browsers support what I need to do. so, after racking my brain, I went to the Raphael playground and tried out some code in there. Doesn't work there either. What's going on here? go to playground: http://raphaeljs.com/playground.html run this code, should see an outline of a square. paper.rect(100, 100, 300

create fluid (scaling) concentric arcs using css, canvas, or svg

半世苍凉 提交于 2019-12-23 04:57:13
问题 I am trying to create a graph like this: http://bl.ocks.org/cmdoptesc/6228457 or like this http://raphaeljs.com/polar-clock.html But I want it to be able to scale (preferably without javascript) according to the browser width. I would love to be able to do this with CSS only, and if not with CSS, preferably without a library like raphael or d3 (though I'll take what I can get). Anybody know how to accomplish this in a way that scales down / up? UPDATE I made a JS Fiddle - this is exactly the

SVG, Raphael.js, JSON data - can't figure out how to get description to appear

南笙酒味 提交于 2019-12-23 04:57:12
问题 I've been building a custom SVG map of England and trying to have pieces of the array data appear at the bottom of the map. So far I've gotten the title to appear but keep getting 'undefined' for my description field. My data is structured like this: var regions = [ {'title':"Northeast England",'description':"<p>Paragraph</p><p>Does adding HTML here work?</p>", 'path' : "M219.02,6.876l-0.079,0.05l-0.482,0.371L218.23,7.47l-0.858,0.346h-0.008l-0.307,0.26l-0.779,0.666 l-0.104,0.278l-0.005,0

Animating a counter-clockwise arc in raphael.js

爱⌒轻易说出口 提交于 2019-12-23 04:06:16
问题 I got the exact arc animation I need from the thread drawing centered arcs in raphael js However, I need another instance of this arc drawn counter-clockwise, while this one only seems to be clockwise. Is it possible for this arc to be drawn and animated counter-clockwise? code snippet from the answered question: // Custom Arc Attribute, position x&y, value portion of total, total value, Radius var archtype = Raphael("canvas", 200, 100); archtype.customAttributes.arc = function (xloc, yloc,

Get JSON data with AJAX and then modify raphael.js script

僤鯓⒐⒋嵵緔 提交于 2019-12-22 18:51:14
问题 This is what I want to achieve: I want to create an interactive map using raphael.js. Using Php, I get datas from MySql DB and converted into a JSON file. So far so good. Inside my raphael js file, I must now: get those datas use them in order to modify my raphael file. I am currently stuck at this first step. Here's my simplified JSON file (let's call it countries.json) : [ { "id": "1", "type": "Country", "title": "France", "published": "1", "description": "Republic" }, { "id": "2", "type":