Active
Project:
Raphaël
Version:
7.x-2.x-dev
Component:
Raphaël
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2012 at 02:35 UTC
Updated:
16 Jan 2013 at 20:27 UTC
I've looked around but don't manage to understand how to use the Raphael module. I expected it to load the javascript file after enabling the module but that doesn't seem to be the behaviour.
I don't need to use theme functions of gRaphael, only include the raphaeljs libraries.
For the time being I'll just add the javascript to the theme, but would like to know the basics about the module.
Thanks in advance.
Comments
Comment #1
phaer commentedA README.markdown is included in the modules source: http://drupalcode.org/project/raphael.git/blob/refs/heads/7.x-2.x:/READM...
Comment #2
lEaDbEllY commentedOk, so I added 'drupal_add_library('raphael', 'raphael', TRUE);' (without the quotes) to the bottom of my themes template.php file, and I'm looking at the gRaphael example graphs, and it shows the titles and no graphs. Is that normal? Do I have to manually install the graphs (I am assuming that the modules included are just templates that I have to add more stuff to for the examples to be functional). Is that correct? I can get raphael graphs to show up outside of drupal, but not from within drupal, so I assume that I have to add more. Please confirm.
Comment #3
googletorp commentedThe example module is just examples of how the module can be used.
This is an API module, which means you should create the grafs etc in a custom module and this module helps you along the way. The module can also simply be used to load JavaScript files, if you want to handle the JavaSript yourself, in that case handling all of it in the theme would be just fine.
Comment #4
dddbbb commentedI have followed the instructions but when trying to create a new Raphael object I get the following console error:
Raphael is not defined
drupal_add_library('raphael', 'raphael', TRUE);from within a custom module that is already confirmed working.var paper = new Raphael(document.getElementById('zone-content'), 500, 500);Searching my markup reveals no mention of the raphael.js library being included - this doesn't look right to me.
Any ideas what's going on here?
Comment #5
Zorkoff commentedDid you install Entity API and Libraries API? And the path to the library should be sites/all/libraries/raphael/raphael.js.