Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix(graphs): Githut and Home Page fixes
Browse files Browse the repository at this point in the history
* Remove resize listener on scope destroy.
* Fix g JS errors in githut chart caused by biospecimen
* Perform normalize (case and space insensitive) comparisions on data
  category.
* Fix IDs for data categories to match the updated model.
* Fix unit on home page static infrastructure table.

Closes #117
Michael Moncada committed Mar 28, 2016
1 parent ec065eb commit ceefcdb
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 7 additions & 1 deletion app/scripts/components/charts/chart.directives.ts
Original file line number Diff line number Diff line change
@@ -676,13 +676,19 @@ module ngApp.components.charts {

function _initListeners() {

var hoverEventName = "resize." + _postFixID;

// Add listener to respond to window resize events (i.e. redraw visualization)
jQuery(window).on("resize." + _postFixID, _.debounce(() => {
jQuery(window).on(hoverEventName, _.debounce(() => {
_initChartSize();
_renderBars();
}, 200));


$scope.$on("$destroy", function () {
jQuery(window).unbind(hoverEventName);
});

$scope.$watch(function() {
return $scope.data;
},
2 changes: 1 addition & 1 deletion app/scripts/home/templates/home.html
Original file line number Diff line number Diff line change
@@ -117,7 +117,7 @@ <h3 class="panel-title table-heading">Infrastructure</h3>
<tr>
<th>Compute Infrastructure</th>
<td>13,120 Cores</td>
<td>81,920 TB RAM</td>
<td>81,920 GB RAM</td>
</tr>
<tr>
<th>Internet Facing Bandwidth</th>
16 changes: 12 additions & 4 deletions app/scripts/projects/projects.githut.config.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,14 @@ angular.module('projects.githut.config',[])
var primary_sites = [];

function findTheThing(array,data_type,propname){
return _.find(array,function(type){return type[propname] === data_type});

var normalize = (str) => {
return str.toLowerCase().replace(/\s+/g,'');
};

var normalizedDataType = normalize(data_type);

return _.find(array,function(type){return normalize(type[propname]) === normalizedDataType});
}

// Gracefully handle bad data if present
@@ -119,7 +126,7 @@ angular.module('projects.githut.config',[])
href: projectSref
},
{
id:'Sequencing Data',
id:'Raw Sequencing Data',
display_name:['Seq'],
scale:'ordinal',
is_subtype:true,
@@ -128,7 +135,7 @@ angular.module('projects.githut.config',[])
href: dataTypeSref
},
{
id:'Transcriptome Profiling',
id:'Protein Expression',
display_name:['Exp'],
scale:'ordinal',
is_subtype:true,
@@ -181,8 +188,9 @@ angular.module('projects.githut.config',[])
colorgroup:'case_count',
href: dataTypeSref
},
// Biospecimen
{
id:'Biospecimen',
id:'Other',
display_name:['Bio.'],
scale:'ordinal',
is_subtype:true,

0 comments on commit ceefcdb

Please sign in to comment.