@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,35 @@
1
+ /**
2
+ * Generate an object of lookup maps for vgplot components.
3
+ */
4
+ export function plotNames({ attributes, interactors, legends, marks }?: {
5
+ attributes?: Set<string>;
6
+ interactors?: Set<string>;
7
+ legends?: Set<string>;
8
+ marks?: Set<string>;
9
+ }): {
10
+ attributes: Set<string>;
11
+ interactors: Set<string>;
12
+ legends: Set<string>;
13
+ marks: Set<string>;
14
+ };
15
+ /**
16
+ * Names of attribute directive functions.
17
+ * @returns {Set<string>}
18
+ */
19
+ export function plotAttributeNames(overrides?: any[]): Set<string>;
20
+ /**
21
+ * Names interactor directive functions.
22
+ * @returns {Set<string>}
23
+ */
24
+ export function plotInteractorNames(overrides?: any[]): Set<string>;
25
+ /**
26
+ * Names of legend directive functions.
27
+ * @returns {Set<string>}
28
+ */
29
+ export function plotLegendNames(overrides?: any[]): Set<string>;
30
+ /**
31
+ * Names of mark directive functions.
32
+ * @returns {Set<string>}
33
+ */
34
+ export function plotMarkNames(overrides?: any[]): Set<string>;
35
+ //# sourceMappingURL=plots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plots.d.ts","sourceRoot":"","sources":["../../../src/config/plots.js"],"names":[],"mappings":"AAOA;;GAEG;AACH;;;;;;;;;;EAOC;AAED;;;GAGG;AACH,uDAFa,GAAG,CAAC,MAAM,CAAC,CAOvB;AAED;;;GAGG;AACH,wDAFa,GAAG,CAAC,MAAM,CAAC,CAOvB;AAED;;;GAGG;AACH,oDAFa,GAAG,CAAC,MAAM,CAAC,CAOvB;AAED;;;GAGG;AACH,kDAFa,GAAG,CAAC,MAAM,CAAC,CAOvB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Valid transform method names.
3
+ */
4
+ export function transformNames(overrides?: any[]): Set<any>;
5
+ //# sourceMappingURL=transforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../../../src/config/transforms.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,4DAoDC"}
@@ -0,0 +1,33 @@
1
+ export const SPEC: "spec";
2
+ export const LITERAL: "literal";
3
+ export const DATAREF: "dataref";
4
+ export const OPTIONS: "options";
5
+ export const SELECTION: "selection";
6
+ export const PARAMREF: "paramref";
7
+ export const COLUMPARAMREF: "columnparamref";
8
+ export const PARAM: "param";
9
+ export const INCLUDE: "include";
10
+ export const SELECT: "select";
11
+ export const VALUE: "value";
12
+ export const CROSSFILTER: "crossfilter";
13
+ export const INTERSECT: "intersect";
14
+ export const UNION: "union";
15
+ export const SINGLE: "single";
16
+ export const DATA: "data";
17
+ export const EXPRESSION: "expression";
18
+ export const SQL: "sql";
19
+ export const INPUT: "input";
20
+ export const HCONCAT: "hconcat";
21
+ export const VCONCAT: "vconcat";
22
+ export const HSPACE: "hspace";
23
+ export const VSPACE: "vspace";
24
+ export const MARK: "mark";
25
+ export const FROM: "from";
26
+ export const PLOT: "plot";
27
+ export const LEGEND: "legend";
28
+ export const ATTRIBUTE: "attribute";
29
+ export const TRANSFORM: "transform";
30
+ export const WINDOW_FRAME: "windowframe";
31
+ export const INTERACTOR: "interactor";
32
+ export const FIXED: "Fixed";
33
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.js"],"names":[],"mappings":"AACA,mBAAoB,MAAM,CAAC;AAG3B,sBAAuB,SAAS,CAAC;AAGjC,sBAAuB,SAAS,CAAC;AAGjC,sBAAuB,SAAS,CAAC;AAGjC,wBAAyB,WAAW,CAAC;AACrC,uBAAwB,UAAU,CAAC;AACnC,4BAA6B,gBAAgB,CAAC;AAC9C,oBAAqB,OAAO,CAAC;AAC7B,sBAAuB,SAAS,CAAC;AAGjC,qBAAsB,QAAQ,CAAC;AAC/B,oBAAqB,OAAO,CAAC;AAC7B,0BAA2B,aAAa,CAAC;AACzC,wBAAyB,WAAW,CAAC;AACrC,oBAAqB,OAAO,CAAC;AAC7B,qBAAsB,QAAQ,CAAC;AAG/B,mBAAoB,MAAM,CAAC;AAG3B,yBAA0B,YAAY,CAAC;AACvC,kBAAmB,KAAK,CAAC;AAGzB,oBAAqB,OAAO,CAAC;AAG7B,sBAAuB,SAAS,CAAC;AACjC,sBAAuB,SAAS,CAAC;AACjC,qBAAsB,QAAQ,CAAC;AAC/B,qBAAsB,QAAQ,CAAC;AAG/B,mBAAoB,MAAM,CAAC;AAC3B,mBAAoB,MAAM,CAAC;AAC3B,mBAAoB,MAAM,CAAC;AAC3B,qBAAsB,QAAQ,CAAC;AAC/B,wBAAyB,WAAW,CAAC;AACrC,wBAAyB,WAAW,CAAC;AACrC,2BAA4B,aAAa,CAAC;AAC1C,yBAA0B,YAAY,CAAC;AACvC,oBAAqB,OAAO,CAAC"}
@@ -0,0 +1,30 @@
1
+ export { parseSpec } from "./parse-spec.js";
2
+ export * from "./constants.js";
3
+ export { ASTNode } from "./ast/ASTNode.js";
4
+ export { ExpressionNode } from "./ast/ExpressionNode.js";
5
+ export { HConcatNode } from "./ast/HConcatNode.js";
6
+ export { HSpaceNode } from "./ast/HSpaceNode.js";
7
+ export { InputNode } from "./ast/InputNode.js";
8
+ export { LiteralNode } from "./ast/LiteralNode.js";
9
+ export { OptionsNode } from "./ast/OptionsNode.js";
10
+ export { ParamNode } from "./ast/ParamNode.js";
11
+ export { ParamRefNode } from "./ast/ParamRefNode.js";
12
+ export { PlotFromNode } from "./ast/PlotFromNode.js";
13
+ export { PlotInteractorNode } from "./ast/PlotInteractorNode.js";
14
+ export { PlotLegendNode } from "./ast/PlotLegendNode.js";
15
+ export { PlotMarkNode } from "./ast/PlotMarkNode.js";
16
+ export { PlotNode } from "./ast/PlotNode.js";
17
+ export { SelectionNode } from "./ast/SelectionNode.js";
18
+ export { SpecNode } from "./ast/SpecNode.js";
19
+ export { TransformNode } from "./ast/TransformNode.js";
20
+ export { VConcatNode } from "./ast/VConcatNode.js";
21
+ export { VSpaceNode } from "./ast/VSpaceNode.js";
22
+ /**
23
+ * A Mosaic declarative specification.
24
+ */
25
+ export type Spec = import("./spec/Spec.js").Spec;
26
+ export { astToDOM, InstantiateContext } from "./ast-to-dom.js";
27
+ export { astToESM, CodegenContext } from "./ast-to-esm.js";
28
+ export { DataNode, QueryDataNode, TableDataNode, FileDataNode, CSVDataNode, JSONDataNode, ParquetDataNode, SpatialDataNode, LiteralJSONDataNode } from "./ast/DataNode.js";
29
+ export { PlotAttributeNode, PlotFixedNode } from "./ast/PlotAttributeNode.js";
30
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;mBACa,OAAO,gBAAgB,EAAE,IAAI"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @typedef {{
3
+ * attributes: Set<string>;
4
+ * interactors: Set<string>;
5
+ * legends: Set<string>;
6
+ * marks: Set<string>;
7
+ * }} PlotNames names for supported plot elements
8
+ */
9
+ /**
10
+ * Parse a Mosaic specification to an AST (abstract syntax tree).
11
+ * @param {import('./spec/Spec.js').Spec} spec The input specification.
12
+ * @param {object} [options] Optional parse options object.
13
+ * @param {Map<string, Function>} [options.components] Map of component names to parse functions.
14
+ * @param {Set<string>} [options.transforms] The names of allowed transform functions.
15
+ * @param {Set<string>} [options.inputs] The names of supported input widgets.
16
+ * @param {PlotNames} [options.plot] The names of supported plot elements.
17
+ * @param {any[]} [options.params] An array of [name, node] pairs of pre-parsed
18
+ * Param or Selection AST nodes.
19
+ * @param {any[]} [options.datasets] An array of [name, node] pairs of pre-parsed
20
+ * dataset definition AST nodes.
21
+ * @returns {SpecNode} The top-level AST spec node.
22
+ */
23
+ export function parseSpec(spec: import("./spec/Spec.js").Spec, options?: {
24
+ components?: Map<string, Function>;
25
+ transforms?: Set<string>;
26
+ inputs?: Set<string>;
27
+ plot?: PlotNames;
28
+ params?: any[];
29
+ datasets?: any[];
30
+ }): SpecNode;
31
+ export class ParseContext {
32
+ /**
33
+ * Create a new parser context.
34
+ * @param {object} [options]
35
+ * @param {Map<string, Function>} [options.components] Map of component names to parse functions.
36
+ * @param {Set<string>} [options.transforms] The names of allowed transform functions.
37
+ * @param {Set<string>} [options.inputs] The names of supported input widgets.
38
+ * @param {PlotNames} [options.plot] The names of supported plot elements.
39
+ * @param {any[]} [options.params] An array of [name, node] pairs of pre-parsed
40
+ * Param or Selection AST nodes.
41
+ * @param {any[]} [options.datasets] An array of [name, node] pairs of pre-parsed
42
+ * dataset definition AST nodes.
43
+ */
44
+ constructor({ components, transforms, inputs, plot, params, datasets }?: {
45
+ components?: Map<string, Function>;
46
+ transforms?: Set<string>;
47
+ inputs?: Set<string>;
48
+ plot?: PlotNames;
49
+ params?: any[];
50
+ datasets?: any[];
51
+ });
52
+ components: Map<string, Function>;
53
+ transforms: Set<string>;
54
+ inputs: Set<string>;
55
+ plot: PlotNames;
56
+ params: Map<any, any>;
57
+ datasets: Map<any, any>;
58
+ parse(spec: any): SpecNode;
59
+ plotDefaults: import("./ast/PlotAttributeNode.js").PlotAttributeNode[];
60
+ parseComponent(spec: any): any;
61
+ /**
62
+ * Test if a value is a param reference, if so, generates a parameter
63
+ * definition as needed and returns a new ParamRefNode. Otherwise,
64
+ * returns a LiteralNode for the given value.
65
+ * @param {*} value The value to test.
66
+ * @returns {ParamRefNode|LiteralNode} An AST node for the input value.
67
+ */
68
+ maybeParam(value: any): ParamRefNode | LiteralNode;
69
+ /**
70
+ * Test if a value is a param reference, if so, generates a selection
71
+ * definition as needed and returns a new ParamRefNode. Otherwise,
72
+ * returns a LiteralNode for the given value.
73
+ * @param {*} value The value to test.
74
+ * @returns {ParamRefNode|LiteralNode} An AST node for the input value.
75
+ */
76
+ maybeSelection(value: any): ParamRefNode | LiteralNode;
77
+ /**
78
+ * Create a parameter reference. Generates a parameter definition if needed
79
+ * and returns a new ParamRefNode.
80
+ * @param {string} name The parameter name.
81
+ * @param {() => ParamNode | SelectionNode} [makeNode] A Param or Selection AST
82
+ * node constructor.
83
+ * @returns {ParamRefNode|null} A node referring to the param or selection.
84
+ */
85
+ paramRef(name: string, makeNode?: () => ParamNode | SelectionNode): ParamRefNode | null;
86
+ /**
87
+ * Create a selection reference. Generates a selection definition if needed
88
+ * and returns a new ParamRefNode. Returns null if a non-selection parameter
89
+ * with the same name already exists and *strict* is true.
90
+ * @param {string} name The selection name.
91
+ * @param {boolean} [strict=false] Indicates if this method may return param
92
+ * references (false, default) or only selection references (true).
93
+ * @returns {ParamRefNode|null} A node referring to the param or selection.
94
+ */
95
+ selectionRef(name: string, strict?: boolean): ParamRefNode | null;
96
+ error(message: any, data: any): void;
97
+ }
98
+ /**
99
+ * names for supported plot elements
100
+ */
101
+ export type PlotNames = {
102
+ attributes: Set<string>;
103
+ interactors: Set<string>;
104
+ legends: Set<string>;
105
+ marks: Set<string>;
106
+ };
107
+ import { SpecNode } from './ast/SpecNode.js';
108
+ import { ParamRefNode } from './ast/ParamRefNode.js';
109
+ import { LiteralNode } from './ast/LiteralNode.js';
110
+ import { ParamNode } from './ast/ParamNode.js';
111
+ import { SelectionNode } from './ast/SelectionNode.js';
112
+ //# sourceMappingURL=parse-spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-spec.d.ts","sourceRoot":"","sources":["../../src/parse-spec.js"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,gCAZW,OAAO,gBAAgB,EAAE,IAAI,YAErC;IAAwC,UAAU,GAA1C,GAAG,CAAC,MAAM,WAAW;IACC,UAAU,GAAhC,GAAG,CAAC,MAAM,CAAC;IACW,MAAM,GAA5B,GAAG,CAAC,MAAM,CAAC;IACS,IAAI,GAAxB,SAAS;IACO,MAAM,GAAtB,GAAG,EAAE;IAEW,QAAQ,GAAxB,GAAG,EAAE;CAEb,GAAU,QAAQ,CAIpB;AAED;IACE;;;;;;;;;;;OAWG;IACH,yEATG;QAAwC,UAAU,GAA1C,GAAG,CAAC,MAAM,WAAW;QACC,UAAU,GAAhC,GAAG,CAAC,MAAM,CAAC;QACW,MAAM,GAA5B,GAAG,CAAC,MAAM,CAAC;QACS,IAAI,GAAxB,SAAS;QACO,MAAM,GAAtB,GAAG,EAAE;QAEW,QAAQ,GAAxB,GAAG,EAAE;KAEf,EAeA;IANC,kCAA4B;IAC5B,wBAA4B;IAC5B,oBAAoB;IACpB,gBAAgB;IAChB,sBAA6B;IAC7B,wBAAiC;IAGnC,2BAgCC;IAhBC,uEAC0D;IAiB5D,+BAQC;IAED;;;;;;OAMG;IACH,kBAHW,GAAC,GACC,YAAY,GAAC,WAAW,CAOpC;IAED;;;;;;OAMG;IACH,sBAHW,GAAC,GACC,YAAY,GAAC,WAAW,CAOpC;IAED;;;;;;;OAOG;IACH,eALW,MAAM,aACN,MAAM,SAAS,GAAG,aAAa,GAE7B,YAAY,GAAC,IAAI,CAW7B;IAED;;;;;;;;OAQG;IACH,mBALW,MAAM,WACN,OAAO,GAEL,YAAY,GAAC,IAAI,CAQ7B;IAED,qCAEC;CACF;;;;wBAtKY;IACR,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB;yBAbqB,mBAAmB;6BAHf,uBAAuB;4BAFxB,sBAAsB;0BACZ,oBAAoB;8BAG5B,wBAAwB"}
@@ -0,0 +1,4 @@
1
+ type OmittedProperties = 'parentRule' | 'getPropertyPriority' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty';
2
+ export type CSSStyles = Partial<Omit<CSSStyleDeclaration, OmittedProperties>>;
3
+ export {};
4
+ //# sourceMappingURL=CSSStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CSSStyles.d.ts","sourceRoot":"","sources":["../../../src/spec/CSSStyles.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,GAClB,YAAY,GACZ,qBAAqB,GACrB,kBAAkB,GAClB,MAAM,GACN,gBAAgB,GAChB,aAAa,CAAC;AAElB,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,166 @@
1
+ export interface DataBaseOptions {
2
+ /**
3
+ * A list of column names to extract upon load.
4
+ * Any other columns are omitted.
5
+ */
6
+ select?: string[];
7
+ /**
8
+ * A filter (WHERE clause) to apply upon load.
9
+ * Only rows that pass the filter are included.
10
+ */
11
+ where?: string | string[];
12
+ /**
13
+ * Flag (default `false`) to generate a view instead of a table.
14
+ */
15
+ view?: boolean;
16
+ /**
17
+ * Flag (default `true`) to generate a temporary view or table.
18
+ */
19
+ temp?: boolean;
20
+ /**
21
+ * Flag (default `true`) to replace an existing table of the same name.
22
+ * If `false`, creating a new table with an existing name raises an error.
23
+ */
24
+ replace?: boolean;
25
+ }
26
+ /**
27
+ * A SQL query defining a new temporary database table.
28
+ */
29
+ export type DataQuery = string;
30
+ /**
31
+ * An inline array of data objects to treat as JSON data.
32
+ */
33
+ export type DataArray = object[];
34
+ /**
35
+ * A data definition that loads an external data file.
36
+ */
37
+ export interface DataFile extends DataBaseOptions {
38
+ /**
39
+ * The data file to load. If no type option is provided,
40
+ * the file suffix must be one of `.csv`, `.json`, or `.parquet`.
41
+ */
42
+ file: `${string}.parquet` | `${string}.csv` | `${string}.json`;
43
+ }
44
+ /**
45
+ * A data definition that queries an existing table.
46
+ */
47
+ export interface DataTable extends DataBaseOptions {
48
+ /**
49
+ * The data source type. One of:
50
+ * - `"table"`: Define a new table based on a SQL query.
51
+ * - `"csv"`: Load a comma-separated values (CSV) file.
52
+ * - `"json"`: Load JavaScript Object Notation (json) data.
53
+ * - `"parquet"`: Load a Parquet file.
54
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
55
+ */
56
+ type: 'table';
57
+ /**
58
+ * A SQL query string for the desired table data.
59
+ */
60
+ query: string;
61
+ }
62
+ /**
63
+ * A data definition that loads a parquet file.
64
+ */
65
+ export interface DataParquet extends DataBaseOptions {
66
+ /**
67
+ * The data source type. One of:
68
+ * - `"table"`: Define a new table based on a SQL query.
69
+ * - `"csv"`: Load a comma-separated values (CSV) file.
70
+ * - `"json"`: Load JavaScript Object Notation (json) data.
71
+ * - `"parquet"`: Load a Parquet file.
72
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
73
+ */
74
+ type: 'parquet';
75
+ /**
76
+ * The file path for the dataset to load.
77
+ */
78
+ file: string;
79
+ }
80
+ /**
81
+ * A data definition that loads a csv file.
82
+ */
83
+ export interface DataCSV extends DataBaseOptions {
84
+ /**
85
+ * The data source type. One of:
86
+ * - `"table"`: Define a new table based on a SQL query.
87
+ * - `"csv"`: Load a comma-separated values (CSV) file.
88
+ * - `"json"`: Load JavaScript Object Notation (json) data.
89
+ * - `"parquet"`: Load a Parquet file.
90
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
91
+ */
92
+ type: 'csv';
93
+ /**
94
+ * The file path for the dataset to load.
95
+ */
96
+ file: string;
97
+ /**
98
+ * The column delimiter string. If not specified, DuckDB will try to infer
99
+ * the delimiter automatically.
100
+ */
101
+ delimiter?: string;
102
+ /**
103
+ * The sample size, in table rows, to consult for type inference.
104
+ * Set to `-1` to process all rows in the dataset.
105
+ */
106
+ sample_size?: number;
107
+ }
108
+ /**
109
+ * A data definition that loads a supported spatial data file format.
110
+ */
111
+ export interface DataSpatial extends DataBaseOptions {
112
+ /**
113
+ * The data source type. One of:
114
+ * - `"table"`: Define a new table based on a SQL query.
115
+ * - `"csv"`: Load a comma-separated values (CSV) file.
116
+ * - `"json"`: Load JavaScript Object Notation (json) data.
117
+ * - `"parquet"`: Load a Parquet file.
118
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
119
+ */
120
+ type: 'spatial';
121
+ /**
122
+ * The file path for the spatial dataset to load. See the [DuckDB spatial
123
+ * documentation][1] for more information on supported file types.
124
+ *
125
+ * [1]: https://duckdb.org/docs/extensions/spatial.html#st_read--read-spatial-data-from-files
126
+ */
127
+ file: string;
128
+ /**
129
+ * The named layer to load from the file. For example, in a TopoJSON file
130
+ * the layer is the named object to extract. For Excel spreadsheet files,
131
+ * the layer is the name of the worksheet to extract.
132
+ */
133
+ layer?: string;
134
+ }
135
+ export interface DataJSON extends DataBaseOptions {
136
+ /**
137
+ * The data source type. One of:
138
+ * - `"table"`: Define a new table based on a SQL query.
139
+ * - `"csv"`: Load a comma-separated values (CSV) file.
140
+ * - `"json"`: Load JavaScript Object Notation (json) data.
141
+ * - `"parquet"`: Load a Parquet file.
142
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
143
+ */
144
+ type: 'json';
145
+ /**
146
+ * The file path for the dataset to load.
147
+ */
148
+ file: string;
149
+ }
150
+ export interface DataJSONObjects extends DataBaseOptions {
151
+ /**
152
+ * The data source type. One of:
153
+ * - `"table"`: Define a new table based on a SQL query.
154
+ * - `"csv"`: Load a comma-separated values (CSV) file.
155
+ * - `"json"`: Load JavaScript Object Notation (json) data.
156
+ * - `"parquet"`: Load a Parquet file.
157
+ * - `"spatial"`: Load a spatial data file format via `ST_Read`.
158
+ */
159
+ type?: 'json';
160
+ /**
161
+ * An array of inline objects in JSON-style format.
162
+ */
163
+ data: object[];
164
+ }
165
+ export type DataDefinition = DataQuery | DataArray | DataFile | DataTable | DataParquet | DataCSV | DataSpatial | DataJSON | DataJSONObjects;
166
+ //# sourceMappingURL=Data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../src/spec/Data.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C;;;OAGG;IACH,IAAI,EAAE,GAAG,MAAM,UAAU,GAAG,GAAG,MAAM,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC;CAChE;AAED;;GAEG;AACH,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD;;;;;;;OAOG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;;;OAOG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,OAAQ,SAAQ,eAAe;IAC9C;;;;;;;OAOG;IACH,IAAI,EAAE,KAAK,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,eAAe;IAClD;;;;;;;OAOG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAS,SAAQ,eAAe;IAC/C;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,WAAW,GACX,OAAO,GACP,WAAW,GACX,QAAQ,GACR,eAAe,CAAC"}
@@ -0,0 +1,28 @@
1
+ export type Expression = SQLExpression | AggregateExpression;
2
+ /** A custom SQL expression. */
3
+ export interface SQLExpression {
4
+ /**
5
+ * A SQL expression string to derive a new column value.
6
+ * Embedded Param references, such as `$param + 1`, are supported.
7
+ * For expressions with aggregate functions, use *agg* instead.
8
+ */
9
+ sql: string;
10
+ /**
11
+ * A label for this expression, for example to label a plot axis.
12
+ */
13
+ label?: string;
14
+ }
15
+ /** A custom SQL aggregate expression. */
16
+ export interface AggregateExpression {
17
+ /**
18
+ * A SQL expression string to calculate an aggregate value.
19
+ * Embedded Param references, such as `SUM($param + 1)`, are supported.
20
+ * For expressions without aggregate functions, use *sql* instead.
21
+ */
22
+ agg: string;
23
+ /**
24
+ * A label for this expression, for example to label a plot axis.
25
+ */
26
+ label?: string;
27
+ }
28
+ //# sourceMappingURL=Expression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Expression.d.ts","sourceRoot":"","sources":["../../../src/spec/Expression.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB,aAAa,GACb,mBAAmB,CAAC;AAExB,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,9 @@
1
+ import { Component } from './Spec.js';
2
+ /** An hconcat component. */
3
+ export interface HConcat {
4
+ /**
5
+ * Horizontally concatenate components in a row layout.
6
+ */
7
+ hconcat: Component[];
8
+ }
9
+ //# sourceMappingURL=HConcat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HConcat.d.ts","sourceRoot":"","sources":["../../../src/spec/HConcat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,4BAA4B;AAC5B,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB"}
@@ -0,0 +1,10 @@
1
+ /** An hspace component. */
2
+ export interface HSpace {
3
+ /**
4
+ * Horizontal space to place between components.
5
+ * Number values indicate screen pixels.
6
+ * String values may use CSS units (em, pt, px, etc).
7
+ */
8
+ hspace: number | string;
9
+ }
10
+ //# sourceMappingURL=HSpace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HSpace.d.ts","sourceRoot":"","sources":["../../../src/spec/HSpace.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB"}