Search in sources :

Example 6 with Column

use of io.deephaven.web.client.api.Column in project deephaven-core by deephaven.

the class ChartData method insertDataRange.

private void insertDataRange(UpdateEventData tableData, Range range, int offset) {
    // splice in the new indexes
    batchSplice(offset, asArray(indexes), longs(range));
    // splice in data to each column
    for (Entry<String, Map<JsFunction<Any, Any>, JsArray<Any>>> columnMap : cachedData.entrySet()) {
        String columnName = columnMap.getKey();
        Column col = table.findColumn(columnName);
        for (Entry<JsFunction<Any, Any>, JsArray<Any>> mapFuncAndArray : columnMap.getValue().entrySet()) {
            JsFunction<Any, Any> func = mapFuncAndArray.getKey();
            JsArray<Any> arr = mapFuncAndArray.getValue();
            // here we create a new array and splice it in, to avoid slowly growing the data array in the case
            // of many rows being added
            Any[] values = values(tableData, func, col, range);
            batchSplice(offset, arr, values);
        }
    }
}
Also used : JsFunction(io.deephaven.web.shared.fu.JsFunction) JsArray(elemental2.core.JsArray) Column(io.deephaven.web.client.api.Column) Any(jsinterop.base.Any)

Aggregations

Column (io.deephaven.web.client.api.Column)6 JsArray (elemental2.core.JsArray)3 JsFunction (io.deephaven.web.shared.fu.JsFunction)3 Any (jsinterop.base.Any)3 JsRangeSet (io.deephaven.web.client.api.JsRangeSet)2 JsTable (io.deephaven.web.client.api.JsTable)2 TableData (io.deephaven.web.client.api.TableData)2 Js (jsinterop.base.Js)2 Int8Array (elemental2.core.Int8Array)1 Uint8Array (elemental2.core.Uint8Array)1 CustomEvent (elemental2.dom.CustomEvent)1 CustomEventInit (elemental2.dom.CustomEventInit)1 DomGlobal (elemental2.dom.DomGlobal)1 Event (elemental2.dom.Event)1 IThenable (elemental2.promise.IThenable)1 Promise (elemental2.promise.Promise)1 Message (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.Message)1 MessageHeader (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.MessageHeader)1 RecordBatch (io.deephaven.javascript.proto.dhinternal.arrow.flight.flatbuf.message_generated.org.apache.arrow.flatbuf.RecordBatch)1 FlightData (io.deephaven.javascript.proto.dhinternal.arrow.flight.protocol.flight_pb.FlightData)1