예제 #1
0
 private void writeCoordEnter() {
   // Added rounded styling if needed
   ModelUtil.Size size = ModelUtil.getRoundRectangleRadius(vis);
   if (size != null)
     out.addChained(
             "attr('rx'," + size.valueInPixels(8) + ").attr('ry', " + size.valueInPixels(8) + ")")
         .ln();
   out.endStatement().onNewLine().ln();
 }
예제 #2
0
 private String getSymbol() {
   String result = ModelUtil.getElementSymbol(vis);
   if (result != null) return result;
   // We default to a rectangle if all the scales are categorical or binned, otherwise we return a
   // point
   boolean cat =
       allShowExtent(positionFields.allXFields) && allShowExtent(positionFields.allYFields);
   return cat ? "rect" : "point";
 }
예제 #3
0
  private ElementDefinition buildElementDefinition() {
    ElementDefinition e = new ElementDefinition();
    Field[] x = positionFields.getX(vis);
    Field[] y = positionFields.getY(vis);
    setLocations(e.x, "x", x, positionFields.xCategorical);
    setLocations(e.y, "y", y, positionFields.yCategorical);
    e.x.size =
        getSize(
            getSizeCall(0),
            ModelUtil.getElementSize(vis, "width"),
            x,
            "geom.inner_width",
            "scale_x");
    e.y.size =
        getSize(
            getSizeCall(1),
            ModelUtil.getElementSize(vis, "height"),
            y,
            "geom.inner_height",
            "scale_y");

    e.overallSize = getOverallSize(ModelUtil.getElementSize(vis, "size"), e);
    return e;
  }