use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsFigure method refetch.
@JsIgnore
public Promise<JsFigure> refetch() {
plotHandlesToTables = new HashMap<>();
return Callbacks.grpcUnaryPromise(fetch::fetch).then(response -> {
this.descriptor = FigureDescriptor.deserializeBinary(response.getData_asU8());
charts = descriptor.getChartsList().asList().stream().map(chartDescriptor -> new JsChart(chartDescriptor, this)).toArray(JsChart[]::new);
JsObject.freeze(charts);
return this.tableFetch.fetch(this, response);
}).then(tableFetchData -> {
// all tables are wired up, need to map them to the series instances
tables = tableFetchData.tables;
tableMaps = tableFetchData.tableMaps;
plotHandlesToTableMaps = tableFetchData.plotHandlesToTableMaps;
onClose = tableFetchData.onClose;
for (int i = 0; i < tables.length; i++) {
JsTable table = tables[i];
registerTableWithId(table, Js.cast(JsArray.of((double) i)));
}
Arrays.stream(charts).flatMap(c -> Arrays.stream(c.getSeries())).forEach(s -> s.initSources(plotHandlesToTables, plotHandlesToTableMaps));
Arrays.stream(charts).flatMap(c -> Arrays.stream(c.getMultiSeries())).forEach(s -> s.initSources(plotHandlesToTableMaps));
return null;
}).then(ignore -> {
unsuppressEvents();
fireEvent(EVENT_RECONNECT);
return Promise.resolve(this);
}, err -> {
final FigureFetchError fetchError = new FigureFetchError(LazyPromise.ofObject(err), this.descriptor != null ? this.descriptor.getErrorsList() : new JsArray<>());
final CustomEventInit init = CustomEventInit.create();
init.setDetail(fetchError);
unsuppressEvents();
fireEvent(EVENT_RECONNECTFAILED, init);
suppressEvents();
// noinspection unchecked,rawtypes
return (Promise<JsFigure>) (Promise) Promise.reject(fetchError);
});
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsFigure method downsampleNeeded.
@JsIgnore
public void downsampleNeeded(String message, Set<JsSeries> series, double tableSize) {
CustomEventInit failInit = CustomEventInit.create();
failInit.setDetail(JsPropertyMap.of("series", series, "message", message, "size", tableSize));
fireEvent(EVENT_DOWNSAMPLENEEDED, failInit);
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsFigure method enqueueSubscriptionCheck.
@JsIgnore
public void enqueueSubscriptionCheck() {
if (!subCheckEnqueued) {
for (JsTable table : tables) {
if (table.isClosed()) {
throw new IllegalStateException("Cannot subscribe, at least one table is disconnected");
}
}
subCheckEnqueued = true;
LazyPromise.runLater(this::updateSubscriptions);
}
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsMultiSeries method initSources.
@JsIgnore
public void initSources(Map<Integer, TableMap> plotHandlesToTableMaps) {
descriptor.getDataSourcesList().asList().stream().mapToInt(MultiSeriesSourceDescriptor::getTableMapId).distinct().forEach(plotHandle -> {
TableMap tableMap = plotHandlesToTableMaps.get(plotHandle);
tableMap.getKeys().forEach((p0, p1, p2) -> {
requestTable(tableMap, p0);
return null;
});
tableMap.addEventListener(TableMap.EVENT_KEYADDED, event -> {
requestTable(tableMap, ((CustomEvent) event).detail);
});
});
}
use of jsinterop.annotations.JsIgnore in project deephaven-core by deephaven.
the class JsRollupConfig method buildRequest.
@JsIgnore
public RollupTableRequest buildRequest() {
RollupTableRequest rollupRequest = new RollupTableRequest();
ArrayList<String> aggregations = new ArrayList<>();
this.aggregations.forEach(key -> aggregations.add("" + key + "=" + String.join(",", JsArrays.toStringArray(this.aggregations.get(key)))));
rollupRequest.setAggregations(aggregations.toArray(new String[0]));
JsArrays.setArray(groupingColumns, rollupRequest::setGroupingColumns);
rollupRequest.setIncludeConstituents(includeConstituents);
rollupRequest.setIncludeOriginalColumns(includeOriginalColumns);
rollupRequest.setIncludeDescriptions(includeDescriptions);
return rollupRequest;
}
Aggregations