Search in sources :

Example 1 with JsFigure

use of io.deephaven.web.client.api.widget.plot.JsFigure in project deephaven-core by deephaven.

the class WorkerConnection method getFigure.

public Promise<JsFigure> getFigure(JsVariableDefinition varDef) {
    if (!varDef.getType().equals("Figure")) {
        throw new IllegalArgumentException("Can't load as a figure: " + varDef.getType());
    }
    return whenServerReady("get a figure").then(server -> new JsFigure(this, c -> {
        FetchObjectRequest request = new FetchObjectRequest();
        TypedTicket typedTicket = new TypedTicket();
        typedTicket.setTicket(TableTicket.createTicket(varDef));
        typedTicket.setType(varDef.getType());
        request.setSourceId(typedTicket);
        objectServiceClient().fetchObject(request, metadata(), c::apply);
    }).refetch());
}
Also used : FetchObjectRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.object_pb.FetchObjectRequest) JsFigure(io.deephaven.web.client.api.widget.plot.JsFigure) TypedTicket(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.TypedTicket) Grpc(io.deephaven.javascript.proto.dhinternal.grpcweb.Grpc)

Aggregations

Grpc (io.deephaven.javascript.proto.dhinternal.grpcweb.Grpc)1 FetchObjectRequest (io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.object_pb.FetchObjectRequest)1 TypedTicket (io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.TypedTicket)1 JsFigure (io.deephaven.web.client.api.widget.plot.JsFigure)1