Package de.lmu.ifi.dbs.elki.visualization.svg

Examples of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot


    }
  }

  @Override
  public Visualization makeVisualization(VisualizationTask task) {
    SVGPlot svgp = task.getPlot();
    Element layer = svgp.svgElement(SVGConstants.SVG_G_TAG);
    EvaluatePairCountingFMeasure.ScoreResult sr = task.getResult();
   
    // TODO: use CSSClass and StyleLibrary
    int i = 0;
    {
      Element object = svgp.svgText(0, i + 0.7, "Same-cluster object pairs");
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6; font-weight: bold");
      layer.appendChild(object);
      i++;
    }   
    {
      Element object = svgp.svgText(0, i + 0.7, "F1-Measure, Precision and Recall:");
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6; font-weight: bold");
      layer.appendChild(object);
      i++;
    }   
    for(Vector vec : sr) {
      StringBuffer buf = new StringBuffer();
      double fmeasure = vec.get(0);
      double inboth = vec.get(1);
      double infirst = vec.get(2);
      double insecond = vec.get(3);
      buf.append(FormatUtil.format(fmeasure, FormatUtil.NF6));
      buf.append(" / ");
      buf.append(FormatUtil.format(inboth / (inboth + infirst), FormatUtil.NF6));
      buf.append(" / ");
      buf.append(FormatUtil.format(inboth / (inboth + insecond), FormatUtil.NF6));
      Element object = svgp.svgText(0, i + 0.7, buf.toString());
      object.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, "font-size: 0.6");
      layer.appendChild(object);
      i++;
    }
View Full Code Here


  /**
   * Save/export the current plot.
   */
  public void saveCurrentPlot() {
    // TODO: exclude "do not export" layers!
    final SVGPlot currentPlot = svgCanvas.getPlot();
    if(currentPlot != null) {
      SVGSaveDialog.showSaveDialog(currentPlot, 512, 512);
    }
    else {
      logger.warning("saveCurrentPlot() called without a visible plot!");
View Full Code Here

  /**
   * Save/export the current plot.
   */
  public void saveCurrentPlot() {
    // TODO: exclude "do not export" layers!
    final SVGPlot currentPlot = svgCanvas.getPlot();
    if(currentPlot != null) {
      SVGSaveDialog.showSaveDialog(currentPlot, 512, 512);
    }
    else {
      LoggingUtil.warning("saveCurrentPlot() called without a visible plot!");
View Full Code Here

   *
   * @param factory
   * @param task
   */
  private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer.Factory factory, VisualizationTask task) {
    SVGPlot plot = new SVGPlot();
    Visualization vis = factory.makeVisualization(task.clone(plot, context, null, 1.0, 1.0));
    plot.getRoot().appendChild(vis.getLayer());
    plot.getRoot().setAttribute(SVGConstants.SVG_WIDTH_ATTRIBUTE, "20cm");
    plot.getRoot().setAttribute(SVGConstants.SVG_HEIGHT_ATTRIBUTE, "20cm");
    plot.getRoot().setAttribute(SVGConstants.SVG_VIEW_BOX_ATTRIBUTE, "0 0 1 1");
    plot.updateStyleElement();

    (new SimpleSVGViewer()).setPlot(plot);
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.visualization.svg.SVGPlot

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.