@kanzo-tech/mosaic 0.13.1 → 0.14.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 +1 -4
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/id-set-client.d.ts +0 -43
- package/dist/id-set-client.d.ts.map +0 -1
- package/dist/id-set-client.js +0 -35
- package/dist/id-set-client.js.map +0 -1
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
|
|
17
|
+
import { column, fillColumn, numbers } from "@kanzo-tech/mosaic";
|
|
18
18
|
import { engine } from "@kanzo-tech/mosaic";
|
|
19
19
|
```
|
|
20
20
|
|
|
@@ -55,9 +55,6 @@ import { engine } from "@kanzo-tech/mosaic";
|
|
|
55
55
|
- **`TableExpr`** — what a `table` takes, here and in the charts: a string is one identifier in the
|
|
56
56
|
default catalog, a mosaic-sql node is a relation named in SQL — `verbatim(relation.sql)` for a
|
|
57
57
|
fossil corpus's catalog-qualified relation.
|
|
58
|
-
- **`IdSetClient`** — the crossfilter adapter for a view whose positions are not in the database.
|
|
59
|
-
A GPU canvas or a map cannot publish `weight BETWEEN …`; there is no column to write the
|
|
60
|
-
predicate over. It can only enumerate what was hit.
|
|
61
58
|
|
|
62
59
|
## Why it is not part of `@kanzo-tech/ui`
|
|
63
60
|
|
package/dist/index.d.ts
CHANGED
|
@@ -26,8 +26,6 @@ export { Query, asc, desc, loadCSV, loadJSON, loadObjects, loadParquet, loadSpat
|
|
|
26
26
|
export { column, fillColumn, numbers, type NumericArray } 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
|
-
/** Ours: the crossfilter adapter for a view whose positions are not in the database. */
|
|
30
|
-
export { IdSetClient, type IdSetClientOptions } from "./id-set-client.js";
|
|
31
29
|
/**
|
|
32
30
|
* Ours: the page's one DuckDB-WASM engine — the coordinator and the file registry beside it. It is
|
|
33
31
|
* the only door to `wasmConnector`, which is why that is no longer re-exported: a second boot is a
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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
|
|
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"}
|
package/dist/index.js
CHANGED
|
@@ -26,8 +26,6 @@ export { Query, asc, desc, loadCSV, loadJSON, loadObjects, loadParquet, loadSpat
|
|
|
26
26
|
export { column, fillColumn, 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
|
-
/** Ours: the crossfilter adapter for a view whose positions are not in the database. */
|
|
30
|
-
export { IdSetClient } from "./id-set-client.js";
|
|
31
29
|
/**
|
|
32
30
|
* Ours: the page's one DuckDB-WASM engine — the coordinator and the file registry beside it. It is
|
|
33
31
|
* the only door to `wasmConnector`, which is why that is no longer re-exported: a second boot is a
|
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
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanzo-tech/mosaic",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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",
|
package/dist/id-set-client.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { MosaicClient, type Selection } from "@uwdata/mosaic-core";
|
|
2
|
-
import { type FilterExpr } from "@uwdata/mosaic-sql";
|
|
3
|
-
import type { TableExpr } from "./table.js";
|
|
4
|
-
/**
|
|
5
|
-
* The crossfilter adapter for a view whose positions are not in the database.
|
|
6
|
-
*
|
|
7
|
-
* A `MosaicClient` asks for two things, and this is both:
|
|
8
|
-
*
|
|
9
|
-
* `query(filter)` — which rows survive the page's filters? The coordinator answers with a column
|
|
10
|
-
* of ids, and the view fades everything else. The **observable** half.
|
|
11
|
-
* `publish(ids)` — the user selected these. A points clause, `id IN (…)`, which every other chart
|
|
12
|
-
* on the page filters by. The **controllable** half.
|
|
13
|
-
*
|
|
14
|
-
* The id list is not a shortcut, it is the only thing such a view can say. A Plot brush publishes
|
|
15
|
-
* `weight BETWEEN …`, an interval in data space, because Plot's `x` IS a column. A GPU simulation's
|
|
16
|
-
* `x` exists nowhere in the database, so no predicate over columns can describe the loop the user
|
|
17
|
-
* drew. Enumerating what was hit is the honest translation — and its cost is the length of the `IN`
|
|
18
|
-
* list, which is the real ceiling on the whole approach.
|
|
19
|
-
*
|
|
20
|
-
* Nothing here knows what draws. It is named for what it exchanges rather than for the renderer it
|
|
21
|
-
* was first written against, because a canvas, a map and an imperative widget all reach the
|
|
22
|
-
* crossfilter through exactly this shape.
|
|
23
|
-
*/
|
|
24
|
-
export interface IdSetClientOptions {
|
|
25
|
-
/** The relation. Its `idField` column is what gets published and matched. */
|
|
26
|
-
table: TableExpr;
|
|
27
|
-
idField: string;
|
|
28
|
-
/** What the view fades by. */
|
|
29
|
-
filterBy: Selection;
|
|
30
|
-
/** Where the selection publishes. */
|
|
31
|
-
as: Selection;
|
|
32
|
-
/** The surviving ids, in relation order, on every filter change. */
|
|
33
|
-
onSurvivors: (ids: readonly unknown[]) => void;
|
|
34
|
-
}
|
|
35
|
-
export declare class IdSetClient extends MosaicClient {
|
|
36
|
-
#private;
|
|
37
|
-
constructor(options: IdSetClientOptions);
|
|
38
|
-
query(filter?: FilterExpr): import("@uwdata/mosaic-sql").SelectQuery;
|
|
39
|
-
queryResult(data: unknown): this;
|
|
40
|
-
/** `null` retracts the selection: an empty clause has a null predicate, which the resolver drops. */
|
|
41
|
-
publish(ids: readonly unknown[] | null): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=id-set-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id-set-client.d.ts","sourceRoot":"","sources":["../src/id-set-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAgB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,EAAE,EAAE,SAAS,CAAC;IACd,oEAAoE;IACpE,WAAW,EAAE,CAAC,GAAG,EAAE,SAAS,OAAO,EAAE,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,WAAY,SAAQ,YAAY;;gBAM/B,OAAO,EAAE,kBAAkB;IAQ9B,KAAK,CAAC,MAAM,GAAE,UAAe;IAI7B,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAKzC,qGAAqG;IACrG,OAAO,CAAC,GAAG,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,GAAG,IAAI;CAY9C"}
|
package/dist/id-set-client.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { MosaicClient, clausePoints } from "@uwdata/mosaic-core";
|
|
2
|
-
import { Query } from "@uwdata/mosaic-sql";
|
|
3
|
-
import { column } from "./arrow.js";
|
|
4
|
-
export class IdSetClient extends MosaicClient {
|
|
5
|
-
#table;
|
|
6
|
-
#idField;
|
|
7
|
-
#as;
|
|
8
|
-
#emit;
|
|
9
|
-
constructor(options) {
|
|
10
|
-
super(options.filterBy);
|
|
11
|
-
this.#table = options.table;
|
|
12
|
-
this.#idField = options.idField;
|
|
13
|
-
this.#as = options.as;
|
|
14
|
-
this.#emit = options.onSurvivors;
|
|
15
|
-
}
|
|
16
|
-
query(filter = []) {
|
|
17
|
-
return Query.from(this.#table).select({ id: this.#idField }).where(filter);
|
|
18
|
-
}
|
|
19
|
-
queryResult(data) {
|
|
20
|
-
this.#emit(column(data, "id"));
|
|
21
|
-
return this;
|
|
22
|
-
}
|
|
23
|
-
/** `null` retracts the selection: an empty clause has a null predicate, which the resolver drops. */
|
|
24
|
-
publish(ids) {
|
|
25
|
-
this.#as.update(clausePoints([this.#idField], ids?.map((id) => [id]), {
|
|
26
|
-
source: this,
|
|
27
|
-
// A crossfilter normally exempts a client from its own clause, so a brush can be widened
|
|
28
|
-
// after it has collapsed the chart under it. A view that FADES an excluded row instead of
|
|
29
|
-
// removing it does not need the exemption: the row is still on screen and still
|
|
30
|
-
// selectable. Declining it is what makes the selection visible — the fade is the brush.
|
|
31
|
-
clients: new Set(),
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=id-set-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id-set-client.js","sourceRoot":"","sources":["../src/id-set-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAmB,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAoCpC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAC3C,MAAM,CAAY;IAClB,QAAQ,CAAS;IACjB,GAAG,CAAY;IACf,KAAK,CAAoC;IAEzC,YAAY,OAA2B;QACrC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC;IACnC,CAAC;IAEQ,KAAK,CAAC,SAAqB,EAAE;QACpC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7E,CAAC;IAEQ,WAAW,CAAC,IAAa;QAChC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,qGAAqG;IACrG,OAAO,CAAC,GAA8B;QACpC,IAAI,CAAC,GAAG,CAAC,MAAM,CACb,YAAY,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACpD,MAAM,EAAE,IAAI;YACZ,yFAAyF;YACzF,0FAA0F;YAC1F,gFAAgF;YAChF,wFAAwF;YACxF,OAAO,EAAE,IAAI,GAAG,EAAgB;SACjC,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
|