SOLR-3459: Fix Cloud's Graph-Views for multiple collections

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1340933 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stefan Matheis 2012-05-21 08:37:34 +00:00
parent a29a6c6f29
commit aee60cb3ab
2 changed files with 25 additions and 13 deletions

View File

@ -236,17 +236,17 @@
stroke-width: 1.5px; stroke-width: 1.5px;
} }
#content #graph-content .node.lvl-2 text #content #graph-content .node.lvl-3 text
{ {
cursor: pointer; cursor: pointer;
} }
#content #graph-content .node.lvl-2:hover circle #content #graph-content .node.lvl-3:hover circle
{ {
stroke: #000 !important; stroke: #000 !important;
} }
#content #graph-content .node.lvl-2:hover text #content #graph-content .node.lvl-3:hover text
{ {
fill: #000 !important; fill: #000 !important;
} }
@ -314,8 +314,18 @@
fill: #000; fill: #000;
} }
#content #graph-content .link.lvl-1, #content #graph-content .link.lvl-2,
#content #graph-content .link.leader #content #graph-content .link.leader
{ {
stroke: #c0c0c0; stroke: #c0c0c0;
}
#content #graph-content .node.lvl-0 circle
{
stroke: #fff;
}
#content #graph-content .link.lvl-1
{
stroke: #fff;
} }

View File

@ -156,12 +156,12 @@ var helper_path_class = function( p )
var classes = [ 'link' ]; var classes = [ 'link' ];
classes.push( 'lvl-' + p.target.depth ); classes.push( 'lvl-' + p.target.depth );
if( p.target.data.leader ) if( p.target.data && p.target.data.leader )
{ {
classes.push( 'leader' ); classes.push( 'leader' );
} }
if( p.target.data.state ) if( p.target.data && p.target.data.state )
{ {
classes.push( p.target.data.state ); classes.push( p.target.data.state );
} }
@ -174,12 +174,12 @@ var helper_node_class = function( d )
var classes = [ 'node' ]; var classes = [ 'node' ];
classes.push( 'lvl-' + d.depth ); classes.push( 'lvl-' + d.depth );
if( d.data.leader ) if( d.data && d.data.leader )
{ {
classes.push( 'leader' ); classes.push( 'leader' );
} }
if( d.data.state ) if( d.data && d.data.state )
{ {
classes.push( d.data.state ); classes.push( d.data.state );
} }
@ -197,7 +197,7 @@ var helper_data = {
var helper_node_text = function( d ) var helper_node_text = function( d )
{ {
if( !d.data.uri ) if( !d.data || !d.data.uri )
{ {
return d.name; return d.name;
} }
@ -361,7 +361,11 @@ var prepare_graph = function( graph_element, callback )
eval( 'state = ' + response.znode.data + ';' ); eval( 'state = ' + response.znode.data + ';' );
var leaf_count = 0; var leaf_count = 0;
var collections = []; var graph_data = {
name: null,
children : []
};
for( var c in state ) for( var c in state )
{ {
var shards = []; var shards = [];
@ -424,10 +428,8 @@ var prepare_graph = function( graph_element, callback )
}, },
children: shards children: shards
}; };
collections.push( collection ); graph_data.children.push( collection );
} }
var graph_data = collections.shift();
helper_data.protocol = $.unique( helper_data.protocol ); helper_data.protocol = $.unique( helper_data.protocol );
helper_data.host = $.unique( helper_data.host ); helper_data.host = $.unique( helper_data.host );