Skip to content

papakpmartin/raphael-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

raphael-loader

RequireJS module to load Raphael without errors.

As part of my learning curve getting into RequireJS, I was encountering problems loading up Raphael... I was getting "eve is not defined" at best, nothing at worst.

It turns out that since eve, a dependency of Raphael, can conditionally work in a module environment, the eve object gets stashed away to a location other than where Raphael expects (it looks for eve in global space).

My goal here is not to modularize Raphael (I'd rather use 3rd party code as-is), but just to be able to easily use Raphael when I'm using RequireJS. So basically, Raphael remains a global.

So this module simply loads eve as a dependency to Raphael before loading Raphael.

To use this, I do the following:

  1. Get a fresh Raphael by cloning and updating submodules per https://github.com/DmitryBaranovskiy/raphael/#readme
  2. Put this project's "raphael-loader" directory in with your scripts (you'll see that raphael-loader assumes a "scripts/libs" structure)
  3. Use "raphael-loader/main" as a dependency

See the project page for an easy example of how I'm using it.

Alt text

custom_mark10 digraph G { size ="4,4"; main [shape=box]; main -> parse [weight=8]; parse -> execute; main -> init [style=dotted]; main -> cleanup; execute -> { make_string; printf}; init -> make_string; edge [color=red]; main -> printf [style=bold,label="100 times"]; make_string [label="make a string"]; node [shape=box,style=filled,color=".7 .3 1.0"]; execute -> compare; } custom_mark10

About

RequireJS module to load Raphael without errors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published