Skip to content

yhara/opal-raphael

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

opal-raphael

Opal binding for Raphael.js.

Tested with Opal 0.6.2, Raphael 2.1.2.

Example

  paper = Raphael(0, 0, 600, 600)

  background = paper.rect(0, 0, 600, 600)
  background.attr("fill", "#efefef")
  background.attr("stroke", "#efefef")

See example/app/application.rb for full example.

Status

Early alpha

  • Can render circle and rect
  • Animation, Matrix, Raphael.*, Set, eve are not supported (Waiting for your pull request!)

See opal/opal-raphael.rb for list of supported methods.

  • (Note1: some of the methods may return raw JS object. It should be wrapped with Raphael::Element, etc.)
  • (Note2: method names are intentionally kept lowerCamelCase, so that you can find corresponding Opal method easily)

Getting started

  1. Copy example/* to somewhere

  2. Edit Gemfile

  • before: gem 'opal-raphael', path: '../'
  • after: gem 'opal-raphael'
  1. bundle install

  2. bundle exec rackup

  3. Open http://localhost:9292/

Then you'll see:

Caveats

Currently does not work well with opal-jquery (see opal/opal#547 )

History

  • v0.0.2 (2014/06/10)
    • Add some methods
  • v0.0.1 (2014/06/10)
    • initial release

About

Opal binding for Raphael.js

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages