Search in sources :

Example 31 with VisualizationTask

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

the class DendrogramVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    // Ensure there is a clustering result:
    VisualizationTree.findNewResults(context, start).filter(PointerHierarchyRepresentationResult.class).forEach(pi -> {
        final VisualizationTask task = // 
        new VisualizationTask(this, NAME, pi, null).level(// 
        VisualizationTask.LEVEL_STATIC).with(UpdateFlag.ON_STYLEPOLICY);
        context.addVis(context.getStylingPolicy(), task);
        context.addVis(pi, new SwitchStyleAction(task, context));
    });
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) PointerHierarchyRepresentationResult(de.lmu.ifi.dbs.elki.algorithm.clustering.hierarchical.PointerHierarchyRepresentationResult)

Example 32 with VisualizationTask

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

the class PolygonVisualization method processNewResult.

@SuppressWarnings("unchecked")
@Override
public void processNewResult(VisualizerContext context, Object result) {
    VisualizationTree.findNewResultVis(context, result, Relation.class, ScatterPlotProjector.class, (rel, p) -> {
        if (!TypeUtil.POLYGON_TYPE.isAssignableFromType(rel.getDataTypeInformation())) {
            return;
        }
        if (RelationUtil.dimensionality((Relation<? extends PolygonsObject>) rel) != 2) {
            return;
        }
        // Assume that a 2d projector is using the same coordinates as the
        // polygons.
        final VisualizationTask task = // 
        new VisualizationTask(this, NAME, rel, rel).level(// 
        VisualizationTask.LEVEL_DATA - 10).with(UpdateFlag.ON_DATA);
        context.addVis(rel, task);
        context.addVis(p, task);
    });
}
Also used : Relation(de.lmu.ifi.dbs.elki.database.relation.Relation) VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask) PolygonsObject(de.lmu.ifi.dbs.elki.data.spatial.PolygonsObject)

Example 33 with VisualizationTask

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

the class TooltipStringVisualization method addTooltips.

private void addTooltips(final String name, final Relation<?> rel, VisualizerContext context, Relation<?> rep, ScatterPlotProjector<?> p) {
    final VisualizationTask task = // 
    new VisualizationTask(this, name, rep, rel).tool(true).visibility(// 
    false).with(UpdateFlag.ON_DATA).with(UpdateFlag.ON_SAMPLE);
    context.addVis(rep, task);
    context.addVis(p, task);
}
Also used : VisualizationTask(de.lmu.ifi.dbs.elki.visualization.VisualizationTask)

Example 34 with VisualizationTask

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

the class MoveObjectsToolVisualization method processNewResult.

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

Example 35 with VisualizationTask

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

the class SelectionConvexHullVisualization method processNewResult.

@Override
public void processNewResult(VisualizerContext context, Object start) {
    VisualizationTree.findVis(context, start).filter(ScatterPlotProjector.class).forEach(p -> {
        final 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_DATA - 2).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)

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