Skip to content

Commit

Permalink
Refs #4077, remove 'depth' property as it is no longer relevant w/ ne…
Browse files Browse the repository at this point in the history
…w dynamic truncation.
  • Loading branch information
Benaka Moorthi committed Sep 16, 2013
1 parent 986b297 commit ff9b4ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
6 changes: 3 additions & 3 deletions core/ViewDataTable.php
Expand Up @@ -574,11 +574,11 @@ protected function postDataTableLoadedFromAPI()
$genericFilter->filter($this->dataTable);
}

// Finally, apply datatable filters that were queued (should be 'presentation' filters that
// do not affect the number of rows)
if (!$this->areQueuedFiltersDisabled()) {
$this->dataTable->applyQueuedFilters();
$this->applyQueuedFilters();

// Finally, apply datatable filters that were queued (should be 'presentation' filters that
// do not affect the number of rows)
foreach ($otherFilters as $filter) {
$this->dataTable->filter($filter[0], $filter[1]);
}
Expand Down
16 changes: 2 additions & 14 deletions plugins/TreemapVisualization/Treemap.php
Expand Up @@ -42,16 +42,7 @@ class Treemap extends Graph
*/
const SHOW_EVOLUTION_VALUES = 'show_evolution_values';

/**
* The amount of subtree levels to display initially. This property is forwarded to API
* requests along w/ 'expanded=1'. API methods can use the 'depth' parameter to make sure
* the least amount of data is queried and the least amount of memory is allocated.
*
* Default Value: 1
*/
const DEPTH = 'depth';

public static $clientSideProperties = array('filter_offset', 'max_graph_elements', 'depth', 'show_evolution_values');
public static $clientSideProperties = array('filter_offset', 'max_graph_elements', 'show_evolution_values');

/**
* Constructor.
Expand All @@ -66,8 +57,6 @@ public function __construct($view)
parent::__construct($view);

$view->datatable_js_type = 'TreemapDataTable';
$view->request_parameters_to_modify['expanded'] = 1;
$view->request_parameters_to_modify['depth'] = $view->visualization_properties->depth;
$view->show_pagination_control = false;
$view->show_offset_information = false;
$view->show_flatten_table = false;
Expand All @@ -92,7 +81,7 @@ private function handleDynamicTruncation($view, $metric)
if ($dataTable->getMetadata('period')->getRangeString() != $currentPeriod->getRangeString()) {
return;
}
echo "<pre>".print_r($dataTable, true)."</pre>";

$truncateAfter = $self->getDynamicMaxElementCount($dataTable, $metric);
if ($truncateAfter > 0) {
$dataTable->filter('Truncate', array($truncateAfter));
Expand Down Expand Up @@ -127,7 +116,6 @@ public static function getDefaultPropertyValues()
$result = parent::getDefaultPropertyValues();
$result['visualization_properties']['graph']['allow_multi_select_series_picker'] = false;
$result['visualization_properties']['infoviz-treemap']['show_evolution_values'] = true;
$result['visualization_properties']['infoviz-treemap']['depth'] = 0;
return $result;
}

Expand Down
2 changes: 0 additions & 2 deletions plugins/TreemapVisualization/TreemapVisualization.php
Expand Up @@ -82,8 +82,6 @@ public function configureReportViewForActions($view)
$view->show_tag_cloud = false;

if ($view->getViewDataTableId() == Treemap::ID) {
$view->visualization_properties->depth = 1;

// for some actions reports, use all available space
if (in_array($method, self::$fullWidthActionsReports)) {
$view->datatable_css_class = 'infoviz-treemap-full-width';
Expand Down
3 changes: 1 addition & 2 deletions plugins/TreemapVisualization/javascripts/treemapViz.js
Expand Up @@ -42,7 +42,7 @@
titleHeight: 24,
animate: true, // TODO: disable on ipad/w/o native canvas support
offset: 1,
levelsToShow: (self.props.depth || 0) + 1,
levelsToShow: 1,
constrained: true,
Events: {
enable: true,
Expand Down Expand Up @@ -437,7 +437,6 @@
truncateAfter: this.props.max_graph_elements - 1,
filter_limit: -1,
expanded: 1,
depth: this.props.depth || 1,
show_evolution_values: this.props.show_evolution_values || 0
});

Expand Down

0 comments on commit ff9b4ca

Please sign in to comment.