Package de.lmu.ifi.dbs.elki.visualization.style.marker

Examples of de.lmu.ifi.dbs.elki.visualization.style.marker.MarkerLibrary


    // FIXME: Use CSS and style library.

    Element layer = svgp.svgElement(SVGConstants.SVG_G_TAG);

    MarkerLibrary ml = context.getStyleLibrary().markers();

    int i = 0;
    for(Cluster<Model> c : allcs) {
      ml.useMarker(svgp, layer, 0.3, i + 0.5, i, 0.3);
      Element label = svgp.svgText(0.7, i + 0.7, c.getNameAutomatic());
      label.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6");
      layer.appendChild(label);
      i++;
    }
View Full Code Here


    context.removeResultListener(this);
  }

  @Override
  public void redraw() {
    final MarkerLibrary ml = context.getStyleLibrary().markers();
    final double marker_size = context.getStyleLibrary().getSize(StyleLibrary.MARKERPLOT);
    final StylingPolicy spol = style.getStylingPolicy();

    if(spol instanceof ClassStylingPolicy) {
      ClassStylingPolicy cspol = (ClassStylingPolicy) spol;
      for(int cnum = cspol.getMinStyle(); cnum < cspol.getMaxStyle(); cnum++) {
        for(Iterator<DBID> iter = cspol.iterateClass(cnum); iter.hasNext();) {
          DBID cur = iter.next();
          try {
            final NumberVector<?, ?> vec = rel.get(cur);
            double[] v = proj.fastProjectDataToRenderSpace(vec);
            ml.useMarker(svgp, layer, v[0], v[1], cnum, marker_size);
          }
          catch(ObjectNotFoundException e) {
            // ignore.
          }
        }
View Full Code Here

  @Override
  protected void redraw() {
    addCSSClasses(svgp);

    MarkerLibrary ml = context.getStyleLibrary().markers();
    double marker_size = context.getStyleLibrary().getSize(StyleLibrary.MARKERPLOT);

    Iterator<Cluster<MeanModel<NV>>> ci = clustering.getAllClusters().iterator();
    for(int cnum = 0; cnum < clustering.getAllClusters().size(); cnum++) {
      Cluster<MeanModel<NV>> clus = ci.next();
      double[] mean = proj.fastProjectDataToRenderSpace(clus.getModel().getMean());

      // add a greater Marker for the mean
      Element meanMarker = ml.useMarker(svgp, layer, mean[0], mean[1], cnum, marker_size * 3);
      SVGUtil.setAtt(meanMarker, SVGConstants.SVG_CLASS_ATTRIBUTE, CSS_MEAN);

      // Add a fine cross to mark the exact location of the mean.
      Element meanMarkerCenter = svgp.svgLine(mean[0] - .7, mean[1], mean[0] + .7, mean[1]);
      SVGUtil.setAtt(meanMarkerCenter, SVGConstants.SVG_CLASS_ATTRIBUTE, CSS_MEAN_CENTER);
View Full Code Here

    context.removeDataStoreListener(this);
  }

  @Override
  public void redraw() {
    MarkerLibrary ml = context.getStyleLibrary().markers();
    double marker_size = context.getStyleLibrary().getSize(StyleLibrary.MARKERPLOT);
    // draw data
    Iterator<Cluster<Model>> ci = clustering.getAllClusters().iterator();
    for(int cnum = 0; cnum < clustering.getAllClusters().size(); cnum++) {
      Cluster<?> clus = ci.next();
      for(DBID objId : clus.getIDs()) {
        try {
          final NV vec = rel.get(objId);
          double[] v = proj.fastProjectDataToRenderSpace(vec);
          ml.useMarker(svgp, layer, v[0], v[1], cnum, marker_size);
        }
        catch(ObjectNotFoundException e) {
          // ignore.
        }
      }
View Full Code Here

  @Override
  protected void redraw() {
    SVGPlot svgp = task.getPlot();
    final List<Cluster<Model>> allcs = clustering.getAllClusters();

    MarkerLibrary ml = context.getStyleLibrary().markers();
    layer = svgp.svgElement(SVGConstants.SVG_G_TAG);

    // Add a label for the clustering.
    {
      Element label = svgp.svgText(0.1, 0.7, clustering.getLongName());
      label.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.4");
      layer.appendChild(label);
    }

    // TODO: multi-column layout!
    int i = 0;
    for(Cluster<Model> c : allcs) {
      ml.useMarker(svgp, layer, 0.3, i + 1.5, i, 0.3);
      Element label = svgp.svgText(0.7, i + 1.7, c.getNameAutomatic());
      label.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6");
      layer.appendChild(label);
      i++;
    }
View Full Code Here

  @Override
  protected void redraw() {
    addCSSClasses(svgp);

    MarkerLibrary ml = context.getStyleLibrary().markers();
    double marker_size = context.getStyleLibrary().getSize(StyleLibrary.MARKERPLOT);

    Iterator<Cluster<MeanModel<? extends NumberVector<?, ?>>>> ci = clustering.getAllClusters().iterator();
    for(int cnum = 0; ci.hasNext(); cnum++) {
      Cluster<MeanModel<? extends NumberVector<?, ?>>> clus = ci.next();
      double[] mean = proj.fastProjectDataToRenderSpace(clus.getModel().getMean());

      // add a greater Marker for the mean
      Element meanMarker = ml.useMarker(svgp, layer, mean[0], mean[1], cnum, marker_size * 3);
      SVGUtil.setAtt(meanMarker, SVGConstants.SVG_CLASS_ATTRIBUTE, CSS_MEAN);

      // Add a fine cross to mark the exact location of the mean.
      Element meanMarkerCenter = svgp.svgLine(mean[0] - .7, mean[1], mean[0] + .7, mean[1]);
      SVGUtil.setAtt(meanMarkerCenter, SVGConstants.SVG_CLASS_ATTRIBUTE, CSS_MEAN_CENTER);
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.visualization.style.marker.MarkerLibrary

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.