Questions tagged [snap.svg]

Snap.svg is a JavaScript library for creating and working with SVG.

Snap.svg is an open source library for creating and working with . It helps create interactive vector graphics with support for interactivity, animations and also allows working with existing svg with a simple JavaScript API.

Snap.svg was written by Dmitry Baranovskiy (author of Raphaël), and is designed specifically for making it easier to work with svg, and supporting features like masking, clipping, patterns, full gradients, groups, and more. The project is released by Adobe Systems.

References:

Demo

Drawing styling and adding animation to a circle.

var s = Snap(500,500);
var circle = s.circle(150, 150, 100);

circle.attr({
    fill: "#bada55",
    stroke: "#000",
});
circle.animate({r: 50}, 1000);
784 questions
3
votes
1 answer

mouseenter event on background svg elements

Is there a way of triggering mouseenter events on SVG elements that are behind other elements? It seems like the top element is catching the event and it is not bubbling up the DOM. Alternatively, is there a good way of checking if the mouse is…
chopper
  • 6,649
  • 7
  • 36
  • 53
3
votes
3 answers

Add onclick function in pie chart

I need to add a graph in my project and I tried one free graph (link is given below) I need to add an onclick handler to that pie chart. I think need to add the onclick function inside snap.svg.js (in path tag) I tried a lot but didn't get…
BEGINER
  • 115
  • 1
  • 1
  • 6
3
votes
2 answers

Make loaded svg invisible in snap.svg

I have loaded my svg image, but now I want to make it invisible. And I can't find a way to do it ... var snapObj = Snap("#svgElement"); var group = snapObj.group(); var svgImage; Snap.load("../img/image.svg", onImageLoaded); function…
EMerckx
  • 182
  • 1
  • 10
3
votes
1 answer

Snap.svg animate

I'm brand-new to JS, but am trying to pick up snap.svg. I'm trying to animate a circle that was created with snap, but I can't seem to get more than one thing to happen at a time. Right now, the circle changes color when it's 'moused over,' but I'd…
CrystalH
  • 87
  • 3
  • 11
2
votes
0 answers

I tried but failed to print out the id of circles with in the fo loop

i would like to draw your kind attention (please see below my tries) of the followings where i tried to print out the id's of all circles with in the double for loop but can not. Every time i got null or [object SVGCircleElement].