Coder Social home page Coder Social logo

adobe-webplatform / snap.svg Goto Github PK

View Code? Open in Web Editor NEW
13.9K 402.0 1.1K 3.54 MB

The JavaScript library for modern SVG graphics.

Home Page: http://snapsvg.io

License: Apache License 2.0

JavaScript 99.47% HTML 0.53%
javascript javascript-library snap svg svg-animations

snap.svg's Issues

Create a v0.1.0 tag

Once all issues have been addressed, create a v0.1.0 tag and get Yohie the link to the zip file.

Color parsing fails when using percentages

According to the API docs under Savage.getRGB(colour) it should be possible to parse colors with percentages set, like rgb(•••%, •••%, •••%) for rgb, hsl and hsb. However, all tests with strings like this appear to fail.

Add missing unit tests

Looking the API docs and existing tests, the following methods still need testing and will be tracked here:

Savage

  • Savage.Matrix()
  • Savage.ajax()
  • Savage.animate()
  • Savage.animation()
  • Savage.color()
  • Savage.deg()
  • Savage.format()
  • Savage.fragment()
  • Savage.getRGB()
  • Savage.hsb()
  • Savage.hsb2rgb()
  • Savage.hsl()
  • Savage.hsl2rgb()
  • Savage.is()
  • Savage.load()
  • Savage.parse()
  • Savage.parsePathString()
  • Savage.parseTransformString()
  • Savage.pathBBox()
  • Savage.rad()
  • Savage.rgb()
  • Savage.rgb2hsb()
  • Savage.rgb2hsl()
  • Savage.select()
  • Savage.selectAll()
  • Savage.snapTo()

Savage.filter

  • Savage.filter.blur()
  • Savage.filter.brightness()
  • Savage.filter.contrast()
  • Savage.filter.grayscale()
  • Savage.filter.hueRotate()
  • Savage.filter.invert()
  • Savage.filter.saturate()
  • Savage.filter.sepia()
  • Savage.filter.shadow()

Savage.path

  • Savage.path.findDotsAtSegment()
  • Savage.path.toAbsolute()
  • Savage.path.toCubic()
  • Savage.path.toRelative()
  • Savage.path.map()
  • Savage.path.isPointInside()
  • Savage.path.intersection()

Matrix

  • Matrix.add()
  • Matrix.clone()
  • Matrix.invert()
  • Matrix.rotate()
  • Matrix.scale()
  • Matrix.split()
  • Matrix.toTransformString()
  • Matrix.translate()
  • Matrix.x()
  • Matrix.y()

Set

  • Set.clear()
  • Set.exclude()
  • Set.forEach()
  • Set.pop()
  • Set.push()
  • Set.splice()

Mina

  • mina.backin()
  • mina.backout()
  • mina.bounce()
  • mina.easein()
  • mina.easeinout()
  • mina.easeout()
  • mina.elastic()
  • mina.getById()
  • mina.linear()
  • mina.time()

Snap logo is throwing an error

Very high priority.

The snap-mascot demo isn't working. Mousing over the mascot throws this error:

Uncaught TypeError: string is not a function: snap.svg-min.js 18

Coffee Maker fonts don't work

Check the screenshot. Please do one of the following:

  • Use a font from Typekit/Edge Web Fonts.
  • Use a font that more people have installed.

Please do not:

  • Check in the AdobeClean-Light font into this repo. (We can't do that.)

Let me know if you have questions. If you need another font, ask Yohei.
coffee_maker_fonts

stroke-dashoffset does not animate

following code does not animate line as it should:

var s = new Snap('100%', '100%');
myPath = s.path('M0,0c0,0,0-28.008,0-46.707S0-89,0-89');
myPath.attr({
'fill': 'none',
'stroke': 'red',
'stroke-width': 25,
'stroke-miterlimit': 10,
'stroke-linecap': 'round',
'opacity': 1,
'stroke-dasharray': "120 200",
'stroke-dashoffset': 0
});
myPath.transform('translate(100, 300)');
myPath.animate({'stroke-dashoffset': 120});

consider a package manager

npm / component / bower or something so that the little chunks are useful to people (and to keep yourself sane), then produce a snap build from those. Otherwise looks good! :D

Mention of sudo with npm

The README should mention that you might need to use sudo with npm, depending on your configuration.

Create a "getting started" guide

Write a getting started guide for the site, and link to it from the README. It should include:

  • Getting the repo (or downloading the zip file).
  • Building it with grunt.
  • Including the library.
  • Initializing Snap.
  • Drawing a couple of shapes.
  • Animating them.

Write it up, and send it to Yohei for inclusion on the site.

Issue with triggering .animate() from another .animate()'s callback

Came across a case where Element.animate() is not triggered from within another Element.animate()'s callback. I was able to resolve the issue by wrapping the second animate function in a setTimeout of 50ms. Appears to be a timing issue.

road_bottom.animate({x2:691.5}, 2000, function(){
    tunnel_mask_bottom_right.animate({
        y: 394,
        height:150
    }, 200);
    });

The removed test should return!

Investigate why the test is not passing while the same code on the page is working perfectly.

The broken test code:

    it("Element.asPX - from em", function() {
        var rect = s.rect(0, 0, 10, '10em');
        var heightAsPx = rect.asPX("height");
        expect(heightAsPx).to.be(160); // assumes 1em = 16px, is this safe?
    });

Create a "demos" directory

Create a "demos" directory for the samples. Create directories for each demo so the HTML and SVG assets are together. Name the demo directories something descriptive (i.e. "map", "barista", etc.).

API Reference for Matrix.add incorrect

Currently it appears as:
Matrix.add(a, b, c, d, e, f, matrix)

which based on the code should be split to accepting either a-f params or just the matrix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.