@uwdata/mosaic-spec 0.11.0 → 0.12.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 (37) hide show
  1. package/dist/mosaic-schema.json +2105 -422
  2. package/dist/mosaic-spec.js +4108 -2629
  3. package/dist/mosaic-spec.min.js +24 -24
  4. package/dist/types/ast/ColumnParamRefNode.d.ts +8 -0
  5. package/dist/types/ast/ExpressionNode.d.ts +2 -4
  6. package/dist/types/constants.d.ts +1 -1
  7. package/dist/types/spec/Input.d.ts +1 -1
  8. package/dist/types/spec/PlotAttribute.d.ts +11 -5
  9. package/dist/types/spec/PlotFrom.d.ts +1 -1
  10. package/dist/types/spec/PlotInteractor.d.ts +2 -1
  11. package/dist/types/spec/Transform.d.ts +8 -2
  12. package/dist/types/spec/interactors/BrushStyles.d.ts +27 -0
  13. package/dist/types/spec/interactors/Interval1D.d.ts +6 -27
  14. package/dist/types/spec/interactors/Interval2D.d.ts +6 -5
  15. package/dist/types/spec/interactors/Region.d.ts +32 -0
  16. package/dist/types/spec/interactors/Toggle.d.ts +3 -3
  17. package/dist/types/spec/marks/Marks.d.ts +5 -0
  18. package/package.json +6 -6
  19. package/src/ast/ColumnParamRefNode.js +21 -0
  20. package/src/ast/DataNode.js +3 -3
  21. package/src/ast/ExpressionNode.js +17 -22
  22. package/src/ast/PlotFromNode.js +6 -6
  23. package/src/ast/PlotMarkNode.js +2 -2
  24. package/src/ast/TransformNode.js +14 -12
  25. package/src/config/transforms.js +1 -0
  26. package/src/constants.js +1 -1
  27. package/src/spec/Input.ts +1 -1
  28. package/src/spec/PlotAttribute.ts +13 -5
  29. package/src/spec/PlotFrom.ts +1 -1
  30. package/src/spec/PlotInteractor.ts +7 -5
  31. package/src/spec/Transform.ts +10 -1
  32. package/src/spec/interactors/BrushStyles.ts +27 -0
  33. package/src/spec/interactors/Interval1D.ts +6 -28
  34. package/src/spec/interactors/Interval2D.ts +6 -5
  35. package/src/spec/interactors/Region.ts +34 -0
  36. package/src/spec/interactors/Toggle.ts +3 -3
  37. package/src/spec/marks/Marks.ts +6 -0
@@ -3,6 +3,7 @@ import { IntervalX, IntervalY } from './interactors/Interval1D.js';
3
3
  import { IntervalXY } from './interactors/Interval2D.js';
4
4
  import { NearestX, NearestY } from './interactors/Nearest.js';
5
5
  import { Pan, PanX, PanY, PanZoom, PanZoomX, PanZoomY } from './interactors/PanZoom.js';
6
+ import { Region } from './interactors/Region.js';
6
7
  import { Toggle, ToggleColor, ToggleX, ToggleY } from './interactors/Toggle.js';
7
8
 
8
9
  /** A plot interactor entry. */
@@ -13,13 +14,14 @@ export type PlotInteractor =
13
14
  | IntervalXY
14
15
  | NearestX
15
16
  | NearestY
16
- | Toggle
17
- | ToggleX
18
- | ToggleY
19
- | ToggleColor
20
17
  | Pan
21
18
  | PanX
22
19
  | PanY
23
20
  | PanZoom
24
21
  | PanZoomX
25
- | PanZoomY;
22
+ | PanZoomY
23
+ | Region
24
+ | Toggle
25
+ | ToggleX
26
+ | ToggleY
27
+ | ToggleColor;
@@ -17,7 +17,7 @@ export interface AggregateOptions {
17
17
  }
18
18
 
19
19
  /** A transform argument. */
20
- type Arg = string | number | boolean;
20
+ type Arg = string | number | boolean | ParamRef;
21
21
 
22
22
  /** A zero argument transform signature. */
23
23
  type Arg0 = null | [];
@@ -102,6 +102,14 @@ export interface Bin {
102
102
  offset?: number;
103
103
  }
104
104
 
105
+ /* A column transform. */
106
+ export interface Column {
107
+ /**
108
+ * Intpret a string or param-value as a column reference.
109
+ */
110
+ column: Arg1;
111
+ }
112
+
105
113
  /* A dateMonth transform. */
106
114
  export interface DateMonth {
107
115
  /**
@@ -423,6 +431,7 @@ export interface NthValue extends WindowOptions {
423
431
  /** A data transform that maps one column value to another. */
424
432
  export type ColumnTransform =
425
433
  | Bin
434
+ | Column
426
435
  | DateMonth
427
436
  | DateMonthDay
428
437
  | DateDay
@@ -0,0 +1,27 @@
1
+ /** Styles for rectangular selection brushes. */
2
+ export interface BrushStyles {
3
+ /**
4
+ * The overall opacity of the brush rectangle.
5
+ */
6
+ opacity?: number;
7
+ /**
8
+ * The fill opacity of the brush rectangle.
9
+ */
10
+ fillOpacity?: number;
11
+ /**
12
+ * The stroke opacity of the brush rectangle.
13
+ */
14
+ strokeOpacity?: number;
15
+ /**
16
+ * The fill color of the brush rectangle.
17
+ */
18
+ fill?: string;
19
+ /**
20
+ * The stroke color of the brush rectangle.
21
+ */
22
+ stroke?: string;
23
+ /**
24
+ * The stroke dash array of the brush rectangle.
25
+ */
26
+ strokeDasharray?: string;
27
+ }
@@ -1,28 +1,5 @@
1
1
  import { ParamRef } from '../Param.js';
2
-
3
- /** Styles for rectangular selection brushes. */
4
- export interface BrushStyles {
5
- /**
6
- * The overall opacity of the brush rectangle.
7
- */
8
- opacity?: number;
9
- /**
10
- * The fill opacity of the brush rectangle.
11
- */
12
- fillOpacity?: number;
13
- /**
14
- * The stroke opacity of the brush rectangle.
15
- */
16
- strokeOpacity?: number;
17
- /**
18
- * The fill color of the brush rectangle.
19
- */
20
- fill?: string;
21
- /**
22
- * The stroke color of the brush rectangle.
23
- */
24
- stroke?: string;
25
- }
2
+ import { BrushStyles } from './BrushStyles.js';
26
3
 
27
4
  /** Options for 1D interval interactors. */
28
5
  export interface Interval1DOptions {
@@ -39,13 +16,14 @@ export interface Interval1DOptions {
39
16
  field?: string;
40
17
  /**
41
18
  * The size of an interative pixel (default `1`). Larger pixel sizes reduce
42
- * the brush resolution, which can reduce the size of data cube indexes.
19
+ * the brush resolution, which can reduce the size of pre-aggregated
20
+ * materialized views.
43
21
  */
44
22
  pixelSize?: number;
45
23
  /**
46
- * A flag indicating if peer (sibling) marks are when cross-filtering
47
- * (default `true`). If set, peer marks will not be filtered by this
48
- * interactor's selection in cross-filtering setups.
24
+ * A flag indicating if peer (sibling) marks are excluded when
25
+ * cross-filtering (default `true`). If set, peer marks will not be
26
+ * filtered by this interactor's selection in cross-filtering setups.
49
27
  */
50
28
  peers?: boolean;
51
29
  /**
@@ -1,5 +1,5 @@
1
1
  import { ParamRef } from '../Param.js';
2
- import { BrushStyles } from './Interval1D.js';
2
+ import { BrushStyles } from './BrushStyles.js';
3
3
 
4
4
  /** Options for 2D interval interactors. */
5
5
  export interface Interval2DOptions {
@@ -23,13 +23,14 @@ export interface Interval2DOptions {
23
23
  yfield?: string;
24
24
  /**
25
25
  * The size of an interative pixel (default `1`). Larger pixel sizes reduce
26
- * the brush resolution, which can reduce the size of data cube indexes.
26
+ * the brush resolution, which can reduce the size of pre-aggregated
27
+ * materialized views.
27
28
  */
28
29
  pixelSize?: number;
29
30
  /**
30
- * A flag indicating if peer (sibling) marks are when cross-filtering
31
- * (default `true`). If set, peer marks will not be filtered by this
32
- * interactor's selection in cross-filtering setups.
31
+ * A flag indicating if peer (sibling) marks are excluded when
32
+ * cross-filtering (default `true`). If set, peer marks will not be
33
+ * filtered by this interactor's selection in cross-filtering setups.
33
34
  */
34
35
  peers?: boolean;
35
36
  /**
@@ -0,0 +1,34 @@
1
+ import { ParamRef } from '../Param.js';
2
+ import { BrushStyles } from './BrushStyles.js';
3
+
4
+ /** Options for region interactors. */
5
+ export interface RegionOptions {
6
+ /**
7
+ * The output selection. A clause of the form
8
+ * `(field = value1) OR (field = value2) ...`
9
+ * is added for the currently selected values.
10
+ */
11
+ as: ParamRef;
12
+ /**
13
+ * The encoding channels over which to select values.
14
+ * For a selected mark, selection clauses will cover
15
+ * the backing data fields for each channel.
16
+ */
17
+ channels: string[];
18
+ /**
19
+ * A flag indicating if peer (sibling) marks are excluded when
20
+ * cross-filtering (default `true`). If set, peer marks will not be
21
+ * filtered by this interactor's selection in cross-filtering setups.
22
+ */
23
+ peers?: boolean;
24
+ /**
25
+ * CSS styles for the brush (SVG `rect`) element.
26
+ */
27
+ brush?: BrushStyles;
28
+ }
29
+
30
+ /** A rectangular region interactor. */
31
+ export interface Region extends RegionOptions {
32
+ /** Select aspects of individual marks within a 2D range. */
33
+ select: 'region';
34
+ }
@@ -9,9 +9,9 @@ export interface ToggleOptions {
9
9
  */
10
10
  as: ParamRef;
11
11
  /**
12
- * A flag indicating if peer (sibling) marks are when cross-filtering
13
- * (default `true`). If set, peer marks will not be filtered by this
14
- * interactor's selection in cross-filtering setups.
12
+ * A flag indicating if peer (sibling) marks are excluded when
13
+ * cross-filtering (default `true`). If set, peer marks will not be
14
+ * filtered by this interactor's selection in cross-filtering setups.
15
15
  */
16
16
  peers?: boolean;
17
17
  }
@@ -432,6 +432,12 @@ export interface MarkOptions {
432
432
  | (TipOptions & { pointer?: TipPointer })
433
433
  | ParamRef;
434
434
 
435
+ /**
436
+ * Additional named channels, for example to include in a tooltip.
437
+ * Consists of (channel name, data field name) key-value pairs.
438
+ */
439
+ channels?: Record<string, string>;
440
+
435
441
  /**
436
442
  * How to clip the mark; one of:
437
443
  *