ArrayList<Clustering<?>> clusterings = ResultUtil.filterResults(result, Clustering.class);
for(Clustering<?> c : clusterings) {
Iterator<HistogramProjector<?>> ps = ResultUtil.filteredResults(baseResult, HistogramProjector.class);
for(HistogramProjector<?> p : IterableUtil.fromIterator(ps)) {
// register self
final VisualizationTask task = new VisualizationTask(CNAME, c, p.getRelation(), this);
task.put(VisualizationTask.META_LEVEL, VisualizationTask.LEVEL_DATA);
baseResult.getHierarchy().add(c, task);
baseResult.getHierarchy().add(p, task);
}
}
// General data distribution
{
Iterator<HistogramProjector<?>> ps = ResultUtil.filteredResults(result, HistogramProjector.class);
for(HistogramProjector<?> p : IterableUtil.fromIterator(ps)) {
// register self
final VisualizationTask task = new VisualizationTask(NAME, null, p.getRelation(), this);
task.put(VisualizationTask.META_LEVEL, VisualizationTask.LEVEL_DATA);
if(clusterings.size() > 0) {
task.put(VisualizationTask.META_VISIBLE_DEFAULT, false);
}
// baseResult.getHierarchy().add(p.getRelation(), task);
baseResult.getHierarchy().add(p, task);
}
}