2012-10-22 01:10:43 +00:00
|
|
|
// create filters for maps, and for card views
|
|
|
|
|
|
|
|
// keep an array of which item categories are currently visible.
|
|
|
|
var categoryVisible = new Object();
|
|
|
|
|
|
|
|
categoryVisible['Group'] = true;
|
|
|
|
categoryVisible['Person'] = true;
|
|
|
|
categoryVisible['Bizarre'] = true;
|
|
|
|
categoryVisible['Catalyst'] = true;
|
|
|
|
categoryVisible['Closed'] = true;
|
|
|
|
categoryVisible['Experience'] = true;
|
|
|
|
categoryVisible['Future Dev'] = true;
|
|
|
|
categoryVisible['Idea'] = true;
|
|
|
|
categoryVisible['Implication'] = true;
|
|
|
|
categoryVisible['Insight'] = true;
|
|
|
|
categoryVisible['Intention'] = true;
|
|
|
|
categoryVisible['Knowledge'] = true;
|
|
|
|
categoryVisible['Location'] = true;
|
|
|
|
categoryVisible['Open Issue'] = true;
|
|
|
|
categoryVisible['Opinion'] = true;
|
|
|
|
categoryVisible['Opportunity'] = true;
|
|
|
|
categoryVisible['Platform'] = true;
|
|
|
|
categoryVisible['Problem'] = true;
|
|
|
|
categoryVisible['Question'] = true;
|
|
|
|
categoryVisible['Reference'] = true;
|
|
|
|
categoryVisible['Requirement'] = true;
|
|
|
|
categoryVisible['Resource'] = true;
|
|
|
|
categoryVisible['Role'] = true;
|
|
|
|
categoryVisible['Task'] = true;
|
|
|
|
categoryVisible['Tool'] = true;
|
|
|
|
categoryVisible['Trajectory'] = true;
|
|
|
|
categoryVisible['Action'] = true;
|
|
|
|
categoryVisible['Activity'] = true;
|
|
|
|
|
2012-12-14 18:31:39 +00:00
|
|
|
function switchVisible(category, duration) {
|
2012-10-22 01:10:43 +00:00
|
|
|
if (categoryVisible[category] == true) {
|
2012-12-14 18:31:39 +00:00
|
|
|
hideCategory(category, duration);
|
2012-10-22 01:10:43 +00:00
|
|
|
}
|
|
|
|
else if (categoryVisible[category] == false) {
|
2012-12-14 18:31:39 +00:00
|
|
|
showCategory(category, duration);
|
2012-10-22 01:10:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-14 18:31:39 +00:00
|
|
|
function hideCategory(category, duration) {
|
2012-10-22 01:10:43 +00:00
|
|
|
if (duration == null) duration = 500;
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.graph.eachNode( function (n) {
|
2012-10-22 01:10:43 +00:00
|
|
|
if (n.getData('itemcatname') == category) {
|
|
|
|
n.setData('alpha', 0, 'end');
|
|
|
|
n.eachAdjacency(function(adj) {
|
|
|
|
adj.setData('alpha', 0, 'end');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.fx.animate({
|
2012-10-22 01:10:43 +00:00
|
|
|
modes: ['node-property:alpha',
|
|
|
|
'edge-property:alpha'],
|
|
|
|
duration: duration
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2012-12-14 18:31:39 +00:00
|
|
|
function showCategory(category, duration) {
|
2012-10-22 01:10:43 +00:00
|
|
|
if (duration == null) duration = 500;
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.graph.eachNode( function (n) {
|
2012-10-22 01:10:43 +00:00
|
|
|
if (n.getData('itemcatname') == category) {
|
|
|
|
n.setData('alpha', 1, 'end');
|
|
|
|
n.eachAdjacency(function(adj) {
|
|
|
|
adj.setData('alpha', 1, 'end');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.fx.animate({
|
2012-10-22 01:10:43 +00:00
|
|
|
modes: ['node-property:alpha',
|
|
|
|
'edge-property:alpha'],
|
|
|
|
duration: duration
|
|
|
|
});
|
|
|
|
}
|
2012-11-23 19:00:00 +00:00
|
|
|
|
2012-12-14 18:31:39 +00:00
|
|
|
function hideAll(duration) {
|
2012-11-23 19:00:00 +00:00
|
|
|
if (duration == null) duration = 500;
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.graph.eachNode( function (n) {
|
2012-11-23 19:00:00 +00:00
|
|
|
n.setData('alpha', 0, 'end');
|
|
|
|
n.eachAdjacency(function(adj) {
|
|
|
|
adj.setData('alpha', 0, 'end');
|
|
|
|
});
|
|
|
|
});
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.fx.animate({
|
2012-11-23 19:00:00 +00:00
|
|
|
modes: ['node-property:alpha',
|
|
|
|
'edge-property:alpha'],
|
|
|
|
duration: duration
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2012-12-14 18:31:39 +00:00
|
|
|
function showAll(duration) {
|
2012-11-23 19:00:00 +00:00
|
|
|
if (duration == null) duration = 500;
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.graph.eachNode( function (n) {
|
2012-11-23 19:00:00 +00:00
|
|
|
n.setData('alpha', 1, 'end');
|
|
|
|
n.eachAdjacency(function(adj) {
|
|
|
|
adj.setData('alpha', 1, 'end');
|
|
|
|
});
|
|
|
|
});
|
2012-12-15 07:39:14 +00:00
|
|
|
Mconsole.fx.animate({
|
2012-11-23 19:00:00 +00:00
|
|
|
modes: ['node-property:alpha',
|
|
|
|
'edge-property:alpha'],
|
|
|
|
duration: duration
|
|
|
|
});
|
|
|
|
}
|