Impact analysis cosmetics:

- remove empty groups, since it may happen
- properly scale the borders of groups and redundancy groups
- automatically rescale the graph when showing/hiding the "Filter" tab

SVN:trunk[3715]
This commit is contained in:
Denis Flaven
2015-09-04 09:22:36 +00:00
parent 09cbf63c5a
commit 7fa99cedee
3 changed files with 44 additions and 9 deletions

View File

@@ -857,7 +857,7 @@ class DisplayBlock
$oPage->add_ready_script(
<<<EOF
$("#dh_$sId").click( function() {
$("#ds_$sId").slideToggle('normal', function() { $("#ds_$sId").parent().resize(); FixSearchFormsDisposition(); } );
$("#ds_$sId").slideToggle('normal', function() { $("#ds_$sId").parent().resize(); FixSearchFormsDisposition(); $("#dh_$sId").trigger('toggle_complete'); } );
$("#dh_$sId").toggleClass('open');
});
EOF

View File

@@ -446,7 +446,7 @@ class DisplayableRedundancyNode extends DisplayableNode
$aNode['id'] = $this->GetId();
$fDiscOpacity = ($this->GetProperty('is_reached') ? 1 : 0.2);
$sColor = ($this->GetProperty('is_reached_count') > $this->GetProperty('threshold')) ? '#c33' : '#999';
$aNode['disc_attr'] = array('stroke-width' => 3, 'stroke' => '#000', 'fill' => $sColor, 'opacity' => $fDiscOpacity);
$aNode['disc_attr'] = array('stroke-width' => 2, 'stroke' => '#000', 'fill' => $sColor, 'opacity' => $fDiscOpacity);
$fTextOpacity = ($this->GetProperty('is_reached') ? 1 : 0.4);
$aNode['text_attr'] = array('fill' => '#fff', 'opacity' => $fTextOpacity);
$aNode['tooltip'] = $this->GetTooltip($aContextDefs);
@@ -662,7 +662,7 @@ class DisplayableGroupNode extends DisplayableNode
$fDiscOpacity = ($this->GetProperty('is_reached') ? 1 : 0.2);
$fTextOpacity = ($this->GetProperty('is_reached') ? 1 : 0.4);
$aNode['icon_attr'] = array('opacity' => $fTextOpacity);
$aNode['disc_attr'] = array('stroke-width' => 3, 'stroke' => '#000', 'fill' => '#fff', 'opacity' => $fDiscOpacity);
$aNode['disc_attr'] = array('stroke-width' => 2, 'stroke' => '#000', 'fill' => '#fff', 'opacity' => $fDiscOpacity);
$aNode['text_attr'] = array('fill' => '#000', 'opacity' => $fTextOpacity);
$aNode['tooltip'] = $this->GetTooltip($aContextDefs);
return $aNode;
@@ -876,9 +876,17 @@ class DisplayableGraph extends SimpleGraph
set_time_limit($iLoopTimeLimit);
if ($oNode instanceof DisplayableGroupNode)
{
$aGroups[] = $oNode->GetObjects();
$oNode->SetProperty('group_index', $iGroupIdx);
$iGroupIdx++;
if ($oNode->GetObjectCount() == 0)
{
// Remove emtpry groups
$oNewGraph->_RemoveNode($oNode);
}
else
{
$aGroups[] = $oNode->GetObjects();
$oNode->SetProperty('group_index', $iGroupIdx);
$iGroupIdx++;
}
}
}
@@ -1279,7 +1287,7 @@ class DisplayableGraph extends SimpleGraph
<<<EOF
$( "#tabbedContent_0" ).tabs({ heightStyle: "fill" });
$("#dh_flash").click( function() {
$("#ds_flash").slideToggle('normal', function() { $("#ds_flash").parent().resize(); } );
$("#ds_flash").slideToggle('normal', function() { $("#ds_flash").parent().resize(); $("#dh_flash").trigger('toggle_complete'); } );
$("#dh_flash").toggleClass('open');
});
$('#ReloadMovieBtn').button().button('disable');

View File

@@ -84,6 +84,7 @@ $(function()
});
}
$(window).bind('resized', function() { var that = me; window.setTimeout(function() { that._on_resize(); }, 50); } );
$('#dh_flash').bind('toggle_complete', function() { var that = me; window.setTimeout(function() { that._on_resize(); }, 50); } );
this.element.bind('mousewheel', function(event, delta, deltaX, deltaY) {
return me._on_mousewheel(event, delta, deltaX, deltaY);
});
@@ -158,7 +159,20 @@ $(function()
switch(oNode.shape)
{
case 'disc':
oNode.aElements.push(this.oPaper.circle(xPos, yPos, iWidth*fTotalZoom / 2).attr(oNode.disc_attr));
oScaledAttr = {};
for(k in oNode.disc_attr)
{
value = oNode.disc_attr[k]
switch(k)
{
// Scalable attributes
case 'stroke-width':
value = value * fTotalZoom;
break;
}
oScaledAttr[k] = value;
}
oNode.aElements.push(this.oPaper.circle(xPos, yPos, iWidth*fTotalZoom / 2).attr(oScaledAttr));
var oText = this.oPaper.text(xPos, yPos, oNode.label);
oNode.text_attr['font-size'] = iFontSize * fTotalZoom;
oText.attr(oNode.text_attr);
@@ -168,7 +182,20 @@ $(function()
case 'group':
oNode.aElements.push(this.oPaper.circle(xPos, yPos, iWidth*fTotalZoom / 2).attr({fill: '#fff', 'stroke-width':0}));
oNode.aElements.push(this.oPaper.circle(xPos, yPos, iWidth*fTotalZoom / 2).attr(oNode.disc_attr));
oScaledAttr = {};
for(k in oNode.disc_attr)
{
value = oNode.disc_attr[k]
switch(k)
{
// Scalable attributes
case 'stroke-width':
value = value * fTotalZoom;
break;
}
oScaledAttr[k] = value;
}
oNode.aElements.push(this.oPaper.circle(xPos, yPos, iWidth*fTotalZoom / 2).attr(oScaledAttr));
var xIcon = xPos - 18 * fTotalZoom;
var yIcon = yPos - 18 * fTotalZoom;
oNode.aElements.push(this.oPaper.image(oNode.icon_url, xIcon, yIcon, 16*fTotalZoom, 16*fTotalZoom).attr(oNode.icon_attr));