1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| var line = draw.line(0,0,100,50).stroke({width : 1,color:'red'})
line.plot(50,30,100,150) line.plot("50,30,100,150") line.plot([ [0,0], [100,150] ]) line.animate(500).ease("<>").plot([ [200,200], [100,150] ]).loop(true,true)
var polyline = draw.polyline('0,0 100,50 50,100 150,200').fill('none').stroke({width : 1,color:'red'}) draw.polyline([[30,30], [100,50], [50,100]]).fill('none').stroke({width : 1,color:'yellow'}) draw.polyline([50,50, 100,50, 50,100]).fill('none').stroke({width : 1,color:'blue'}) polyline.animate(3000).plot([[0,0], [100,50], [50,100], [150,50], [200,50], [250,100], [300,50], [350,50]])
var polygon = draw.polygon([[0,0], [100,50], [50,100], [150,50], [200,50], [250,100], [300,50], [350,50]]).fill('red').stroke({ width: 1 })
polygon.plot([[0,0], [100,50], [50,100], [150,50], [200,50]])
polygon.animate(3000).plot([[0,0], [100,50], [50,100], [150,50], [200,50], [250,100], [300,50], [350,50]])
var path = draw.path('M10 80 C 40 150, 65 150, 95 80 S 150 10, 180 80').stroke({ width: 1 }) path.animate(2000).plot('M10 80 C 40 150, 65 150, 95 80 S 150 10, 180 80')
var textpath = draw.text('SVG.js rocks!') var text = draw.text("Lorem ipsum dolor sit amet consectetur.\nCras sodales imperdiet auctor.") var text = draw.text(function(add) { add.tspan('Lorem ipsum dolor sit amet ').newLine() add.tspan('consectetur').fill('#f06') add.tspan('.') add.tspan('Cras sodales imperdiet auctor.').newLine().dx(20) add.tspan('Nunc ultrices lectus at erat').newLine() add.tspan('dictum pharetra elementum ante').newLine() }) var text = draw.plain('Lorem ipsum dolor sit amet consectetur.').dy(20)
|