Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
71125626
Commit
71125626
authored
May 30, 2012
by
Leo Gordon
Browse files
allow configuring boxes' colourscheme/offset from hive_config.json
parent
3821ae80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
12 deletions
+32
-12
hive_config.json
hive_config.json
+5
-1
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
+4
-2
modules/Bio/EnsEMBL/Hive/Utils/GraphViz.pm
modules/Bio/EnsEMBL/Hive/Utils/GraphViz.pm
+23
-9
No files found.
hive_config.json
View file @
71125626
...
...
@@ -24,8 +24,12 @@
"edge"
:
"Helvetica"
,
},
"DisplayDetails"
:
1
,
"DisplaySemaphoreBoxes"
:
1
,
"DisplayStretched"
:
0
,
"SemaphoreBoxes"
:
{
"Display"
:
1
,
"ColourScheme"
:
"blues9"
,
#
Examples:
"blues9"
or
"bugn7"
or
"orrd8"
or
"purples7"
or
"ylorbr9"
"ColourOffset"
:
1
,
},
}
}
modules/Bio/EnsEMBL/Hive/Utils/Graph.pm
View file @
71125626
...
...
@@ -28,7 +28,7 @@ $Author: lg4 $
=head1 VERSION
$Revision: 1.1
2
$
$Revision: 1.1
3
$
=cut
...
...
@@ -194,8 +194,10 @@ sub build {
}
}
if
(
$self
->
config
->
get
('
Graph
',
'
Display
SemaphoreBoxes
')
)
{
if
(
$self
->
config
->
get
('
Graph
',
'
SemaphoreBoxes
'
,
'
Display
'
)
)
{
$self
->
graph
->
subgraphs
(
\
%subgraph_allocation
);
$self
->
graph
->
colour_scheme
(
$self
->
config
->
get
('
Graph
',
'
SemaphoreBoxes
',
'
ColourScheme
')
);
$self
->
graph
->
colour_offset
(
$self
->
config
->
get
('
Graph
',
'
SemaphoreBoxes
',
'
ColourOffset
')
);
}
return
$self
->
graph
();
...
...
modules/Bio/EnsEMBL/Hive/Utils/GraphViz.pm
View file @
71125626
...
...
@@ -7,12 +7,6 @@ use strict;
use
warnings
;
use
base
('
GraphViz
');
#my ($colorscheme, $coloroffset) = ('ylorbr9', 1);
#my ($colorscheme, $coloroffset) = ('purples7', 1);
#my ($colorscheme, $coloroffset) = ('orrd8', 1);
#my ($colorscheme, $coloroffset) = ('bugn7', 0);
my
(
$colorscheme
,
$coloroffset
)
=
('
blues9
',
1
);
sub
subgraphs
{
my
$self
=
shift
@_
;
...
...
@@ -23,6 +17,24 @@ sub subgraphs {
}
sub
colour_scheme
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{
_colour_scheme
}
=
shift
@_
;
}
return
$self
->
{
_colour_scheme
};
}
sub
colour_offset
{
my
$self
=
shift
@_
;
if
(
@
_
)
{
$self
->
{
_colour_offset
}
=
shift
@_
;
}
return
$self
->
{
_colour_offset
};
}
sub
get_top_clusters
{
my
$self
=
shift
@_
;
...
...
@@ -55,7 +67,9 @@ sub get_nodes_that_point_at {
sub
generate_subgraph
{
my
(
$self
,
$cluster_name
,
$depth
)
=
@_
;
my
$subgraphs
=
$self
->
subgraphs
();
my
$subgraphs
=
$self
->
subgraphs
();
my
$colour_scheme
=
$self
->
colour_scheme
();
my
$colour_offset
=
$self
->
colour_offset
();
my
$prefix
=
"
\t
"
x
$depth
;
...
...
@@ -63,9 +77,9 @@ sub generate_subgraph {
$text
.=
$prefix
.
"
subgraph cluster_
${cluster_name}
{
\n
";
# $text .= $prefix . "\tlabel=\"$cluster_name\";\n";
$text
.=
$prefix
.
"
\t
colorscheme=
$colo
r
scheme
;
\n
";
$text
.=
$prefix
.
"
\t
colorscheme=
$colo
ur_
scheme
;
\n
";
$text
.=
$prefix
.
"
\t
style=filled;
\n
";
$text
.=
$prefix
.
"
\t
color=
"
.
(
$depth
+
$colo
r
offset
)
.
"
;
\n
";
$text
.=
$prefix
.
"
\t
color=
"
.
(
$depth
+
$colo
ur_
offset
)
.
"
;
\n
";
foreach
my
$node_name
(
@
{
$self
->
get_nodes_that_point_at
(
$cluster_name
)
}
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment