@uwdata/mosaic-core 0.3.2 → 0.3.4
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/dist/mosaic-core.js +12 -6
- package/dist/mosaic-core.min.js +5 -5
- package/package.json +3 -3
- package/src/DataCubeIndexer.js +8 -3
- package/src/Selection.js +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uwdata/mosaic-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Scalable and extensible linked data views.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mosaic",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@duckdb/duckdb-wasm": "^1.27.0",
|
|
32
|
-
"@uwdata/mosaic-sql": "^0.3.
|
|
32
|
+
"@uwdata/mosaic-sql": "^0.3.4",
|
|
33
33
|
"apache-arrow": "^11.0.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "faed78bc6264faa09a20b385601e03a9e1e15979"
|
|
36
36
|
}
|
package/src/DataCubeIndexer.js
CHANGED
|
@@ -87,11 +87,15 @@ export class DataCubeIndexer {
|
|
|
87
87
|
subqueryPushdown(subq, cols);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// push orderby criteria to later cube queries
|
|
91
|
+
const order = query.orderby();
|
|
92
|
+
query.query.orderby = [];
|
|
93
|
+
|
|
90
94
|
const sql = query.toString();
|
|
91
95
|
const id = (fnv_hash(sql) >>> 0).toString(16);
|
|
92
96
|
const table = `cube_index_${id}`;
|
|
93
97
|
const result = mc.exec(create(table, sql, { temp }));
|
|
94
|
-
indices.set(client, { table, result, ...index });
|
|
98
|
+
indices.set(client, { table, result, order, ...index });
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -111,12 +115,13 @@ export class DataCubeIndexer {
|
|
|
111
115
|
filter = this.activeView.predicate(this.selection.active.predicate);
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
const { table, dims, aggr } = index;
|
|
118
|
+
const { table, dims, aggr, order = [] } = index;
|
|
115
119
|
const query = Query
|
|
116
120
|
.select(dims, aggr)
|
|
117
121
|
.from(table)
|
|
118
122
|
.groupby(dims)
|
|
119
|
-
.where(filter)
|
|
123
|
+
.where(filter)
|
|
124
|
+
.orderby(order);
|
|
120
125
|
return this.mc.updateClient(client, query);
|
|
121
126
|
}
|
|
122
127
|
}
|
package/src/Selection.js
CHANGED
|
@@ -86,7 +86,7 @@ export class Selection extends Param {
|
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Create a clone of this Selection with clauses corresponding
|
|
89
|
-
* to provided source removed.
|
|
89
|
+
* to the provided source removed.
|
|
90
90
|
* @param {*} source The clause source to remove.
|
|
91
91
|
* @returns {this} A cloned and updated Selection.
|
|
92
92
|
*/
|
|
@@ -192,12 +192,16 @@ export class Selection extends Param {
|
|
|
192
192
|
/**
|
|
193
193
|
* Return a selection query predicate for the given client.
|
|
194
194
|
* @param {*} client The client whose data may be filtered.
|
|
195
|
+
* @param {boolean} [noSkip=false] Disable skipping of active
|
|
196
|
+
* cross-filtered sources. If set true, the source of the active
|
|
197
|
+
* clause in a cross-filtered selection will not be skipped.
|
|
195
198
|
* @returns {*} The query predicate for filtering client data,
|
|
196
199
|
* based on the current state of this selection.
|
|
197
200
|
*/
|
|
198
|
-
predicate(client) {
|
|
201
|
+
predicate(client, noSkip = false) {
|
|
199
202
|
const { clauses } = this;
|
|
200
|
-
|
|
203
|
+
const active = noSkip ? null : clauses.active;
|
|
204
|
+
return this._resolver.predicate(clauses, active, client);
|
|
201
205
|
}
|
|
202
206
|
}
|
|
203
207
|
|