raphael

Is there a fluent transition possibility for animation font-size in Raphael JS?

Deadly 提交于 2019-12-04 12:19:03
问题 So far it seems like it is not fluent , but choppy. E.g. if you have one state attribute with font-size: 14 and want to animate to state with font-size: 16, the transition doesn't look smooth. It jumps in 2 steps. First change to 15 and then to 16px. Can it be forced to look more smooth? I am using Firefox 14 for testing. My current code: var fillerText = { "fill" : "#00738f", "font-size": 14, "font-family": "Arial, Helvetica, sans-serif" } var fillerTextHover = { "fill" : "#00738f", "font

Can I use print in Raphael without Cufon?

落爺英雄遲暮 提交于 2019-12-04 12:15:54
问题 I am trying to use the print command, mentioned in the documentation for Raphael, to, well, print text with a nice font. [I see that this can be done nicely using the "text" function, and I see examples on the web using fonts generated by Cufon with the print function (as in these examples for 'text' and 'print'), but what I'm doing is as close as I can make it to the example in the documentation and does not work for me, and I'd like to know why.] Here's my code: <html> <head> <title>Raphael

Raphael - Drawing shapes with mouse

我怕爱的太早我们不能终老 提交于 2019-12-04 11:56:17
问题 What would be the best way to draw a rectangle or circle for that matter using your mouse ? I just started looking at raphael and it seems I should use, drag? Or mousedown and mouseup ? No sure. 回答1: I would use mousedown and mouseup events on your canvas/paper. On mouse down you should store the x and y positions of the mousedown, then on mouseup you should use the current mouse positions to calculate width and height. Here is an example, bear in mind thought that I am using JQuery to

raphael viewbox animated zoom

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 11:54:47
I'm build a kind of javascript map with javascript and the Raphael lib. I'm able to zoom on an object when clicked, but I want it to be animated (like slowly diving in and so on). Is there a way to do so without reinventing the wheel? There is no reason that the viewbox of an svg object cannot be animated -- Raphael simply doesn't provide such functionality out of the box. Creating a plugin is reasonably straightforward, however. For instance: Raphael.fn.animateViewBox = function animateViewBox( x, y, w, h, duration, easing_function, callback ) { var cx = this._viewBox ? this._viewBox[0] : 0,

Raphael order objects

痴心易碎 提交于 2019-12-04 10:51:02
问题 I'm trying to order Raphael objects. I don't have the option of deciding when the objects are created, but I'd like to make a group of objects appear behind a group of other objects after they've been created. Can anybody help me do this? Thanks. 回答1: Group you items in two sets and position the sets relative to each other with insertBefore or insertAfter: var front = paper.set(); front.push(front1, front2); var back = paper.set(); back.push(back1, back2); front.insertBefore(back); Also if

How do you draw an arrow at the end of a bezier curve in SVG / raphael?

守給你的承諾、 提交于 2019-12-04 09:48:04
问题 I have a curve generated by this: var path = ["M", x1.toFixed(3), y1.toFixed(3), "L", arrow_left_x, arrow_left_y, "L", arrow_right_x, arrow_right_y, "L", x1.toFixed(3), y1.toFixed(3), "C", x2, y2, x3, y3, x4.toFixed(3), y4.toFixed(3)].join(","); but my arrow is not correctly done. - it only points to the right, and doesn't point the same direction as the slope of the curve at the end of the bezier. - it is not filled now, I know I'm not doing the math correctly here, but mainly, I just want

Mobile Safari SVG rendering issues with raphaeljs

孤者浪人 提交于 2019-12-04 09:39:51
问题 I am working on an animated, interactive graph using raphael that I need to work well on the iPhone. I have 2 minor rendering issues that I'm struggling with. The first is that whenever you click on an svg element that has a click handler attached, mobile safari draws a transparent gray box around it to indicate what was clicked. It's the same thing it does when you click on a hyperlink. The gray box is very ugly in this situation. Is there any css property to tell mobile safari not to do

event handler on center of doughnut chart using chart.js

浪尽此生 提交于 2019-12-04 09:16:38
I have created 4 doughnut chart on a page which has some text in the center,I know this can be done by placing a DIV over the center but I cant use that as the text doesn't get exported when the chart is downloaded as PNG : Demo: https://jsfiddle.net/cmyker/ooxdL2vj/ I need to track the click of the center text for this I tried using the pageX,pageY to determine if the click is made on the center section. The coordinates are of the corners of the rectangular section which is inside the central hole of the doughnut chart & is likely to have the text within. jQuery('#canvas').on('click',function

D3.js vs Raphael.js

房东的猫 提交于 2019-12-04 07:25:56
问题 I'm fascinated by both d3 and Raphael. I understand that Raphael is built on top of D3 and that it is cross-browser compatible, but I'm not sure which one is better suited for what scenarios. Can somebody please shed some light? My immediate use-case is potentially using the SIMILE timeline and integrating it with a state diagram (for which I intend to use d3/Raphael). Thanks! 回答1: Raphael is not built on D3. Raphael will help you draw elements. D3 is more comprehensive and will help you bind

Letter Shadows from User Input

假如想象 提交于 2019-12-04 06:58:17
问题 Goal: User types name into user input field, selects Animate button, and name is printed vertically with each letter containing a drop shadow of each letter. The Javascript library Raphael may be desirable. Problem: So far what I have is the name being printed vertically twice side by side. Obviously the second column should be the letters as drop shadows, but I don't know how to change the style of them to look like shadows. My manager gave me one hint: "I had to create a 2nd text line