@uwdata/mosaic-plot 0.14.1 → 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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/marks/Mark.js +6 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uwdata/mosaic-plot",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "A Mosaic-powered plotting framework based on Observable Plot.",
5
5
  "keywords": [
6
6
  "data",
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@observablehq/plot": "^0.6.17",
29
- "@uwdata/mosaic-core": "^0.14.1",
30
- "@uwdata/mosaic-sql": "^0.14.1",
29
+ "@uwdata/mosaic-core": "^0.15.0",
30
+ "@uwdata/mosaic-sql": "^0.15.0",
31
31
  "d3": "^7.9.0",
32
32
  "isoformat": "^0.2.1"
33
33
  },
34
- "gitHead": "5959cb169e95bd8467e1e5d7a9b98954f09474f3"
34
+ "gitHead": "671ad1ba86749a8435bd4aa7e722e2a8553f2cb0"
35
35
  }
package/src/marks/Mark.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isParam, MosaicClient, toDataColumns } from '@uwdata/mosaic-core';
1
+ import { isParam, MosaicClient, queryFieldInfo, toDataColumns } from '@uwdata/mosaic-core';
2
2
  import { Query, SelectQuery, collectParams, column, isAggregateExpression, isColumnParam, isColumnRef, isNode, isParamLike } from '@uwdata/mosaic-sql';
3
3
  import { isColor } from './util/is-color.js';
4
4
  import { isConstantOption } from './util/is-constant-option.js';
@@ -121,7 +121,7 @@ export class Mark extends MosaicClient {
121
121
  return c?.field ? c : null;
122
122
  }
123
123
 
124
- fields() {
124
+ async prepare() {
125
125
  if (this.hasOwnData()) return null;
126
126
 
127
127
  const { channels, reqs } = this;
@@ -136,14 +136,11 @@ export class Mark extends MosaicClient {
136
136
  }
137
137
 
138
138
  const table = this.sourceTable();
139
- return Array.from(fields, ([c, s]) => ({
140
- table,
141
- column: c,
142
- stats: Array.from(s)
143
- }));
144
- }
139
+ const info = await queryFieldInfo(
140
+ this.coordinator,
141
+ Array.from(fields, ([c, s]) => ({ table, column: c, stats: Array.from(s) }))
142
+ );
145
143
 
146
- fieldInfo(info) {
147
144
  const lookup = Object.fromEntries(info.map(x => [x.column, x]));
148
145
  for (const entry of this.channels) {
149
146
  const { field } = entry;
@@ -152,7 +149,6 @@ export class Mark extends MosaicClient {
152
149
  }
153
150
  }
154
151
  this._fieldInfo = true;
155
- return this;
156
152
  }
157
153
 
158
154
  /**