Questions tagged [svg.js]

svg.js is a lightweight library for manipulating and animating SVG. Svg.js has no dependencies and aims to be as small as possible and is licensed under the terms of MIT License.

svg.js is a lightweight library for manipulating and animating SVG. Svg.js has no dependencies and aims to be as small as possible and is licensed under the terms of MIT License.


Hello World Example

<div id="drawing"></div>
<script>
    var draw = SVG('drawing').size(300, 300)
    var rect = draw.rect(100, 100).attr({ fill: '#f06' })
</script>

396 questions
-2
votes
1 answer

SVG equivalent of movieclip

I'm working on a Flash project that has to be translated to HTML5 and SVG. In Flash there is something called a movieclip. A movieclip can be like a class inside a Flash movie. So, if I wanted to make a swarm of butterflies... I would create one…
Bigman74066
  • 408
  • 4
  • 12
-2
votes
1 answer

Add style from external scss file to SVG.js element

I create a svg and add a path to it with SVG.js as follow. this.roomPlan = SVG('roomPlan').attr('id','roomPlanSvg').size(1024, 768); this.roomPlan.path(room.area.d); I have a external .scss file and I have some style as follow; .room-bg { fill:…
Fatih Svk
  • 41
  • 1
  • 3
  • 9
-2
votes
1 answer

html content inside a SVG

i am trying to use a html content inside a svg code and for some reason SVG doesnt recognize this code. The html code works fine as a standalone. but when i copy this html code inside the SVG's tag it doesnt work. i have tried this foreigntag…
-2
votes
2 answers

Transfer attributes from one tag to another

My goal is to mask each individual image in a portfolio using svg.js to generate the image mask. I am working with svg.js and a cargo.collective theme. I wrote some js to generate the tag and wrap a set of images individually, this works fine…
tijanicharles
  • 183
  • 3
  • 17
-4
votes
2 answers

How to crop svg?

I have an super large svg background and some elements are rendered on top of the background. I then want to crop the svg such that it fits the elements in the foreground and the background is cropped. Is this possible? I am using svg.js but I could…
J. Doe
  • 335
  • 1
  • 2
  • 11
-5
votes
1 answer

svg text wrapping issues

I am attempting to wrap called data into two lines of text on an svg. Right now it is displaying the text over six lines. Can anyone help with this. function wrap(text, width, content) { text.each(function () { var text =…
Corcorancr
  • 1
  • 1
  • 1
  • 2
1 2 3
26
27