function tripal_feature_cv_tree

1.x tripal_feature.module tripal_feature_cv_tree($tree_id)

Related topics

File

tripal_feature/tripal_feature.module, line 2128
@todo Add file header description

Code

function tripal_feature_cv_tree($tree_id) {

  // The CV module will create the JSON array necessary for buillding a
  // pie chart using jgChart and Google Charts.  We have to pass to it
  // a table that contains count information, tell it which column
  // contains the cvterm_id and provide a filter for getting the
  // results we want from the table.
  $organism_id = preg_replace("/^tripal_feature_cv_tree_(\d+)$/", "$1", $tree_id);
  $options = array(
    cv_id => tripal_cv_get_cv_id('sequence'),
    count_mview => 'organism_feature_count',
    cvterm_id_column => 'cvterm_id',
    count_column => 'num_features',
    filter => "CNT.organism_id = $organism_id",
    label => 'Features',
  );
  return $options;
}