spadeisaspade
spadeisaspade

Reputation: 61

d3.js in drupal 7

Has anybody implemented an instance d3.js in drupal 7 successfully?

I plugged in the main d3.js libraries into the page header without problem... but I get all sorts of errors when I try to put code that actually draws something into a page or block...

Somebody managed it with protovis a couple of years ago... http://drupal.org/node/516282#comment-2232740 and i was trying to work along the same lines.

A module package something like the one for http://drupal.org/project/thejit would be a big timesaver.

Thanks for any clues/guidance/examples!

Upvotes: 3

Views: 2454

Answers (4)

Pierre.Vriens
Pierre.Vriens

Reputation: 2117

Here are some contributed module suggestions for D7, which may help to use the D3.js library in a Drupal site:

  • Charts and Graphs (Official release available).

    Charts and Graphs is an API for developers. It can be extended by third-party modules that want to add their own charting implementations. It does nothing by itself. It should only be installed if some other module requires it.

  • D3 (Alfa release only)

    creates visualizations as libraries (alpha version only) which allows one to add/remove visualizations, share them between modules, and integrate them with (for example: Views) through library .info files.

    The Basic module configuration presentation provide a short intro about how to use the module in combination with Views.

  • Forena (sandbox only)

    Refer to issue # 2383509 for more details.

Upvotes: 1

ted.strauss
ted.strauss

Reputation: 4339

There is a conversation in progress at Drupal.org about this. And there's a sandbox module in progress that can be grabbed at

git clone http://git.drupal.org/sandbox/asherry/1477334.git d3

D3 is amazing! A stable D7 module is probably 4+ months away but you never know.

Upvotes: 1

miro marchi
miro marchi

Reputation: 737

The conversation posted by @ted.strauss is now closed: it is possible to have D3.js directed layout as an engine for graph_api.

The main page for the project d3 for drupal, by asherry is https://drupal.org/project/d3.

As far as I'm concerned chart integration (which doesn't need graph_api but is directly managed by d3 module) works very well.

Upvotes: 0

Countzero
Countzero

Reputation: 153

Knowing what errors you get would definitely help us help you.

One hint : you have to be careful about the way you add your script to prevent namespace problems. Another important thing is the scope your library is using (JQuery, $, etc.) as Drupal includes its stuff in a specific way.

Upvotes: 0

Related Questions