class Page extends Component {

  private final Figure figure;
  private final String divName;

  private final String plotlyJsLocation;

  private Page(PageBuilder builder) {
    this.figure = builder.figure;
    this.divName = builder.divName;
    this.plotlyJsLocation = builder.plotlyJsLocation;
  }

  @Override
  public String asJavascript() {
    return asJavascript("page_template.html");
  }

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

  public static PageBuilder pageBuilder(Figure figure, String divName) {
    return new PageBuilder(figure, divName);
  }

  public static class PageBuilder {

    private final Figure figure;
    private final String divName;

    private String plotlyJsLocation = null;

    public PageBuilder(Figure figure, String divName) {
      this.figure = figure;
      this.divName = divName;
    }

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

    public PageBuilder plotlyJsLocation(String location) {
      this.plotlyJsLocation = location;
      return this;
    }
  }
}

    Map<String, Object> context = new HashMap<>();
    context.put("figureScript", figure.asJavascript(divName));
    context.put("targetDiv", figure.divString(divName));
    context.put("figureTitle", figure.getLayout() != null ? figure.getLayout().getTitle() : null);
    context.put("plotlyJsLocation", plotlyJsLocation);
    return context;
  
<methods>public non-sealed void <init>() ,public java.lang.String asJSON() ,public abstract java.lang.String asJavascript() ,public java.lang.String toString() <variables>private final PebbleEngine engine,protected static final ObjectMapper mapper