Search in sources :

Example 1 with Rotation

use of org.baderlab.csplugins.enrichmentmap.style.charts.Rotation in project EnrichmentMapApp by BaderLab.

the class RadialHeatMapChart method getLayers.

@Override
public List<RadialHeatMapLayer> getLayers(final CyNetworkView networkView, final View<? extends CyIdentifiable> view) {
    final CyNetwork network = networkView.getModel();
    final CyIdentifiable model = view.getModel();
    final double startAngle = get(START_ANGLE, Double.class, 0.0);
    final Rotation rotation = get(ROTATION, Rotation.class, Rotation.ANTICLOCKWISE);
    final List<String> labels = getItemLabels(network, model);
    final Map<String, List<Double>> data = getData(network, model);
    final List<Color> colors = getColors(data);
    final double size = 32;
    final Rectangle2D bounds = new Rectangle2D.Double(-size / 2, -size / 2, size, size);
    final boolean showLabels = get(SHOW_ITEM_LABELS, Boolean.class, false);
    final float itemFontSize = convertFontSize(get(ITEM_LABEL_FONT_SIZE, Integer.class, 1));
    final float borderWidth = get(BORDER_WIDTH, Float.class, 0.25f);
    final Color borderColor = get(BORDER_COLOR, Color.class, Color.DARK_GRAY);
    final boolean global = get(GLOBAL_RANGE, Boolean.class, true);
    final List<Double> range = global ? getList(RANGE, Double.class) : null;
    final RadialHeatMapLayer layer = new RadialHeatMapLayer(data, labels, showLabels, itemFontSize, colors, borderWidth, borderColor, startAngle, rotation, range, bounds);
    return Collections.singletonList(layer);
}
Also used : Color(java.awt.Color) Rectangle2D(java.awt.geom.Rectangle2D) CyNetwork(org.cytoscape.model.CyNetwork) Rotation(org.baderlab.csplugins.enrichmentmap.style.charts.Rotation) ArrayList(java.util.ArrayList) List(java.util.List) CyIdentifiable(org.cytoscape.model.CyIdentifiable)

Aggregations

Color (java.awt.Color)1 Rectangle2D (java.awt.geom.Rectangle2D)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Rotation (org.baderlab.csplugins.enrichmentmap.style.charts.Rotation)1 CyIdentifiable (org.cytoscape.model.CyIdentifiable)1 CyNetwork (org.cytoscape.model.CyNetwork)1