@uwdata/mosaic-spec 0.9.0 → 0.11.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/src/spec/Param.ts CHANGED
@@ -58,6 +58,20 @@ export interface Selection {
58
58
  * but not oneself (default `false`, except for `crossfilter` selections).
59
59
  */
60
60
  cross?: boolean;
61
+
62
+ /**
63
+ * A flag for setting an initial empty selection state. If true, a selection
64
+ * with no clauses corresponds to an empty selection with no records. If
65
+ * false, a selection with no clauses selects all values.
66
+ */
67
+ empty?: boolean;
68
+
69
+ /**
70
+ * Upstream selections whose clauses should be included as part of this
71
+ * selection. Any clauses or activations published to the upstream
72
+ * selections will be relayed to this selection.
73
+ */
74
+ include?: ParamRef | ParamRef[];
61
75
  }
62
76
 
63
77
  /** A Param or Selection definition. */
@@ -1556,6 +1556,13 @@ export interface PlotAttributes {
1556
1556
  */
1557
1557
  rNice?: boolean | number| Interval | ParamRef;
1558
1558
 
1559
+ /**
1560
+ * A textual label to show on the axis or legend; if null, show no label. By
1561
+ * default the scale label is inferred from channel definitions, possibly with
1562
+ * an arrow (↑, →, ↓, or ←) to indicate the direction of increasing value.
1563
+ */
1564
+ rLabel?: string | null | ParamRef;
1565
+
1559
1566
  /**
1560
1567
  * If true, shorthand for a transform suitable for percentages, mapping
1561
1568
  * proportions in [0, 1] to [0, 100].
package/src/spec/Spec.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { DataDefinition } from './Data.js';
2
- import { ParamDefinition } from './Param.js';
2
+ import { ParamDefinition, ParamRef } from './Param.js';
3
3
  import { HConcat } from './HConcat.js';
4
4
  import { VConcat } from './VConcat.js';
5
5
  import { HSpace } from './HSpace.js';
@@ -41,20 +41,58 @@ type Arg2Opt = Arg | [Arg, Arg?];
41
41
  */
42
42
  type Arg3Opt = Arg | [Arg, Arg?, Arg?];
43
43
 
44
- /** Bin transform options. */
45
- export interface BinOptions {
44
+ /** Binning interval names. */
45
+ export type BinInterval =
46
+ | 'date'
47
+ | 'number'
48
+ | 'millisecond'
49
+ | 'second'
50
+ | 'minute'
51
+ | 'hour'
52
+ | 'day'
53
+ | 'month'
54
+ | 'year';
55
+
56
+ /* A bin transform. */
57
+ export interface Bin {
58
+ /**
59
+ * Bin a continuous variable into discrete intervals. The bin argument
60
+ * specifies a data column or expression to bin. Both numerical and
61
+ * temporal (date/time) values are supported.
62
+ */
63
+ bin: Arg | [Arg];
64
+ /**
65
+ * The interval bin unit to use, typically used to indicate a date/time
66
+ * unit for binning temporal values, such as `hour`, `day`, or `month`.
67
+ * If `date`, the extent of data values is used to automatically select
68
+ * an interval for temporal data. The value `number` enforces normal
69
+ * numerical binning, even over temporal data. If unspecified, defaults
70
+ * to `number` for numerical data and `date` for temporal data.
71
+ */
72
+ interval?: BinInterval;
73
+ /**
74
+ * The step size to use between bins. When binning numerical values (or
75
+ * interval type `number`), this setting specifies the numerical step size.
76
+ * For data/time intervals, this indicates the number of steps of that unit,
77
+ * such as hours, days, or years.
78
+ */
79
+ step?: number;
46
80
  /**
47
81
  * The target number of binning steps to use. To accommodate human-friendly
48
- * bin boundaries, the actual number of bins may diverge from this exact number.
82
+ * ("nice") bin boundaries, the actual number of bins may diverge from this
83
+ * exact value. This option is ignored when **step** is specified.
49
84
  */
50
85
  steps?: number;
51
86
  /**
52
- * The minimum allowed bin step size (default `0`).
53
- * For example, a setting of `1` will prevent step sizes less than 1.
87
+ * The minimum allowed bin step size (default `0`) when performing numerical
88
+ * binning. For example, a setting of `1` prevents step sizes less than 1.
89
+ * This option is ignored when **step** is specified.
54
90
  */
55
91
  minstep?: number;
56
92
  /**
57
- * A flag requesting "nice" human-friendly step sizes (default `true`).
93
+ * A flag (default `true`) requesting "nice" human-friendly end points and
94
+ * step sizes when performing numerical binning. When **step** is specified,
95
+ * this option affects the binning end points (e.g., origin) only.
58
96
  */
59
97
  nice?: true;
60
98
  /**
@@ -64,15 +102,6 @@ export interface BinOptions {
64
102
  offset?: number;
65
103
  }
66
104
 
67
- /* A bin transform. */
68
- export interface Bin {
69
- /**
70
- * Bin a continuous variable into discrete intervals. This transform accepts
71
- * a data column to bin over as well as an optional bin options object.
72
- */
73
- bin: Arg | [Arg] | [Arg, BinOptions];
74
- }
75
-
76
105
  /* A dateMonth transform. */
77
106
  export interface DateMonth {
78
107
  /**