You are here

function d3_examples_forcedirected in d3.js 7

Demonstrates a force directed graph using the Graph API module.

1 string reference to 'd3_examples_forcedirected'
d3_examples_menu in modules/d3_examples/d3_examples.module
Implements hook_menu().

File

modules/d3_examples/d3_examples.module, line 93
D3 Example module file.

Code

function d3_examples_forcedirected() {
  $graph = graphapi_new_graph();
  graphapi_add_link($graph, "graphapi_relation", "relation");
  graphapi_add_link($graph, "graphapi_relation", "graphapi");
  graphapi_add_link($graph, "graphapi", "views");
  graphapi_add_link($graph, "php", "graphapi");
  graphapi_add_link($graph, "graphapi", "graph_phyz");
  graphapi_add_link($graph, "graphapi", "graphviz_filter");
  graphapi_add_link($graph, "graphapi", "thejit");
  graphapi_add_link($graph, "thejit", "thejit_spacetree");
  graphapi_add_link($graph, "thejit", "thejit_forcedirected");
  graphapi_add_link($graph, "thejit", "thejit_x");
  $options = array(
    'width' => 400,
    'height' => 400,
    'item-width' => 45,
    'engine' => 'd3',
  );
  return theme('graphapi_dispatch', array(
    'graph' => $graph,
    'config' => $options,
  ));
}