raphael

Merge SVG and .JPG into one image?

蹲街弑〆低调 提交于 2019-12-12 10:39:37
问题 I have an website using SVG/VML (via Raphael JS) setup in a mapping application where the SVG is used to display graphics atop a backdrop map image. This works very well onscreen, and for printing hardcopy maps with overlays. Where this setup falls apart however is when the user wants to save the map image with the SVG overlay to a local .JPG file. More specifically, using the standard right-click functionality of most browsers to "Save image as..." does not work when there is an SVG/VML

Right mouse click detection on SVG shape in JavaScript not working

醉酒当歌 提交于 2019-12-12 10:36:26
问题 I need some help with my script in which I would like to detect RMB click. INFO: finally I want to display my own right-click menu on a dedicated SVG shape, which is displayed with a use of Raphael js lib, I found out that there are many different examples on web, even very simple ones to implement, like with jQuery - but I have to be able to detect wether RMB was clicked or any other. I have tried (without success on RMB) a following peace of code: <html> <head> <script type="text/javascript

Making an animating arc in d3 responsive?

前提是你 提交于 2019-12-12 08:55:27
问题 I was looking at this animation in d3, http://bl.ocks.org/mbostock/5100636 And I was wondering is there any way to make this responsive, so that the size changes with resizing of the browser window ? Or if it would be easier using raphael.js ? Here's the code : <!DOCTYPE html> <meta charset="utf-8"> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script> var width = 960, height = 500, τ = 2 * Math.PI; // http://tauday.com/tau-manifesto // An arc function with all values bound

Raphael.js drag with scale causes weird jumping behavior

混江龙づ霸主 提交于 2019-12-12 08:48:09
问题 I'm trying to resize/scale an image using Raphael.js's built in drag method, but I'm getting some weird behavior. Here is the jsfiddle: http://jsfiddle.net/charleshimmer/5pdyy/1/ Use the right or bottom right corner to resize the image. You will see some weird behavior with it jumping and skipping using the scale method. Anybody have any idea why? I can get it to resize smoothing by updating the image's width and height, but then the aspect ratio is off. Using image.scale , the aspect ratio

Making charts in RaphaelJS that are 100% width?

懵懂的女人 提交于 2019-12-12 07:49:19
问题 I have seen graphs in Flash & stuff that basically adapt nicely to whatever the size of the browser or flexible element they are inside of.... I'm not really too well versed with raphaelJS but can you do this, and if so, how? 回答1: In raphaeljs, you can call .setSize on a Raphael object to update its size. To adapt to runtime changes in browser window size, you can respond to a window resize event. Using jQuery, you could do: // initialize Raphael object var w = $(window).width(), h = $(window

Javascript game, module raphael not defined

微笑、不失礼 提交于 2019-12-12 05:48:16
问题 I am developing a game engine here: http://synodins.com/apps/tank_fight But now, for some reason, it doesn't run anymore. I cannot initiate the Raphael module, when i run the site with mozilla web debugger, i get "Raphael is not defined". But that doesn't make any sense because it's very clearly defined in the raphael.js module. Also, occationally the game runs fine, like, every 20th time i try. And there's no clear pattern to what makes it work. I print out Hello world 1 before trying to

Retrieve attributes of raphael pie chart

依然范特西╮ 提交于 2019-12-12 04:37:17
问题 How to get the attributes of raphael pie chart: attributes like: stroke, values (not with legend), radius, x and y position My pie chart is defined as: pie = r.piechart(120, 140, 50, [55, 22], { colors: ["green","red"], stroke: "black" }); I tried: this.stroke -- says undefined // I know this is getting me the raphael object correctly since I am doing some work also this.click(function () { alert(this.stroke); }); this.attr('stroke'); -- does not even display undefined Any idea how to solve

how can i add click evet to my rapahel pie chart?

旧时模样 提交于 2019-12-12 04:15:47
问题 How can I add click event to my Rapahel pie chart ? var r = Raphael("holder-1",340, 185); pie = r.g.piechart(150,85, 75, values , {legend: labels, legendpos: "east"}); i got the answer it is pie.click(function () { }); can i pass value to the onclick event ?, here can i pass values and labels to onclcik function ?? 回答1: According to the docs for the node attribute, you should just be able to attach events as you would any DOM element using it: pie.node.onclick = function () { /* Something */

RaphaelJs Pie Chart Animation on Hover

孤街浪徒 提交于 2019-12-12 04:08:15
问题 i am customizing the pie chart given on the raphael site below link http://raphaeljs.com/pie.html this chart shows animation when hover a slice, this animation simply expand the slice a little what i want is to separate the slice from the chart i played with the transform property of following lines of code but could not make it as i want. p.mouseover(function () { var xis= p.getBBox(true); p.stop().animate({transform: "s1.1 1.1 "+ cx + " " + cy }, ms, "linear"); txt.stop().animate({opacity:

Using setAttribute with an array of Raphael paths

梦想的初衷 提交于 2019-12-12 04:06:12
问题 When 'things' in the following code is an array of paths... things.square = [ RM.path("m 154.21525,71.431259 74.32805,0 0,70.496711 -74.32805,0 0,-70.496711 z").attr(attr), RM.path("m 271.25132,77.933263 58.07304,0 0,56.409037 -58.07304,0 0,-56.409037 z").attr(attr2) ]; ...then this code does not work: things.square[1].node.setAttribute("id","clicker"); ie it fails to assign the second path in the array to id 'clicker'. However, when 'things' is just a single path... things.square = RM.path(