public static PrimarySpiderDiagram getVennABCDiagramWithPartlyShadedBAndSpiderInZoneBC_A() { PrimarySpiderDiagram modelDiagram = getVennABCDiagramWithPartlyShadedB(); HashMap<String, Region> habitats = new HashMap<>(); habitats.put("s", new Region(Zone.fromInContours("B", "C").withOutContours("A"))); return SpiderDiagrams.createPrimarySD( asList("s"), habitats, modelDiagram.getShadedZones(), modelDiagram.getPresentZones()); }
@Override @SuppressWarnings("unchecked") public Map<String, Region> fromASTNode(CommonTree treeNode) throws ReadingException { ArrayList<ArrayList<Object>> rawHabitats = regionListTranslator.fromASTNode(treeNode); if (rawHabitats == null || rawHabitats.size() < 1) { return null; } HashMap<String, Region> habitats = new HashMap<>(); for (ArrayList<Object> rawHabitat : rawHabitats) { if (rawHabitat.size() == 2) { habitats.put((String) rawHabitat.get(0), new Region((ArrayList<Zone>) rawHabitat.get(1))); } } return habitats; }