包详细信息

raphael

DmitryBaranovskiy827.1kMIT2.3.0

JavaScript Vector Library

svg, vml, javascript

自述文件

Raphaël: Cross-browser vector graphics the easy way

Visit the library website for more information: http://raphaeljs.com https://dmitrybaranovskiy.github.io/raphael/

Quickstart guide

You need to have NPM installed to build the library.

  • git clone https://github.com/DmitryBaranovskiy/raphael.git
  • yarn install --frozen-lockfile
  • yarn build-all

To run tests you need to run npx bower install open dev/test/index.html in your browser, there's no automated way right now.

Dependencies

Distributable

All files are UMD compliant.

You can use:

  • raphael.min.js (includes eve and it's minified)
  • raphael.js (includes eve and it's not minified)
  • raphael.no-deps.js (doesn't include eve it's not minified)
  • raphael.no-deps.min.js (doesn't include eve it's minified)

Where to start

Check Raphael-boilerplate to see examples of loading.

Raphael can be loaded in a script tag or with AMD:

define([ "path/to/raphael" ], function( Raphael ) {
  console.log( Raphael );
});

Development

Versions will be released as we gather and test new PRs. As there are a lot of browsers being supported it might take a while to accept a PR, we will use the feedback from other users too.

You can use the raphaelTest.html to try things, you need to start a server in the root dir to start testing things there. Something like running python -m SimpleHTTPServer in the raphael directory and hitting http://localhost:8000/dev/raphaelTest.html with the browser. You should run npm run start before this can work.

Collaborators

Related Projects

Books

Copyright and license

Copyright © 2008-2013 Dmitry Baranovskiy (http://dmitrybaranovskiy.github.io/raphael/)

Copyright © 2008-2013 Sencha Labs (http://sencha.com)

Licensed under the MIT (http://dmitrybaranovskiy.github.io/raphael/license.html) license.

更新日志

2.3.0

  • Unminified versions now without sourcemaps (#1110)
  • start script for building all versions (#1109)

2.2.8

  • Downgraded qunit to v1 to make tests work again
  • Updated webpack to build dist
  • Updated supportsTouch query from modernizr #1084
  • Fix drag offsets passed to "drag.start" from touch drags in elproto.drag #1101
  • Fix memory leak in Element.removeData() #1077
  • Adding react-raphael to related projects #1072
  • Added icons back to raphael's website
  • Updated version in banner and raphael's website
  • Updated site refs to https

2.2.7

  • Updating package.json dependencies
  • Using custom eve instead of old eve in npm
  • Fixed class as a reserved word in old browsers

2.2.5 - 2.2.6

Duplicated tag by mistake.

  • Using custom repo for eve in bower to avoid using a short sha in it.

2.2.4

  • Fixed no-deps version with eve.

2.2.3

  • Changed eve dependencies avoiding short sha and github url

2.2.2

  • Improved elements ids, so multiple raphael instances are more reliable

2.2.1

  • Removed name of amd module

2.2.0

  • Webpack build
  • Added tests! (thanks @TheCloudlessSky)
  • Strict error on method R.ninja
  • Cross-browser gradient fixes
  • Reduce transform string to avoid long parsing times after several transformations
  • raphael.amd.js as main in package.json.
  • raphael.amd.js version to work with Browserify.
  • Can't set glow with opacity 0
  • Using origin and pathname with gradient urls, urls with # weren't being resolved correctly
  • Defined nodeps version, and changed how raphael is loaded
  • Set stop-opacity in gradient defs
  • Fixed rounding issue in RGB formatter

2.1.4 • 2015-03-09

  • Wrong position in ie7 when rotate image #612
  • Gradients become black in some cases

2.1.3 • 2015-02-03

  • Fix wrong variable used in VML setViewBox().
  • Missing comma in file
  • set-viewbox-variable fix by @TheCloudlessSky

2.1.2 • 2015-08-26

  • isPointInside fix from @drbombay14
  • Allow Raphael to work in pages with a Content Security Policy that disallows 'unsafe-eval'

2.1.1 • 2013-08-11

  • Dragging Text under iOS By @vitorhsb
  • Dev folder
  • Fix to make IE9 display tooltips when setting the title attribute on an element. By @samcrang
  • Fix Wrong position after scale path in IE. By @sarvaje
  • isPointInside incorrectly caches the path used to calculate its value. By @lvanderbijl
  • Raphael.path2curve does not honor original shape. By @timo22345
  • IsPointInside fix for transformed paths

2.1.0 • 2012-03-14

2.0.2 • 2012-02-08

  • Removing of linked element now removes <a> as well
  • Fixed white space recognition in passed strings
  • Added special case for path that has only one Catmull-Rom curve
  • Fixed toTransformString method
  • Fixed animateWith method
  • Fixed “target” attribute clearing
  • Fixed bug with changing fill from image to solid colour
  • fixed renderfix method

2.0.1 • 2011-11-18

  • Global variables leakage fix
  • toFront fix for elements with links
  • Gradient clean up
  • Added letter-spacing attribute
  • Fixed hsb methods
  • Fixed image flickering
  • Improved toTransformString method on matrix
  • Fixed drag'n'drop
  • New method Paper.add
  • Fix for clip-path
  • Doc update

2.0.0 • 2011-10-03