Over a million developers have joined DZone.

Loading Raphael JS via require JS

· Web Dev Zone

Start coding today to experience the powerful engine that drives data application’s development, brought to you in partnership with Qlik.

Raphael, the SVG JavaScript library, does not support require JS (yet). When loaded via require('raphael'), the code breaks throwing 'eve is not defined' error in the console. There is a year long issue thread going on regarding this issue, but still there is no official fix yet.

Anyway, in the same thread, people started providing patches that fix this issue (for time being). And in one of the project, I saw the Raphael source code split into different files and converted to CommonJS module pattern.

I took the liberty to extract only the raphael-js modules and put them together in this Github repo: https://github.com/vraa/raphael-require

So, if you have a need, please feel free to use the above repo and let me know if you face any issues.

Create data driven applications in Qlik’s free and easy to use coding environment, brought to you in partnership with Qlik.


Published at DZone with permission of Veera Sundar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}