class ContourTrace extends AbstractTrace {

  private final Object[] x;
  private final Object[] y;
  private final double[][] z;
  private final String type;

  public ContourTrace(ContourBuilder builder) {
    super(builder);
    this.x = builder.x;
    this.y = builder.y;
    this.z = builder.z;
    this.type = builder.getType();
  }

  @Override
  public String asJavascript(int i) {
    Writer writer = new StringWriter();
    PebbleTemplate compiledTemplate;

    try {
      compiledTemplate = engine.getTemplate("trace_template.html");
      compiledTemplate.evaluate(writer, getContext());
    } catch (PebbleException e) {
      throw new IllegalStateException(e);
    } catch (IOException e) {
      throw new UncheckedIOException(e);
    }
    return writer.toString();
  }

  @Override
  protected Map<String, Object> getContext() {<FILL_FUNCTION_BODY>}

  public static ContourTrace.ContourBuilder builder(Object[] x, Object[] y, double[][] z) {
    return new ContourTrace.ContourBuilder(x, y, z);
  }

  public static class ContourBuilder extends TraceBuilder {

    private static final String type = "contour";
    private final Object[] x;
    private final Object[] y;
    private final double[][] z;

    ContourBuilder(Object[] x, Object[] y, double[][] z) {
      this.x = x;
      this.y = y;
      this.z = z;
    }

    @Override
    public ContourTrace.ContourBuilder xAxis(String xAxis) {
      super.xAxis(xAxis);
      return this;
    }

    @Override
    public ContourTrace.ContourBuilder yAxis(String yAxis) {
      super.yAxis(yAxis);
      return this;
    }

    public ContourTrace build() {
      return new ContourTrace(this);
    }

    @Override
    protected String getType() {
      return type;
    }
  }
}


    Map<String, Object> context = super.getContext();
    context.put("variableName", "trace0");
    context.put("x", dataAsString(x));
    context.put("y", dataAsString(y));
    context.put("z", dataAsString(z));
    context.put("type", type);
    return context;
  
<methods>public void <init>(tech.tablesaw.plotly.traces.TraceBuilder) ,public tech.tablesaw.plotly.components.HoverLabel hoverLabel() ,public java.lang.String name() ,public boolean showLegend() ,public java.lang.String toString() <variables>protected static final double DEFAULT_OPACITY,protected static final tech.tablesaw.plotly.traces.AbstractTrace.Visibility DEFAULT_VISIBILITY,protected final PebbleEngine engine,private final non-sealed tech.tablesaw.plotly.components.HoverLabel hoverLabel,private final non-sealed java.lang.String[] ids,private final non-sealed java.lang.String legendGroup,private final non-sealed java.lang.String name,private final non-sealed double opacity,private final non-sealed java.lang.Boolean showLegend,protected final non-sealed java.lang.String type,private final non-sealed tech.tablesaw.plotly.traces.AbstractTrace.Visibility visible,private final non-sealed java.lang.String xAxis,private final non-sealed java.lang.String yAxis