@uwdata/mosaic-spec 0.6.1 → 0.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uwdata/mosaic-spec",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
4
4
  "description": "Declarative specification of Mosaic-powered applications.",
5
5
  "keywords": [
6
6
  "mosaic",
@@ -28,10 +28,10 @@
28
28
  "prepublishOnly": "npm run test && npm run lint && npm run build"
29
29
  },
30
30
  "dependencies": {
31
- "@uwdata/mosaic-core": "^0.6.1",
32
- "@uwdata/mosaic-sql": "^0.6.0",
33
- "@uwdata/vgplot": "^0.6.1",
31
+ "@uwdata/mosaic-core": "^0.7.1",
32
+ "@uwdata/mosaic-sql": "^0.7.0",
33
+ "@uwdata/vgplot": "^0.7.1",
34
34
  "isoformat": "^0.2.1"
35
35
  },
36
- "gitHead": "9e788e6dc5241fa1c54967a25fd9599f97da1a41"
36
+ "gitHead": "7e6f3ea9b3011ea2c9201c1aa16e8e5664621a4c"
37
37
  }
package/src/ast-to-dom.js CHANGED
@@ -33,9 +33,12 @@ export async function astToDOM(ast, options) {
33
33
  }
34
34
 
35
35
  // process param/selection definitions
36
+ // skip definitions with names already defined
36
37
  for (const [name, node] of Object.entries(params)) {
37
- const param = node.instantiate(ctx);
38
- ctx.activeParams.set(name, param);
38
+ if (!ctx.activeParams.has(name)) {
39
+ const param = node.instantiate(ctx);
40
+ ctx.activeParams.set(name, param);
41
+ }
39
42
  }
40
43
 
41
44
  return {
@@ -48,12 +51,12 @@ export class InstantiateContext {
48
51
  constructor({
49
52
  api = createAPIContext(),
50
53
  plotDefaults = [],
51
- activeParams = new Map,
54
+ params = new Map,
52
55
  baseURL = null
53
56
  } = {}) {
54
57
  this.api = api;
55
58
  this.plotDefaults = plotDefaults;
56
- this.activeParams = activeParams;
59
+ this.activeParams = params;
57
60
  this.baseURL = baseURL;
58
61
  this.coordinator = api.context.coordinator;
59
62
  }