@uwdata/mosaic-spec 0.17.0 → 0.19.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 (191) hide show
  1. package/LICENSE +47 -0
  2. package/README.md +1 -1
  3. package/dist/mosaic-schema.json +201110 -0
  4. package/dist/src/ast/ASTNode.d.ts +27 -0
  5. package/dist/src/ast/ASTNode.d.ts.map +1 -0
  6. package/dist/src/ast/ColumnParamRefNode.d.ts +9 -0
  7. package/dist/src/ast/ColumnParamRefNode.d.ts.map +1 -0
  8. package/dist/src/ast/DataNode.d.ts +61 -0
  9. package/dist/src/ast/DataNode.d.ts.map +1 -0
  10. package/dist/src/ast/ExpressionNode.d.ts +14 -0
  11. package/dist/src/ast/ExpressionNode.d.ts.map +1 -0
  12. package/dist/src/ast/HConcatNode.d.ts +11 -0
  13. package/dist/src/ast/HConcatNode.d.ts.map +1 -0
  14. package/dist/src/ast/HSpaceNode.d.ts +12 -0
  15. package/dist/src/ast/HSpaceNode.d.ts.map +1 -0
  16. package/dist/src/ast/InputNode.d.ts +9 -0
  17. package/dist/src/ast/InputNode.d.ts.map +1 -0
  18. package/dist/src/ast/LiteralNode.d.ts +8 -0
  19. package/dist/src/ast/LiteralNode.d.ts.map +1 -0
  20. package/dist/src/ast/OptionsNode.d.ts +11 -0
  21. package/dist/src/ast/OptionsNode.d.ts.map +1 -0
  22. package/dist/src/ast/ParamNode.d.ts +9 -0
  23. package/dist/src/ast/ParamNode.d.ts.map +1 -0
  24. package/dist/src/ast/ParamRefNode.d.ts +9 -0
  25. package/dist/src/ast/ParamRefNode.d.ts.map +1 -0
  26. package/dist/src/ast/PlotAttributeNode.d.ts +19 -0
  27. package/dist/src/ast/PlotAttributeNode.d.ts.map +1 -0
  28. package/dist/src/ast/PlotFromNode.d.ts +10 -0
  29. package/dist/src/ast/PlotFromNode.d.ts.map +1 -0
  30. package/dist/src/ast/PlotInteractorNode.d.ts +9 -0
  31. package/dist/src/ast/PlotInteractorNode.d.ts.map +1 -0
  32. package/dist/src/ast/PlotLegendNode.d.ts +11 -0
  33. package/dist/src/ast/PlotLegendNode.d.ts.map +1 -0
  34. package/dist/src/ast/PlotMarkNode.d.ts +11 -0
  35. package/dist/src/ast/PlotMarkNode.d.ts.map +1 -0
  36. package/dist/src/ast/PlotNode.d.ts +12 -0
  37. package/dist/src/ast/PlotNode.d.ts.map +1 -0
  38. package/dist/src/ast/SelectionNode.d.ts +25 -0
  39. package/dist/src/ast/SelectionNode.d.ts.map +1 -0
  40. package/dist/src/ast/SpecNode.d.ts +11 -0
  41. package/dist/src/ast/SpecNode.d.ts.map +1 -0
  42. package/dist/src/ast/TransformNode.d.ts +22 -0
  43. package/dist/src/ast/TransformNode.d.ts.map +1 -0
  44. package/dist/src/ast/VConcatNode.d.ts +11 -0
  45. package/dist/src/ast/VConcatNode.d.ts.map +1 -0
  46. package/dist/src/ast/VSpaceNode.d.ts +12 -0
  47. package/dist/src/ast/VSpaceNode.d.ts.map +1 -0
  48. package/dist/src/ast/WindowFrameNode.d.ts +16 -0
  49. package/dist/src/ast/WindowFrameNode.d.ts.map +1 -0
  50. package/dist/src/ast-to-dom.d.ts +41 -0
  51. package/dist/src/ast-to-dom.d.ts.map +1 -0
  52. package/dist/src/ast-to-esm.d.ts +65 -0
  53. package/dist/src/ast-to-esm.d.ts.map +1 -0
  54. package/dist/src/config/components.d.ts +5 -0
  55. package/dist/src/config/components.d.ts.map +1 -0
  56. package/dist/src/config/extensions.d.ts +10 -0
  57. package/dist/src/config/extensions.d.ts.map +1 -0
  58. package/dist/src/config/inputs.d.ts +6 -0
  59. package/dist/src/config/inputs.d.ts.map +1 -0
  60. package/dist/src/config/plots.d.ts +35 -0
  61. package/dist/src/config/plots.d.ts.map +1 -0
  62. package/dist/src/config/transforms.d.ts +5 -0
  63. package/dist/src/config/transforms.d.ts.map +1 -0
  64. package/dist/src/constants.d.ts +33 -0
  65. package/dist/src/constants.d.ts.map +1 -0
  66. package/dist/src/index.d.ts +30 -0
  67. package/dist/src/index.d.ts.map +1 -0
  68. package/dist/src/parse-spec.d.ts +112 -0
  69. package/dist/src/parse-spec.d.ts.map +1 -0
  70. package/dist/src/spec/CSSStyles.d.ts +4 -0
  71. package/dist/src/spec/CSSStyles.d.ts.map +1 -0
  72. package/dist/src/spec/Data.d.ts +166 -0
  73. package/dist/src/spec/Data.d.ts.map +1 -0
  74. package/dist/src/spec/Expression.d.ts +28 -0
  75. package/dist/src/spec/Expression.d.ts.map +1 -0
  76. package/dist/src/spec/HConcat.d.ts +9 -0
  77. package/dist/src/spec/HConcat.d.ts.map +1 -0
  78. package/dist/src/spec/HSpace.d.ts +10 -0
  79. package/dist/src/spec/HSpace.d.ts.map +1 -0
  80. package/dist/src/spec/Input.d.ts +218 -0
  81. package/dist/src/spec/Input.d.ts.map +1 -0
  82. package/dist/src/spec/Interval.d.ts +59 -0
  83. package/dist/src/spec/Interval.d.ts.map +1 -0
  84. package/dist/src/spec/Param.d.ts +64 -0
  85. package/dist/src/spec/Param.d.ts.map +1 -0
  86. package/dist/src/spec/Plot.d.ts +15 -0
  87. package/dist/src/spec/Plot.d.ts.map +1 -0
  88. package/dist/src/spec/PlotAttribute.d.ts +1535 -0
  89. package/dist/src/spec/PlotAttribute.d.ts.map +1 -0
  90. package/dist/src/spec/PlotFrom.d.ts +21 -0
  91. package/dist/src/spec/PlotFrom.d.ts.map +1 -0
  92. package/dist/src/spec/PlotInteractor.d.ts +10 -0
  93. package/dist/src/spec/PlotInteractor.d.ts.map +1 -0
  94. package/dist/src/spec/PlotLegend.d.ts +69 -0
  95. package/dist/src/spec/PlotLegend.d.ts.map +1 -0
  96. package/dist/src/spec/PlotMark.d.ts +29 -0
  97. package/dist/src/spec/PlotMark.d.ts.map +1 -0
  98. package/dist/src/spec/PlotTypes.d.ts +294 -0
  99. package/dist/src/spec/PlotTypes.d.ts.map +1 -0
  100. package/dist/src/spec/Spec.d.ts +53 -0
  101. package/dist/src/spec/Spec.d.ts.map +1 -0
  102. package/dist/src/spec/Transform.d.ts +393 -0
  103. package/dist/src/spec/Transform.d.ts.map +1 -0
  104. package/dist/src/spec/VConcat.d.ts +9 -0
  105. package/dist/src/spec/VConcat.d.ts.map +1 -0
  106. package/dist/src/spec/VSpace.d.ts +10 -0
  107. package/dist/src/spec/VSpace.d.ts.map +1 -0
  108. package/dist/src/spec/interactors/BrushStyles.d.ts +28 -0
  109. package/dist/src/spec/interactors/BrushStyles.d.ts.map +1 -0
  110. package/dist/src/spec/interactors/Highlight.d.ts +38 -0
  111. package/dist/src/spec/interactors/Highlight.d.ts.map +1 -0
  112. package/dist/src/spec/interactors/Interval1D.d.ts +43 -0
  113. package/dist/src/spec/interactors/Interval1D.d.ts.map +1 -0
  114. package/dist/src/spec/interactors/Interval2D.d.ts +48 -0
  115. package/dist/src/spec/interactors/Interval2D.d.ts.map +1 -0
  116. package/dist/src/spec/interactors/Nearest.d.ts +45 -0
  117. package/dist/src/spec/interactors/Nearest.d.ts.map +1 -0
  118. package/dist/src/spec/interactors/PanZoom.d.ts +59 -0
  119. package/dist/src/spec/interactors/PanZoom.d.ts.map +1 -0
  120. package/dist/src/spec/interactors/Region.d.ts +33 -0
  121. package/dist/src/spec/interactors/Region.d.ts.map +1 -0
  122. package/dist/src/spec/interactors/Toggle.d.ts +60 -0
  123. package/dist/src/spec/interactors/Toggle.d.ts.map +1 -0
  124. package/dist/src/spec/marks/Area.d.ts +140 -0
  125. package/dist/src/spec/marks/Area.d.ts.map +1 -0
  126. package/dist/src/spec/marks/Arrow.d.ts +95 -0
  127. package/dist/src/spec/marks/Arrow.d.ts.map +1 -0
  128. package/dist/src/spec/marks/Axis.d.ts +282 -0
  129. package/dist/src/spec/marks/Axis.d.ts.map +1 -0
  130. package/dist/src/spec/marks/Bar.d.ts +151 -0
  131. package/dist/src/spec/marks/Bar.d.ts.map +1 -0
  132. package/dist/src/spec/marks/Cell.d.ts +58 -0
  133. package/dist/src/spec/marks/Cell.d.ts.map +1 -0
  134. package/dist/src/spec/marks/Contour.d.ts +24 -0
  135. package/dist/src/spec/marks/Contour.d.ts.map +1 -0
  136. package/dist/src/spec/marks/Delaunay.d.ts +87 -0
  137. package/dist/src/spec/marks/Delaunay.d.ts.map +1 -0
  138. package/dist/src/spec/marks/DenseLine.d.ts +28 -0
  139. package/dist/src/spec/marks/DenseLine.d.ts.map +1 -0
  140. package/dist/src/spec/marks/Density.d.ts +137 -0
  141. package/dist/src/spec/marks/Density.d.ts.map +1 -0
  142. package/dist/src/spec/marks/Dot.d.ts +134 -0
  143. package/dist/src/spec/marks/Dot.d.ts.map +1 -0
  144. package/dist/src/spec/marks/ErrorBar.d.ts +83 -0
  145. package/dist/src/spec/marks/ErrorBar.d.ts.map +1 -0
  146. package/dist/src/spec/marks/Frame.d.ts +22 -0
  147. package/dist/src/spec/marks/Frame.d.ts.map +1 -0
  148. package/dist/src/spec/marks/Geo.d.ts +54 -0
  149. package/dist/src/spec/marks/Geo.d.ts.map +1 -0
  150. package/dist/src/spec/marks/Hexbin.d.ts +31 -0
  151. package/dist/src/spec/marks/Hexbin.d.ts.map +1 -0
  152. package/dist/src/spec/marks/Hexgrid.d.ts +26 -0
  153. package/dist/src/spec/marks/Hexgrid.d.ts.map +1 -0
  154. package/dist/src/spec/marks/Image.d.ts +90 -0
  155. package/dist/src/spec/marks/Image.d.ts.map +1 -0
  156. package/dist/src/spec/marks/Line.d.ts +83 -0
  157. package/dist/src/spec/marks/Line.d.ts.map +1 -0
  158. package/dist/src/spec/marks/Link.d.ts +61 -0
  159. package/dist/src/spec/marks/Link.d.ts.map +1 -0
  160. package/dist/src/spec/marks/Marks.d.ts +911 -0
  161. package/dist/src/spec/marks/Marks.d.ts.map +1 -0
  162. package/dist/src/spec/marks/Raster.d.ts +125 -0
  163. package/dist/src/spec/marks/Raster.d.ts.map +1 -0
  164. package/dist/src/spec/marks/Rect.d.ts +167 -0
  165. package/dist/src/spec/marks/Rect.d.ts.map +1 -0
  166. package/dist/src/spec/marks/Regression.d.ts +59 -0
  167. package/dist/src/spec/marks/Regression.d.ts.map +1 -0
  168. package/dist/src/spec/marks/Rule.d.ts +101 -0
  169. package/dist/src/spec/marks/Rule.d.ts.map +1 -0
  170. package/dist/src/spec/marks/Text.d.ts +111 -0
  171. package/dist/src/spec/marks/Text.d.ts.map +1 -0
  172. package/dist/src/spec/marks/Tick.d.ts +62 -0
  173. package/dist/src/spec/marks/Tick.d.ts.map +1 -0
  174. package/dist/src/spec/marks/Vector.d.ts +100 -0
  175. package/dist/src/spec/marks/Vector.d.ts.map +1 -0
  176. package/dist/src/spec/marks/Waffle.d.ts +59 -0
  177. package/dist/src/spec/marks/Waffle.d.ts.map +1 -0
  178. package/dist/src/util.d.ts +13 -0
  179. package/dist/src/util.d.ts.map +1 -0
  180. package/package.json +18 -10
  181. package/src/spec/Data.ts +2 -2
  182. package/src/spec/Expression.ts +1 -1
  183. package/src/spec/Input.ts +6 -1
  184. package/src/spec/Spec.ts +1 -1
  185. package/src/spec/Transform.ts +3 -3
  186. package/src/spec/interactors/Interval1D.ts +1 -1
  187. package/src/spec/interactors/Interval2D.ts +1 -1
  188. package/src/spec/interactors/Toggle.ts +5 -5
  189. package/src/spec/marks/ErrorBar.ts +2 -2
  190. package/tsconfig.json +0 -13
  191. package/vitest.config.ts +0 -3
@@ -0,0 +1,62 @@
1
+ import { ChannelValueSpec, InsetOptions, MarkData, MarkOptions, MarkerOptions } from './Marks.js';
2
+ /** Options for the tickX mark. */
3
+ export interface TickXOptions extends MarkOptions, MarkerOptions, Omit<InsetOptions, 'insetLeft' | 'insetRight'> {
4
+ /**
5
+ * The required horizontal position of the tick; a channel typically bound to
6
+ * the *x* scale.
7
+ */
8
+ x?: ChannelValueSpec;
9
+ /**
10
+ * The optional vertical position of the tick; an ordinal channel typically
11
+ * bound to the *y* scale. If not specified, the tick spans the vertical
12
+ * extent of the frame; otherwise the *y* scale must be a *band* scale.
13
+ *
14
+ * If *y* represents quantitative or temporal values, use a ruleX mark
15
+ * instead.
16
+ */
17
+ y?: ChannelValueSpec;
18
+ }
19
+ /** Options for the tickY mark. */
20
+ export interface TickYOptions extends MarkOptions, MarkerOptions, Omit<InsetOptions, 'insetTop' | 'insetBottom'> {
21
+ /**
22
+ * The required vertical position of the tick; a channel typically bound to
23
+ * the *y* scale.
24
+ */
25
+ y?: ChannelValueSpec;
26
+ /**
27
+ * The optional horizontal position of the tick; an ordinal channel typically
28
+ * bound to the *x* scale. If not specified, the tick spans the horizontal
29
+ * extent of the frame; otherwise the *x* scale must be a *band* scale.
30
+ *
31
+ * If *x* represents quantitative or temporal values, use a ruleY mark
32
+ * instead.
33
+ */
34
+ x?: ChannelValueSpec;
35
+ }
36
+ /** The tickX mark. */
37
+ export interface TickX extends MarkData, TickXOptions {
38
+ /**
39
+ * A horizontally-positioned tickX mark (a vertical line, |). The **x**
40
+ * channel specifies the tick’s horizontal position and defaults to identity,
41
+ * assuming that *data* = [*x₀*, *x₁*, *x₂*, …]; the optional **y** ordinal
42
+ * channel specifies its vertical position.
43
+ *
44
+ * If *y* represents quantitative or temporal values, use a ruleX mark
45
+ * instead.
46
+ */
47
+ mark: 'tickX';
48
+ }
49
+ /** The tickY mark. */
50
+ export interface TickY extends MarkData, TickYOptions {
51
+ /**
52
+ * A vertically-positioned tickY mark (a horizontal line, —). The **y**
53
+ * channel specifies the tick's vertical position and defaults to identity,
54
+ * assuming that *data* = [*y₀*, *y₁*, *y₂*, …]; the optional **x** ordinal
55
+ * channel specifies its horizontal position.
56
+ *
57
+ * If *x* represents quantitative or temporal values, use a ruleY mark
58
+ * instead.
59
+ */
60
+ mark: 'tickY';
61
+ }
62
+ //# sourceMappingURL=Tick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tick.d.ts","sourceRoot":"","sources":["../../../../src/spec/marks/Tick.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EACrE,MAAM,YAAY,CAAC;AAEpB,kCAAkC;AAClC,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,aAAa,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,YAAY,CAAC;IAC9G;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAErB;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;CACtB;AAED,kCAAkC;AAClC,MAAM,WAAW,YAAa,SAAQ,WAAW,EAAE,aAAa,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,aAAa,CAAC;IAC9G;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAErB;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;CACtB;AAED,sBAAsB;AACtB,MAAM,WAAW,KAAM,SAAQ,QAAQ,EAAE,YAAY;IACnD;;;;;;;;OAQG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAED,sBAAsB;AACtB,MAAM,WAAW,KAAM,SAAQ,QAAQ,EAAE,YAAY;IACnD;;;;;;;;OAQG;IACH,IAAI,EAAE,OAAO,CAAC;CACf"}
@@ -0,0 +1,100 @@
1
+ import { ParamRef } from '../Param.js';
2
+ import { FrameAnchor } from '../PlotTypes.js';
3
+ import { ChannelValue, ChannelValueSpec, MarkData, MarkOptions } from './Marks.js';
4
+ /**
5
+ * The built-in vector shape implementations; one of:
6
+ *
7
+ * - *arrow* - a straight line with an open arrowhead at the end (↑)
8
+ * - *spike* - an isosceles triangle with a flat base (▲)
9
+ */
10
+ export type VectorShapeName = 'arrow' | 'spike';
11
+ /** How to draw a vector: either a named shape or a custom implementation. */
12
+ export type VectorShape = VectorShapeName;
13
+ /** Options for the vector mark. */
14
+ export interface VectorOptions extends MarkOptions {
15
+ /**
16
+ * The horizontal position of the vector’s anchor point; an optional channel
17
+ * bound to the *x* scale. Default depends on the **frameAnchor**.
18
+ */
19
+ x?: ChannelValueSpec;
20
+ /**
21
+ * The vertical position of the vector’s anchor point; an optional channel
22
+ * bound to the *y* scale. Default depends on the **frameAnchor**.
23
+ */
24
+ y?: ChannelValueSpec;
25
+ /**
26
+ * The vector shape’s radius, such as half the width of the *arrow*’s head or
27
+ * the *spike*’s base; a constant number in pixels. Defaults to 3.5 pixels.
28
+ */
29
+ r?: number | ParamRef;
30
+ /**
31
+ * The vector’s length; either an optional channel bound to the *length* scale
32
+ * or a constant number in pixels. Defaults to 12 pixels.
33
+ */
34
+ length?: ChannelValueSpec;
35
+ /**
36
+ * The vector’s orientation (rotation angle); either a constant number in
37
+ * degrees clockwise, or an optional channel (with no associated scale).
38
+ * Defaults to 0 degrees with the vector pointing up.
39
+ */
40
+ rotate?: ChannelValue;
41
+ /** The shape of the vector; a constant. Defaults to *arrow*. */
42
+ shape?: VectorShape | ParamRef;
43
+ /**
44
+ * The vector’s position along its orientation relative to its anchor point; a
45
+ * constant. Assuming a default **rotate** angle of 0°, one of:
46
+ *
47
+ * - *start* - from [*x*, *y*] to [*x*, *y* - *l*]
48
+ * - *middle* (default) - from [*x*, *y* + *l* / 2] to [*x*, *y* - *l* / 2]
49
+ * - *end* - from [*x*, *y* + *l*] to [*x*, *y*]
50
+ *
51
+ * where [*x*, *y*] is the vector’s anchor point and *l* is the vector’s
52
+ * (possibly scaled) length in pixels.
53
+ */
54
+ anchor?: 'start' | 'middle' | 'end' | ParamRef;
55
+ /**
56
+ * The vector’s frame anchor, to default **x** and **y** relative to the
57
+ * frame; a constant representing one of the frame corners (*top-left*,
58
+ * *top-right*, *bottom-right*, *bottom-left*), sides (*top*, *right*,
59
+ * *bottom*, *left*), or *middle* (default). Has no effect if both **x**
60
+ * and **y** are specified.
61
+ */
62
+ frameAnchor?: FrameAnchor | ParamRef;
63
+ }
64
+ /** The vector mark. */
65
+ export interface Vector extends MarkData, VectorOptions {
66
+ /**
67
+ * A vector mark.
68
+ *
69
+ * If none of **frameAnchor**, **x**, and **y** are specified, then **x** and
70
+ * **y** default to accessors assuming that *data* contains tuples [[*x₀*,
71
+ * *y₀*], [*x₁*, *y₁*], [*x₂*, *y₂*], …]
72
+ */
73
+ mark: 'vector';
74
+ }
75
+ /** The vectorX mark. */
76
+ export interface VectorX extends MarkData, VectorOptions {
77
+ /**
78
+ * Like vector, but **x** instead defaults to the identity function and **y**
79
+ * defaults to null, assuming that *data* is an array of numbers [*x₀*, *x₁*,
80
+ * *x₂*, …].
81
+ */
82
+ mark: 'vectorX';
83
+ }
84
+ /** The vectorY mark. */
85
+ export interface VectorY extends MarkData, VectorOptions {
86
+ /**
87
+ * Like vector, but **y** instead defaults to the identity function and **x**
88
+ * defaults to null, assuming that *data* is an array of numbers [*y₀*, *y₁*,
89
+ * *y₂*, …].
90
+ */
91
+ mark: 'vectorY';
92
+ }
93
+ /** The spike mark. */
94
+ export interface Spike extends MarkData, VectorOptions {
95
+ /**
96
+ * Like vector, but with default *options* suitable for drawing a spike map.
97
+ */
98
+ mark: 'spike';
99
+ }
100
+ //# sourceMappingURL=Vector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Vector.d.ts","sourceRoot":"","sources":["../../../../src/spec/marks/Vector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,CAAC;AAEhD,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAE1C,mCAAmC;AACnC,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAErB;;;OAGG;IACH,CAAC,CAAC,EAAE,gBAAgB,CAAC;IAErB;;;OAGG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAEtB;;;OAGG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;OAIG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,gEAAgE;IAChE,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IAE/B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,CAAC;IAE/C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;CACtC;AAED,uBAAuB;AACvB,MAAM,WAAW,MAAO,SAAQ,QAAQ,EAAE,aAAa;IACrD;;;;;;OAMG;IACH,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,wBAAwB;AACxB,MAAM,WAAW,OAAQ,SAAQ,QAAQ,EAAE,aAAa;IACtD;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wBAAwB;AACxB,MAAM,WAAW,OAAQ,SAAQ,QAAQ,EAAE,aAAa;IACtD;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,sBAAsB;AACtB,MAAM,WAAW,KAAM,SAAQ,QAAQ,EAAE,aAAa;IACpD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;CACf"}
@@ -0,0 +1,59 @@
1
+ import { ParamRef } from '../Param.js';
2
+ import { BarXOptions, BarYOptions } from './Bar.js';
3
+ import { MarkData } from './Marks.js';
4
+ /** Options for the waffleX and waffleY mark. */
5
+ export interface WaffleOptions {
6
+ /** The number of cells per row or column; defaults to undefined for automatic. */
7
+ multiple?: number | ParamRef;
8
+ /** The quantity each cell represents; defaults to 1. */
9
+ unit?: number | ParamRef;
10
+ /** The gap in pixels between cells; defaults to 1. */
11
+ gap?: number | ParamRef;
12
+ /** If true, round to integers to avoid partial cells. */
13
+ round?: boolean | ParamRef;
14
+ }
15
+ /** The waffleX mark. */
16
+ export interface WaffleX extends MarkData, BarXOptions, WaffleOptions {
17
+ /**
18
+ * A horizontal waffle mark. The required *x* values should be quantitative,
19
+ * and the optional *y* values should be ordinal.
20
+ *
21
+ * If neither **x1** nor **x2** nor **interval** is specified, an implicit
22
+ * stackX transform is applied and **x** defaults to the identity function,
23
+ * assuming that *data* = [*x₀*, *x₁*, *x₂*, …]. Otherwise if an **interval**
24
+ * is specified, then **x1** and **x2** are derived from **x**, representing
25
+ * the lower and upper bound of the containing interval, respectively.
26
+ * Otherwise, if only one of **x1** or **x2** is specified, the other
27
+ * defaults to **x**, which defaults to zero.
28
+ *
29
+ * The optional **y** ordinal channel specifies the vertical position; it is
30
+ * typically bound to the *y* scale, which must be a *band* scale. If the
31
+ * **y** channel is not specified, the bar will span the vertical extent of
32
+ * the plot’s frame. Because a waffle represents a discrete number of square
33
+ * cells, it may not use all of the available bandwidth.
34
+ */
35
+ mark: 'waffleX';
36
+ }
37
+ /** The waffleY mark. */
38
+ export interface WaffleY extends MarkData, BarYOptions, WaffleOptions {
39
+ /**
40
+ * A vertical waffle mark. The required *y* values should be quantitative,
41
+ * and the optional *x* values should be ordinal.
42
+ *
43
+ * If neither **y1** nor **y2** nor **interval** is specified, an implicit
44
+ * stackY transform is applied and **y** defaults to the identity function,
45
+ * assuming that *data* = [*y₀*, *y₁*, *y₂*, …]. Otherwise if an **interval**
46
+ * is specified, then **y1** and **y2** are derived from **y**, representing
47
+ * the lower and upper bound of the containing interval, respectively.
48
+ * Otherwise, if only one of **y1** or **y2** is specified, the other
49
+ * defaults to **y**, which defaults to zero.
50
+ *
51
+ * The optional **x** ordinal channel specifies the horizontal position; it
52
+ * is typically bound to the *x* scale, which must be a *band* scale. If the
53
+ * **x** channel is not specified, the bar will span the horizontal extent of
54
+ * the plot’s frame. Because a waffle represents a discrete number of square
55
+ * cells, it may not use all of the available bandwidth.
56
+ */
57
+ mark: 'waffleY';
58
+ }
59
+ //# sourceMappingURL=Waffle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Waffle.d.ts","sourceRoot":"","sources":["../../../../src/spec/marks/Waffle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC5B;AAED,wBAAwB;AACxB,MAAM,WAAW,OAAQ,SAAQ,QAAQ,EAAE,WAAW,EAAE,aAAa;IACnE;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,wBAAwB;AACxB,MAAM,WAAW,OAAQ,SAAQ,QAAQ,EAAE,WAAW,EAAE,aAAa;IACnE;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB"}
@@ -0,0 +1,13 @@
1
+ export function paramRef(value: any): any;
2
+ export function paramStr(value: any): any;
3
+ export function toParamRef(name: any): string;
4
+ export function toArray(value: any): any[];
5
+ export function isArray(value: any): value is any[];
6
+ export function isObject(value: any): boolean;
7
+ export function isNumber(value: any): value is number;
8
+ export function isNumberOrString(value: any): boolean;
9
+ export function isString(value: any): value is string;
10
+ export function isFunction(value: any): boolean;
11
+ export function error(message: any, data: any): void;
12
+ export function isoparse(string: any, fallback: any): any;
13
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util.js"],"names":[],"mappings":"AAAA,0CAKC;AAED,0CAEC;AAED,8CAEC;AAED,2CAEC;AAED,oDAEC;AAED,8CAEC;AAED,sDAEC;AAED,sDAGC;AAED,sDAEC;AAED,gDAEC;AAED,qDAEC;AAKD,0DAGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uwdata/mosaic-spec",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "Declarative specification of Mosaic-powered applications.",
5
5
  "keywords": [
6
6
  "mosaic",
@@ -16,23 +16,31 @@
16
16
  "types": "./dist/src/index.d.ts",
17
17
  "default": "./src/index.js"
18
18
  },
19
+ "files": [
20
+ "dist",
21
+ "!dist/tsconfig.tsbuildinfo",
22
+ "src"
23
+ ],
19
24
  "repository": {
20
25
  "type": "git",
21
26
  "url": "https://github.com/uwdata/mosaic.git"
22
27
  },
23
28
  "scripts": {
24
- "prebuild": "rimraf dist && mkdir dist",
25
- "build": "tsc && npm run schema",
29
+ "clean": "rimraf dist && mkdir dist",
30
+ "prebuild": "npm run clean",
31
+ "build": "npm run schema",
26
32
  "lint": "eslint src test",
33
+ "preschema": "tsc --build",
27
34
  "schema": "ts-json-schema-generator -f tsconfig.json -p src/spec/Spec.ts -t Spec --no-type-check --no-ref-encode --functions hide > dist/mosaic-schema.json",
28
- "test": "vitest run && tsc",
29
- "version": "cd ../.. && npm run docs:schema",
35
+ "test": "npm run schema && vitest run",
36
+ "version": "cd ../../.. && npm run docs:schema",
30
37
  "prepublishOnly": "npm run test && npm run lint && npm run build"
31
38
  },
32
39
  "dependencies": {
33
- "@uwdata/mosaic-core": "^0.17.0",
34
- "@uwdata/mosaic-sql": "^0.17.0",
35
- "@uwdata/vgplot": "^0.17.0",
36
- "ts-json-schema-generator": "^2.3.0"
37
- }
40
+ "@uwdata/mosaic-core": "^0.19.0",
41
+ "@uwdata/mosaic-sql": "^0.19.0",
42
+ "@uwdata/vgplot": "^0.19.0",
43
+ "ts-json-schema-generator": "^2.4.0"
44
+ },
45
+ "gitHead": "0ba4f2d710ca2fa53da7ff02a370e39a32dc2ce4"
38
46
  }
package/src/spec/Data.ts CHANGED
@@ -6,7 +6,7 @@ export interface DataBaseOptions {
6
6
  select?: string[];
7
7
  /**
8
8
  * A filter (WHERE clause) to apply upon load.
9
- * Only rows that pass the filted are included.
9
+ * Only rows that pass the filter are included.
10
10
  */
11
11
  where?: string | string[];
12
12
  /**
@@ -127,7 +127,7 @@ export interface DataSpatial extends DataBaseOptions {
127
127
  type: 'spatial';
128
128
  /**
129
129
  * The file path for the spatial dataset to load. See the [DuckDB spatial
130
- * documention][1] for more information on supported file types.
130
+ * documentation][1] for more information on supported file types.
131
131
  *
132
132
  * [1]: https://duckdb.org/docs/extensions/spatial.html#st_read--read-spatial-data-from-files
133
133
  */
@@ -6,7 +6,7 @@ export type Expression =
6
6
  export interface SQLExpression {
7
7
  /**
8
8
  * A SQL expression string to derive a new column value.
9
- * Embedded Param refrences, such as `$param + 1`, are supported.
9
+ * Embedded Param references, such as `$param + 1`, are supported.
10
10
  * For expressions with aggregate functions, use *agg* instead.
11
11
  */
12
12
  sql: string;
package/src/spec/Input.ts CHANGED
@@ -27,6 +27,11 @@ export interface Menu {
27
27
  * Used in conjunction with the `from` property.
28
28
  */
29
29
  column?: string;
30
+ /**
31
+ * Required if the database column is an list, this property determines how
32
+ * to match the selected menu option against the list values.
33
+ */
34
+ listMatch?: 'any' | 'all';
30
35
  /**
31
36
  * A selection to filter the database table indicated by the `from` property.
32
37
  */
@@ -132,7 +137,7 @@ export interface Slider {
132
137
  */
133
138
  filterBy?: ParamRef;
134
139
  /**
135
- * The minumum slider value.
140
+ * The minimum slider value.
136
141
  */
137
142
  min?: number;
138
143
  /**
package/src/spec/Spec.ts CHANGED
@@ -52,7 +52,7 @@ export interface SpecHead {
52
52
  plotDefaults?: PlotAttributes;
53
53
  }
54
54
 
55
- /** A specifcation component such as a plot, input widget, or layout. */
55
+ /** A specification component such as a plot, input widget, or layout. */
56
56
  export type Component =
57
57
  | HConcat
58
58
  | VConcat
@@ -112,7 +112,7 @@ export interface Bin {
112
112
  /** A column transform. */
113
113
  export interface Column {
114
114
  /**
115
- * Intpret a string or param-value as a column reference.
115
+ * Interpret a string or param-value as a column reference.
116
116
  */
117
117
  column: Arg1;
118
118
  }
@@ -362,7 +362,7 @@ export interface Rank extends WindowOptions {
362
362
  export interface DenseRank extends WindowOptions {
363
363
  /**
364
364
  * Compute the dense row rank (no gaps) over an ordered window partition.
365
- * Sorting ties do not result in gaps in the rank numbers ( [1, 1, 2, ...]).
365
+ * Sorting ties do not result in gaps in the rank numbers ([1, 1, 2, ...]).
366
366
  */
367
367
  dense_rank: Arg0;
368
368
  }
@@ -370,7 +370,7 @@ export interface DenseRank extends WindowOptions {
370
370
  /** A percent_rank window transform. */
371
371
  export interface PercentRank extends WindowOptions {
372
372
  /**
373
- * Compute the percetange rank over an ordered window partition.
373
+ * Compute the percentage rank over an ordered window partition.
374
374
  */
375
375
  percent_rank: Arg0;
376
376
  }
@@ -15,7 +15,7 @@ export interface Interval1DOptions {
15
15
  */
16
16
  field?: string;
17
17
  /**
18
- * The size of an interative pixel (default `1`). Larger pixel sizes reduce
18
+ * The size of an interactive pixel (default `1`). Larger pixel sizes reduce
19
19
  * the brush resolution, which can reduce the size of pre-aggregated
20
20
  * materialized views.
21
21
  */
@@ -22,7 +22,7 @@ export interface Interval2DOptions {
22
22
  */
23
23
  yfield?: string;
24
24
  /**
25
- * The size of an interative pixel (default `1`). Larger pixel sizes reduce
25
+ * The size of an interactive pixel (default `1`). Larger pixel sizes reduce
26
26
  * the brush resolution, which can reduce the size of pre-aggregated
27
27
  * materialized views.
28
28
  */
@@ -18,7 +18,7 @@ export interface ToggleOptions {
18
18
 
19
19
  /** A toggle interactor. */
20
20
  export interface Toggle extends ToggleOptions {
21
- /** Select individal values. */
21
+ /** Select individual values. */
22
22
  select: 'toggle';
23
23
  /**
24
24
  * The encoding channels over which to select values.
@@ -31,7 +31,7 @@ export interface Toggle extends ToggleOptions {
31
31
  /** A toggleX interactor. */
32
32
  export interface ToggleX extends ToggleOptions {
33
33
  /**
34
- * Select individal values in the `x` scale domain.
34
+ * Select individual values in the `x` scale domain.
35
35
  * Clicking or touching a mark toggles its selection status.
36
36
  */
37
37
  select: 'toggleX';
@@ -40,7 +40,7 @@ export interface ToggleX extends ToggleOptions {
40
40
  /** A toggleY interactor. */
41
41
  export interface ToggleY extends ToggleOptions {
42
42
  /**
43
- * Select individal values in the `y` scale domain.
43
+ * Select individual values in the `y` scale domain.
44
44
  * Clicking or touching a mark toggles its selection status.
45
45
  */
46
46
  select: 'toggleY';
@@ -49,7 +49,7 @@ export interface ToggleY extends ToggleOptions {
49
49
  /** A toggleZ interactor. */
50
50
  export interface ToggleZ extends ToggleOptions {
51
51
  /**
52
- * Select individal values in the `z` scale domain.
52
+ * Select individual values in the `z` scale domain.
53
53
  * Clicking or touching a mark toggles its selection status.
54
54
  */
55
55
  select: 'toggleZ';
@@ -58,7 +58,7 @@ export interface ToggleZ extends ToggleOptions {
58
58
  /** A toggleColor interactor. */
59
59
  export interface ToggleColor extends ToggleOptions {
60
60
  /**
61
- * Select individal values in the `color` scale domain.
61
+ * Select individual values in the `color` scale domain.
62
62
  * Clicking or touching a mark toggles its selection status.
63
63
  */
64
64
  select: 'toggleColor';
@@ -42,7 +42,7 @@ export interface ErrorBarX extends MarkData, ErrorBarXOptions {
42
42
  *
43
43
  * This mark aggregates raw values to produce a [parametric confidence
44
44
  * interval][1] of the mean, assuming a normal distribution. To instead
45
- * visualize pre-computeted interval values or custom aggregations, use
45
+ * visualize pre-computed interval values or custom aggregations, use
46
46
  * a **ruleY** mark with specified **x1** and **x2** channels.
47
47
  *
48
48
  * Multiple error bars can be produced by specifying a **z** or **stroke**
@@ -78,7 +78,7 @@ export interface ErrorBarY extends MarkData, ErrorBarYOptions {
78
78
  *
79
79
  * This mark aggregates raw values to produce a [parametric confidence
80
80
  * interval][1] of the mean, assuming a normal distribution. To instead
81
- * visualize pre-computeted interval values or custom aggregations, use
81
+ * visualize pre-computed interval values or custom aggregations, use
82
82
  * a **ruleX** mark with specified **y1** and **y2** channels.
83
83
  *
84
84
  * Multiple error bars can be produced by specifying a **z** or **stroke**
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "include": ["src/**/*"],
4
- "compilerOptions": {
5
- "emitDeclarationOnly": true,
6
- "outDir": "dist"
7
- },
8
- "references": [
9
- { "path": "../core" },
10
- { "path": "../sql" },
11
- { "path": "../vgplot" }
12
- ]
13
- }
package/vitest.config.ts DELETED
@@ -1,3 +0,0 @@
1
- import { defineConfig } from 'vite';
2
-
3
- export default defineConfig({});