@uwdata/vgplot 0.7.1 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uwdata/vgplot",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "An API for interactive Mosaic-powered visualizations and dashboards.",
5
5
  "keywords": [
6
6
  "data",
@@ -25,15 +25,15 @@
25
25
  "scripts": {
26
26
  "prebuild": "rimraf dist && mkdir dist",
27
27
  "build": "node ../../esbuild.js vgplot",
28
- "lint": "eslint src test --ext .js",
28
+ "lint": "eslint src test",
29
29
  "test": "mocha 'test/**/*-test.js'",
30
30
  "prepublishOnly": "npm run test && npm run lint && npm run build"
31
31
  },
32
32
  "dependencies": {
33
- "@uwdata/mosaic-core": "^0.7.1",
34
- "@uwdata/mosaic-inputs": "^0.7.1",
35
- "@uwdata/mosaic-plot": "^0.7.1",
36
- "@uwdata/mosaic-sql": "^0.7.0"
33
+ "@uwdata/mosaic-core": "^0.8.0",
34
+ "@uwdata/mosaic-inputs": "^0.8.0",
35
+ "@uwdata/mosaic-plot": "^0.8.0",
36
+ "@uwdata/mosaic-sql": "^0.8.0"
37
37
  },
38
- "gitHead": "7e6f3ea9b3011ea2c9201c1aa16e8e5664621a4c"
38
+ "gitHead": "a24b4c9f7dfa1c38c6af96ec17e075326c1af9b0"
39
39
  }
package/src/api.js CHANGED
@@ -100,7 +100,6 @@ export {
100
100
  grid,
101
101
  label,
102
102
  padding,
103
- round,
104
103
  xScale,
105
104
  xDomain,
106
105
  xRange,
@@ -125,10 +124,12 @@ export {
125
124
  xLine,
126
125
  xLabel,
127
126
  xLabelAnchor,
127
+ xLabelArrow,
128
128
  xLabelOffset,
129
129
  xFontVariant,
130
130
  xAriaLabel,
131
131
  xAriaDescription,
132
+ xPercent,
132
133
  xReverse,
133
134
  xZero,
134
135
  xBase,
@@ -158,10 +159,12 @@ export {
158
159
  yLine,
159
160
  yLabel,
160
161
  yLabelAnchor,
162
+ yLabelArrow,
161
163
  yLabelOffset,
162
164
  yFontVariant,
163
165
  yAriaLabel,
164
166
  yAriaDescription,
167
+ yPercent,
165
168
  yReverse,
166
169
  yZero,
167
170
  yBase,
@@ -176,7 +179,6 @@ export {
176
179
  facetLabel,
177
180
  fxDomain,
178
181
  fxRange,
179
- fxNice,
180
182
  fxInset,
181
183
  fxInsetLeft,
182
184
  fxInsetRight,
@@ -203,7 +205,6 @@ export {
203
205
  fxReverse,
204
206
  fyDomain,
205
207
  fyRange,
206
- fyNice,
207
208
  fyInset,
208
209
  fyInsetTop,
209
210
  fyInsetBottom,
@@ -239,6 +240,7 @@ export {
239
240
  colorPivot,
240
241
  colorSymmetric,
241
242
  colorLabel,
243
+ colorPercent,
242
244
  colorReverse,
243
245
  colorZero,
244
246
  colorTickFormat,
@@ -251,17 +253,22 @@ export {
251
253
  opacityClamp,
252
254
  opacityNice,
253
255
  opacityLabel,
256
+ opacityPercent,
254
257
  opacityReverse,
255
258
  opacityZero,
256
259
  opacityTickFormat,
257
260
  opacityBase,
258
261
  opacityExponent,
259
262
  opacityConstant,
263
+ symbolScale,
264
+ symbolDomain,
265
+ symbolRange,
260
266
  rScale,
261
267
  rDomain,
262
268
  rRange,
263
269
  rClamp,
264
270
  rNice,
271
+ rPercent,
265
272
  rZero,
266
273
  rBase,
267
274
  rExponent,
@@ -271,6 +278,7 @@ export {
271
278
  lengthRange,
272
279
  lengthClamp,
273
280
  lengthNice,
281
+ lengthPercent,
274
282
  lengthZero,
275
283
  lengthBase,
276
284
  lengthExponent,
@@ -6,7 +6,7 @@ export function concat({ direction = 'vertical', wrap = false }, children) {
6
6
  div.style.justifyContent = 'flex-start';
7
7
  div.style.alignItems = 'flex-start';
8
8
  children.forEach(child => div.appendChild(child));
9
- div.value = { element: div };
9
+ Object.assign(div, { value: { element: div } });
10
10
  return div;
11
11
  }
12
12
 
@@ -2,9 +2,7 @@ export function space({ dim = 'width', size = 10 }) {
2
2
  const span = document.createElement('span');
3
3
  span.style.display = 'inline-block';
4
4
  span.style[dim] = Number.isNaN(+size) ? size : `${size}px`;
5
- const obj = { element: span };
6
- span.value = obj;
7
- return span;
5
+ return Object.assign(span, { value: { element: span } });
8
6
  }
9
7
 
10
8
  export function vspace(size) {
@@ -71,7 +71,6 @@ export const inset = attrf('inset');
71
71
  export const grid = attrf('grid');
72
72
  export const label = attrf('label');
73
73
  export const padding = attrf('padding');
74
- export const round = attrf('round');
75
74
 
76
75
  // x scale attributes
77
76
  export const xScale = attrf('xScale');
@@ -98,10 +97,12 @@ export const xGrid = attrf('xGrid');
98
97
  export const xLine = attrf('xLine');
99
98
  export const xLabel = attrf('xLabel');
100
99
  export const xLabelAnchor = attrf('xLabelAnchor');
100
+ export const xLabelArrow = attrf('xLabelArrow');
101
101
  export const xLabelOffset = attrf('xLabelOffset');
102
102
  export const xFontVariant = attrf('xFontVariant');
103
103
  export const xAriaLabel = attrf('xAriaLabel');
104
104
  export const xAriaDescription = attrf('xAriaDescription');
105
+ export const xPercent = attrf('xPercent');
105
106
  export const xReverse = attrf('xReverse');
106
107
  export const xZero = attrf('xZero');
107
108
  export const xBase = attrf('xBase');
@@ -133,10 +134,12 @@ export const yGrid = attrf('yGrid');
133
134
  export const yLine = attrf('yLine');
134
135
  export const yLabel = attrf('yLabel');
135
136
  export const yLabelAnchor = attrf('yLabelAnchor');
137
+ export const yLabelArrow = attrf('yLabelArrow');
136
138
  export const yLabelOffset = attrf('yLabelOffset');
137
139
  export const yFontVariant = attrf('yFontVariant');
138
140
  export const yAriaLabel = attrf('yAriaLabel');
139
141
  export const yAriaDescription = attrf('yAriaDescription');
142
+ export const yPercent = attrf('yPercent');
140
143
  export const yReverse = attrf('yReverse');
141
144
  export const yZero = attrf('yZero');
142
145
  export const yBase = attrf('yBase');
@@ -155,7 +158,6 @@ export const facetLabel = attrf('facetLabel');
155
158
  // fx scale attributes
156
159
  export const fxDomain = attrf('fxDomain');
157
160
  export const fxRange = attrf('fxRange');
158
- export const fxNice = attrf('fxNice');
159
161
  export const fxInset = attrf('fxInset');
160
162
  export const fxInsetLeft = attrf('fxInsetLeft');
161
163
  export const fxInsetRight = attrf('fxInsetRight');
@@ -184,7 +186,6 @@ export const fxReverse = attrf('fxReverse');
184
186
  // fy scale attributes
185
187
  export const fyDomain = attrf('fyDomain');
186
188
  export const fyRange = attrf('fyRange');
187
- export const fyNice = attrf('fyNice');
188
189
  export const fyInset = attrf('fyInset');
189
190
  export const fyInsetTop = attrf('fyInsetTop');
190
191
  export const fyInsetBottom = attrf('fyInsetBottom');
@@ -222,6 +223,7 @@ export const colorInterpolate = attrf('colorInterpolate');
222
223
  export const colorPivot = attrf('colorPivot');
223
224
  export const colorSymmetric = attrf('colorSymmetric');
224
225
  export const colorLabel = attrf('colorLabel');
226
+ export const colorPercent = attrf('colorPercent');
225
227
  export const colorReverse = attrf('colorReverse');
226
228
  export const colorZero = attrf('colorZero');
227
229
  export const colorTickFormat = attrf('colorTickFormat');
@@ -236,6 +238,7 @@ export const opacityRange = attrf('opacityRange');
236
238
  export const opacityClamp = attrf('opacityClamp');
237
239
  export const opacityNice = attrf('opacityNice');
238
240
  export const opacityLabel = attrf('opacityLabel');
241
+ export const opacityPercent = attrf('opacityPercent');
239
242
  export const opacityReverse = attrf('opacityReverse');
240
243
  export const opacityZero = attrf('opacityZero');
241
244
  export const opacityTickFormat = attrf('opacityTickFormat');
@@ -243,12 +246,18 @@ export const opacityBase = attrf('opacityBase');
243
246
  export const opacityExponent = attrf('opacityExponent');
244
247
  export const opacityConstant = attrf('opacityConstant');
245
248
 
249
+ // symbol scale attributes
250
+ export const symbolScale = attrf('symbolScale');
251
+ export const symbolDomain = attrf('symbolDomain');
252
+ export const symbolRange = attrf('symbolRange');
253
+
246
254
  // r scale attributes
247
255
  export const rScale = attrf('rScale');
248
256
  export const rDomain = attrf('rDomain');
249
257
  export const rRange = attrf('rRange');
250
258
  export const rClamp = attrf('rClamp');
251
259
  export const rNice = attrf('rNice');
260
+ export const rPercent = attrf('rPercent');
252
261
  export const rZero = attrf('rZero');
253
262
  export const rBase = attrf('rBase');
254
263
  export const rExponent = attrf('rExponent');
@@ -260,6 +269,7 @@ export const lengthDomain = attrf('lengthDomain');
260
269
  export const lengthRange = attrf('lengthRange');
261
270
  export const lengthClamp = attrf('lengthClamp');
262
271
  export const lengthNice = attrf('lengthNice');
272
+ export const lengthPercent = attrf('lengthPercent');
263
273
  export const lengthZero = attrf('lengthZero');
264
274
  export const lengthBase = attrf('lengthBase');
265
275
  export const lengthExponent = attrf('lengthExponent');
@@ -19,6 +19,10 @@ export class NamedPlots extends Map {
19
19
  }
20
20
  return super.set(name, plot);
21
21
  }
22
+ clear() {
23
+ this.waiting?.clear();
24
+ return super.clear();
25
+ }
22
26
  }
23
27
 
24
28
  /**
package/src/plot/plot.js CHANGED
@@ -5,5 +5,6 @@ export function plot(...directives) {
5
5
  const p = new Plot();
6
6
  directives.flat().forEach(dir => dir(p));
7
7
  connect(this, ...p.marks); // this -> optional API context
8
+ p.update(); // request update, needed if no marks are defined
8
9
  return p.element;
9
10
  }