Skip to content

Commit 54adec7

Browse files
committed
Set dataset color for compound edges #232
1 parent e88e61e commit 54adec7

File tree

1 file changed

+7
-18
lines changed
  • EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/style

1 file changed

+7
-18
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/style/EMStyleBuilder.java

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
11
package org.baderlab.csplugins.enrichmentmap.style;
22

3-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_LABEL_TRANSPARENCY;
4-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_LINE_TYPE;
5-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_STROKE_UNSELECTED_PAINT;
6-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_TRANSPARENCY;
7-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_UNSELECTED_PAINT;
8-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.EDGE_WIDTH;
9-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NETWORK_BACKGROUND_PAINT;
10-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_BORDER_PAINT;
11-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_BORDER_TRANSPARENCY;
12-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_BORDER_WIDTH;
13-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_FILL_COLOR;
14-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_LABEL;
15-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_LABEL_TRANSPARENCY;
16-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_SHAPE;
17-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_SIZE;
18-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_TOOLTIP;
19-
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.NODE_TRANSPARENCY;
3+
import static org.cytoscape.view.presentation.property.BasicVisualLexicon.*;
204
import static org.cytoscape.view.presentation.property.NodeShapeVisualProperty.DIAMOND;
215
import static org.cytoscape.view.presentation.property.NodeShapeVisualProperty.ELLIPSE;
226
import static org.cytoscape.view.presentation.property.NodeShapeVisualProperty.RECTANGLE;
@@ -282,8 +266,9 @@ private DiscreteMapping<String, Paint> createEdgeColorMapping(EMStyleOptions opt
282266
eventHelper.silenceEventSource(dm);
283267

284268
try {
269+
List<EMDataSet> dataSets = options.getEnrichmentMap().getDataSetList();
270+
285271
if (dataSetCount > 1 && distinctEdges) {
286-
List<EMDataSet> dataSets = options.getEnrichmentMap().getDataSetList();
287272
final ColorBrewer colorBrewer;
288273

289274
// Try colorblind and/or print friendly colours first
@@ -309,6 +294,10 @@ else if (dataSets.size() <= 5) // Same--more than 5, it adds a RED that can be c
309294

310295
dm.putMapValue(Columns.EDGE_INTERACTION_VALUE_OVERLAP, overlapColor);
311296
dm.putMapValue(Columns.EDGE_INTERACTION_VALUE_SIG, Colors.SIG_EDGE_COLOR);
297+
298+
for (EMDataSet ds : dataSets) {
299+
ds.setColor(overlapColor);
300+
}
312301
}
313302
} finally {
314303
eventHelper.unsilenceEventSource(dm);

0 commit comments

Comments
 (0)