Search in sources :

Example 16 with VisualizationTask

use of de.lmu.ifi.dbs.elki.visualization.VisualizationTask in project elki by elki-project.

the class SelectionToolDotVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    VisualizationTree.findVis(context, start).filter(ScatterPlotProjector.class).forEach(p -> {
        Relation<?> rel = p.getRelation();
        if (!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) {
            return;
        }
        final VisualizationTask task = // 
        new VisualizationTask(this, NAME, context.getSelectionResult(), rel).level(VisualizationTask.LEVEL_INTERACTIVE).tool(true).visibility(// 
        false).with(RenderFlag.NO_THUMBNAIL).with(// 
        RenderFlag.NO_EXPORT).with(UpdateFlag.ON_DATA).with(UpdateFlag.ON_SELECTION);
        context.addVis(context.getSelectionResult(), task);
        context.addVis(p, task);
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) ScatterPlotProjector(de.lmu.ifi.dbs.elki.visualization.projector.ScatterPlotProjector)

Example 17 with VisualizationTask

use of de.lmu.ifi.dbs.elki.visualization.VisualizationTask in project elki by elki-project.

the class EvaluationVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    VisualizationTree.findNewResults(context, start).filter(EvaluationResult.class).forEach(sr -> {
        // Avoid duplicates:
        for (It<VisualizationTask> it2 = VisualizationTree.findVis(context, sr).filter(VisualizationTask.class); it2.valid(); it2.advance()) {
            if (it2.get().getFactory() instanceof EvaluationVisualization) {
                return;
            }
        }
        // Hack: for clusterings, only show the currently visible clustering.
        if (sr.visualizeSingleton()) {
            Class<? extends EvaluationResult> c = sr.getClass();
            // Ensure singleton.
            for (It<VisualizationTask> it3 = context.getVisHierarchy().iterChildren(context.getBaseResult()).filter(VisualizationTask.class); it3.valid(); it3.advance()) {
                final VisualizationTask otask = it3.get();
                if (otask.getFactory() instanceof EvaluationVisualization && otask.getResult() == c) {
                    return;
                }
            }
            context.addVis(context.getBaseResult(), // 
            new VisualizationTask(this, NAME, c, null).requestSize(.5, // 
            sr.numLines() * .05).level(// 
            VisualizationTask.LEVEL_STATIC).with(UpdateFlag.ON_STYLEPOLICY));
            return;
        }
        context.addVis(sr, // 
        new VisualizationTask(this, NAME, sr, null).requestSize(.5, sr.numLines() * .05).level(VisualizationTask.LEVEL_STATIC));
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) EvaluationResult(de.lmu.ifi.dbs.elki.result.EvaluationResult)

Example 18 with VisualizationTask

use of de.lmu.ifi.dbs.elki.visualization.VisualizationTask in project elki by elki-project.

the class PixmapVisualizer method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    VisualizationTree.findNewResults(context, start).filter(PixmapResult.class).forEach(pr -> {
        // Add plots, attach visualizer
        final VisualizationTask task = // 
        new VisualizationTask(this, NAME, pr, null).requestSize(pr.getImage().getWidth() / (double) pr.getImage().getHeight(), // 
        1.0).level(VisualizationTask.LEVEL_STATIC);
        context.addVis(pr, task);
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) PixmapResult(de.lmu.ifi.dbs.elki.result.PixmapResult)

Example 19 with VisualizationTask

use of de.lmu.ifi.dbs.elki.visualization.VisualizationTask in project elki by elki-project.

the class ClusterOutlineVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    // We use the style library, not individual clusterings!
    VisualizationTree.findVis(context, start).filter(ParallelPlotProjector.class).forEach(p -> {
        Relation<?> rel = p.getRelation();
        if (!TypeUtil.NUMBER_VECTOR_FIELD.isAssignableFromType(rel.getDataTypeInformation())) {
            return;
        }
        context.addVis(p, // 
        new VisualizationTask(this, NAME, p, rel).level(VisualizationTask.LEVEL_DATA - 1).visibility(// 
        false).with(UpdateFlag.ON_DATA).with(UpdateFlag.ON_STYLEPOLICY));
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) ParallelPlotProjector(de.lmu.ifi.dbs.elki.visualization.projector.ParallelPlotProjector)

Example 20 with VisualizationTask

use of de.lmu.ifi.dbs.elki.visualization.VisualizationTask in project elki by elki-project.

the class RTreeParallelVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    VisualizationTree.findNewSiblings(context, start, AbstractRStarTree.class, ParallelPlotProjector.class, (tree, p) -> {
        final VisualizationTask task = // 
        new VisualizationTask(this, NAME, tree, p.getRelation()).level(VisualizationTask.LEVEL_BACKGROUND + 2).visibility(false);
        context.addVis(tree, task);
        context.addVis(p, task);
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask)

Aggregations

VisualizationTask (de.lmu.ifi.dbs.elki.visualization.VisualizationTask)44 ScatterPlotProjector (de.lmu.ifi.dbs.elki.visualization.projector.ScatterPlotProjector)10 ParallelPlotProjector (de.lmu.ifi.dbs.elki.visualization.projector.ParallelPlotProjector)7 Visualization (de.lmu.ifi.dbs.elki.visualization.visualizers.Visualization)7 PlotItem (de.lmu.ifi.dbs.elki.visualization.gui.overview.PlotItem)6 ArrayList (java.util.ArrayList)6 Element (org.w3c.dom.Element)4 ScalesResult (de.lmu.ifi.dbs.elki.result.ScalesResult)3 Relation (de.lmu.ifi.dbs.elki.database.relation.Relation)2 AbortException (de.lmu.ifi.dbs.elki.utilities.exceptions.AbortException)2 Projector (de.lmu.ifi.dbs.elki.visualization.projector.Projector)2 LabelVisualization (de.lmu.ifi.dbs.elki.visualization.visualizers.visunproj.LabelVisualization)2 PointerHierarchyRepresentationResult (de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.PointerHierarchyRepresentationResult)1 ClusterOrder (de.lmu.ifi.dbs.elki.algorithm.clustering.optics.ClusterOrder)1 OPTICSXi (de.lmu.ifi.dbs.elki.algorithm.clustering.optics.OPTICSXi)1 PolygonsObject (de.lmu.ifi.dbs.elki.data.spatial.PolygonsObject)1 Database (de.lmu.ifi.dbs.elki.database.Database)1 UpdatableDatabase (de.lmu.ifi.dbs.elki.database.UpdatableDatabase)1 AffineTransformation (de.lmu.ifi.dbs.elki.math.linearalgebra.AffineTransformation)1 EvaluationResult (de.lmu.ifi.dbs.elki.result.EvaluationResult)1