@kanzo-tech/mosaic 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,7 +14,7 @@ Mosaic are two coordinators, and two coordinators are two crossfilters that neve
14
14
 
15
15
  ```ts
16
16
  import { Coordinator, Selection, MosaicClient, clausePoints } from "@kanzo-tech/mosaic";
17
- import { column, fillColumn, numbers } from "@kanzo-tech/mosaic";
17
+ import { column, numbers } from "@kanzo-tech/mosaic";
18
18
  import { engine } from "@kanzo-tech/mosaic";
19
19
  ```
20
20
 
@@ -47,7 +47,7 @@ import { engine } from "@kanzo-tech/mosaic";
47
47
  - **Re-exports** of the coordinator, the clients, the five clause builders and the loaders — so a
48
48
  consumer never needs a direct `@uwdata` import. The DuckDB-WASM connector is not among them:
49
49
  `engine()` is the only boot.
50
- - **`column` / `fillColumn` / `numbers`** — the half of the client protocol the protocol does not
50
+ - **`column` / `numbers`** — the half of the client protocol the protocol does not
51
51
  give you. The coordinator answers with an Arrow table, and Arrow offers a typed column only when
52
52
  the type allows one: an integer id gives an array, a dictionary-encoded label gives nothing
53
53
  usable. Every call site was writing `as { getChild(name: string): … }`, which asserts Arrow's
package/dist/arrow.d.ts CHANGED
@@ -16,22 +16,4 @@
16
16
  export declare function column(data: unknown, field: string): unknown[];
17
17
  /** The same, coerced — Arrow hands back `BigInt` for some integer widths. */
18
18
  export declare function numbers(data: unknown, field: string): number[];
19
- /** A pre-sized destination `fillColumn` can write into. */
20
- export type NumericArray = Float32Array | Float64Array | Uint32Array | Uint16Array | Int32Array;
21
- /**
22
- * One numeric column, written straight into a typed array the caller already owns.
23
- *
24
- * `numbers()` is the wrong tool once a result is large: `toArray()` already hands back a typed
25
- * buffer, and `Array.from(...).map(Number)` turns it into two full-length boxed `number[]` on the
26
- * way to a third array that was the actual destination. Three allocations to move nothing. This is
27
- * the same pass with none of them — which is what lets a caller size once against its own limit and
28
- * fill from the Arrow batches as they arrive.
29
- *
30
- * `stride` and `offset` are how interleaving is expressed: `x` at `(0, 2)` and `y` at `(1, 2)` fill
31
- * one `[x0, y0, x1, y1, …]` buffer with no seam between them.
32
- *
33
- * Returns how many rows were written, which is `min(rows, capacity)` — a caller that sized against
34
- * a `LIMIT` uses it to `subarray` down to what actually came back.
35
- */
36
- export declare function fillColumn(data: unknown, field: string, into: NumericArray, offset?: number, stride?: number): number;
37
19
  //# sourceMappingURL=arrow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../src/arrow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAI9D;AAED,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9D;AAED,2DAA2D;AAC3D,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC;AAEhG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,YAAY,EAClB,MAAM,SAAI,EACV,MAAM,SAAI,GACT,MAAM,CAiBR"}
1
+ {"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../src/arrow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,4CAA4C;AAC5C,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAI9D;AAED,6EAA6E;AAC7E,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAE9D"}
package/dist/arrow.js CHANGED
@@ -23,39 +23,4 @@ export function column(data, field) {
23
23
  export function numbers(data, field) {
24
24
  return column(data, field).map(Number);
25
25
  }
26
- /**
27
- * One numeric column, written straight into a typed array the caller already owns.
28
- *
29
- * `numbers()` is the wrong tool once a result is large: `toArray()` already hands back a typed
30
- * buffer, and `Array.from(...).map(Number)` turns it into two full-length boxed `number[]` on the
31
- * way to a third array that was the actual destination. Three allocations to move nothing. This is
32
- * the same pass with none of them — which is what lets a caller size once against its own limit and
33
- * fill from the Arrow batches as they arrive.
34
- *
35
- * `stride` and `offset` are how interleaving is expressed: `x` at `(0, 2)` and `y` at `(1, 2)` fill
36
- * one `[x0, y0, x1, y1, …]` buffer with no seam between them.
37
- *
38
- * Returns how many rows were written, which is `min(rows, capacity)` — a caller that sized against
39
- * a `LIMIT` uses it to `subarray` down to what actually came back.
40
- */
41
- export function fillColumn(data, field, into, offset = 0, stride = 1) {
42
- const capacity = Math.max(0, Math.ceil((into.length - offset) / stride));
43
- const values = data.getChild?.(field)?.toArray();
44
- if (values) {
45
- const n = Math.min(values.length, capacity);
46
- // `Number` is identity on the numeric widths and the conversion on the BigInt ones; either way
47
- // it reads an element rather than allocating one.
48
- for (let i = 0; i < n; i++)
49
- into[offset + i * stride] = Number(values[i]);
50
- return n;
51
- }
52
- let i = 0;
53
- for (const row of data) {
54
- if (i >= capacity)
55
- break;
56
- into[offset + i * stride] = Number(row[field]);
57
- i++;
58
- }
59
- return i;
60
- }
61
26
  //# sourceMappingURL=arrow.js.map
package/dist/arrow.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"arrow.js","sourceRoot":"","sources":["../src/arrow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,4CAA4C;AAC5C,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,KAAa;IACjD,MAAM,KAAK,GAAI,IAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,KAAK;QAAE,OAAO,KAAK,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IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC,EAAE,CAAC;IACN,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"arrow.js","sourceRoot":"","sources":["../src/arrow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,4CAA4C;AAC5C,MAAM,UAAU,MAAM,CAAC,IAAa,EAAE,KAAa;IACjD,MAAM,KAAK,GAAI,IAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;IACpD,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAyC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACpF,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,OAAO,CAAC,IAAa,EAAE,KAAa;IAClD,OAAO,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -23,7 +23,7 @@
23
23
  export { Coordinator, MosaicClient, Selection, makeClient, clausePoint, clausePoints, clauseInterval, clauseIntervals, clauseMatch, type SelectionClause, } from "@uwdata/mosaic-core";
24
24
  export { Query, asc, desc, loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial, loadExtension, type ExprValue, type FilterExpr, } from "@uwdata/mosaic-sql";
25
25
  /** Ours: turning an Arrow answer into values, which the client protocol does not do for you. */
26
- export { column, fillColumn, numbers, type NumericArray } from "./arrow.js";
26
+ export { column, numbers } from "./arrow.js";
27
27
  /** Ours: what every `table` here and in the charts takes — one identifier, or a relation named in SQL. */
28
28
  export { type TableExpr } from "./table.js";
29
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,EACL,GAAG,EACH,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAC;AAE5B,gGAAgG;AAChG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE5E,0GAA0G;AAC1G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,EACX,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,EACL,GAAG,EACH,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,EACb,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,oBAAoB,CAAC;AAE5B,gGAAgG;AAChG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE7C,0GAA0G;AAC1G,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@
23
23
  export { Coordinator, MosaicClient, Selection, makeClient, clausePoint, clausePoints, clauseInterval, clauseIntervals, clauseMatch, } from "@uwdata/mosaic-core";
24
24
  export { Query, asc, desc, loadCSV, loadJSON, loadObjects, loadParquet, loadSpatial, loadExtension, } from "@uwdata/mosaic-sql";
25
25
  /** Ours: turning an Arrow answer into values, which the client protocol does not do for you. */
26
- export { column, fillColumn, numbers } from "./arrow.js";
26
+ export { column, numbers } from "./arrow.js";
27
27
  /** Ours: what every `table` here and in the charts takes — one identifier, or a relation named in SQL. */
28
28
  export {} from "./table.js";
29
29
  /**
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,GAEZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,EACL,GAAG,EACH,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAE5B,gGAAgG;AAChG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAqB,MAAM,YAAY,CAAC;AAE5E,0GAA0G;AAC1G,OAAO,EAAkB,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,WAAW,GAEZ,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,EACL,GAAG,EACH,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAE5B,gGAAgG;AAChG,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE7C,0GAA0G;AAC1G,OAAO,EAAkB,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAe,MAAM,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanzo-tech/mosaic",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "The Mosaic conversation, without React — coordinator, clients and clauses re-exported as one surface, plus the Arrow column reader and the id-set client that every consumer of them was writing by hand.",
5
5
  "type": "module",
6
6
  "license": "MIT",