@uwdata/mosaic-spec 0.12.1 → 0.12.2

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.
@@ -27,7 +27,7 @@ export interface ParamDate extends ParamBase {
27
27
  date: string;
28
28
  }
29
29
  /** Literal Param values. */
30
- export type ParamLiteral = string | number | boolean;
30
+ export type ParamLiteral = null | string | number | boolean;
31
31
  /** Valid Param values. */
32
32
  export type ParamValue = ParamLiteral | Array<ParamLiteral | ParamRef>;
33
33
  /** A Selection definition. */
@@ -1,10 +1,10 @@
1
- import { ParamRef } from "../Param.js";
2
- import { AreaXOptions, AreaYOptions } from "./Area.js";
3
- import { DotOptions } from "./Dot.js";
4
- import { LineXOptions, LineYOptions } from "./Line.js";
5
- import { MarkData, MarkOptions, TextStyles } from "./Marks.js";
6
- import { Grid2DOptions } from "./Raster.js";
7
- import { TextOptions } from "./Text.js";
1
+ import { ParamRef } from '../Param.js';
2
+ import { AreaXOptions, AreaYOptions } from './Area.js';
3
+ import { DotOptions } from './Dot.js';
4
+ import { LineXOptions, LineYOptions } from './Line.js';
5
+ import { MarkData, MarkOptions, TextStyles } from './Marks.js';
6
+ import { Grid2DOptions } from './Raster.js';
7
+ import { TextOptions } from './Text.js';
8
8
  export interface Density2DOptions extends MarkOptions, Omit<DotOptions, 'x' | 'y'>, TextStyles, Grid2DOptions {
9
9
  /**
10
10
  * The basic mark type to use to render 2D density values.
@@ -36,6 +36,13 @@ export interface Density1DOptions {
36
36
  * Defaults to 1024.
37
37
  */
38
38
  bins?: number | ParamRef;
39
+ /**
40
+ * Normalization method for density estimates. If `false` or `'none'` (the
41
+ * default), the density estimates are smoothed weighted counts. If `true`
42
+ * or `'sum'`, density estimates are divided by the sum of the total point
43
+ * mass. If `'max'`, estimates are divided by the maximum smoothed value.
44
+ */
45
+ normalize?: boolean | 'max' | 'sum' | 'none' | ParamRef;
39
46
  }
40
47
  export interface DensityAreaXOptions extends Omit<AreaXOptions, 'x' | 'x1' | 'x2'> {
41
48
  /**
@@ -43,6 +50,10 @@ export interface DensityAreaXOptions extends Omit<AreaXOptions, 'x' | 'x1' | 'x2
43
50
  * areaX mark; lineX, dotX, and textX marks are also supported.
44
51
  */
45
52
  type: 'areaX';
53
+ /**
54
+ * Flag indicating if densities should be stacked. Defaults to false.
55
+ */
56
+ stack?: boolean | ParamRef;
46
57
  }
47
58
  export interface DensityAreaYOptions extends Omit<AreaYOptions, 'y' | 'y1' | 'y2'> {
48
59
  /**
@@ -50,6 +61,10 @@ export interface DensityAreaYOptions extends Omit<AreaYOptions, 'y' | 'y1' | 'y2
50
61
  * areaY mark; lineY, dot, and text marks are also supported.
51
62
  */
52
63
  type?: 'areaY';
64
+ /**
65
+ * Flag indicating if densities should be stacked. Defaults to false.
66
+ */
67
+ stack?: boolean | ParamRef;
53
68
  }
54
69
  export interface DensityLineXOptions extends Omit<LineXOptions, 'x' | 'x1' | 'x2'> {
55
70
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uwdata/mosaic-spec",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Declarative specification of Mosaic-powered applications.",
5
5
  "keywords": [
6
6
  "mosaic",
@@ -33,10 +33,10 @@
33
33
  "prepublishOnly": "npm run test && npm run lint && npm run build"
34
34
  },
35
35
  "dependencies": {
36
- "@uwdata/mosaic-core": "^0.12.1",
37
- "@uwdata/mosaic-sql": "^0.12.1",
38
- "@uwdata/vgplot": "^0.12.1",
36
+ "@uwdata/mosaic-core": "^0.12.2",
37
+ "@uwdata/mosaic-sql": "^0.12.2",
38
+ "@uwdata/vgplot": "^0.12.2",
39
39
  "ts-json-schema-generator": "^2.3.0"
40
40
  },
41
- "gitHead": "fe3a7c34352da54ec36a1ebf557846f46a649782"
41
+ "gitHead": "0ca741d840b98039255f26a5ceedf10be66f790e"
42
42
  }
package/src/spec/Param.ts CHANGED
@@ -32,6 +32,7 @@ export interface ParamDate extends ParamBase {
32
32
 
33
33
  /** Literal Param values. */
34
34
  export type ParamLiteral =
35
+ | null
35
36
  | string
36
37
  | number
37
38
  | boolean;
@@ -1,10 +1,10 @@
1
- import { ParamRef } from "../Param.js";
2
- import { AreaXOptions, AreaYOptions } from "./Area.js";
3
- import { DotOptions } from "./Dot.js";
4
- import { LineXOptions, LineYOptions } from "./Line.js";
5
- import { MarkData, MarkOptions, TextStyles } from "./Marks.js";
6
- import { Grid2DOptions } from "./Raster.js";
7
- import { TextOptions } from "./Text.js";
1
+ import { ParamRef } from '../Param.js';
2
+ import { AreaXOptions, AreaYOptions } from './Area.js';
3
+ import { DotOptions } from './Dot.js';
4
+ import { LineXOptions, LineYOptions } from './Line.js';
5
+ import { MarkData, MarkOptions, TextStyles } from './Marks.js';
6
+ import { Grid2DOptions } from './Raster.js';
7
+ import { TextOptions } from './Text.js';
8
8
 
9
9
  // Density2D
10
10
 
@@ -44,6 +44,14 @@ export interface Density1DOptions {
44
44
  * Defaults to 1024.
45
45
  */
46
46
  bins?: number | ParamRef;
47
+
48
+ /**
49
+ * Normalization method for density estimates. If `false` or `'none'` (the
50
+ * default), the density estimates are smoothed weighted counts. If `true`
51
+ * or `'sum'`, density estimates are divided by the sum of the total point
52
+ * mass. If `'max'`, estimates are divided by the maximum smoothed value.
53
+ */
54
+ normalize?: boolean | 'max' | 'sum' | 'none' | ParamRef;
47
55
  }
48
56
 
49
57
  export interface DensityAreaXOptions extends Omit<AreaXOptions, 'x' | 'x1' | 'x2'> {
@@ -52,6 +60,11 @@ export interface DensityAreaXOptions extends Omit<AreaXOptions, 'x' | 'x1' | 'x2
52
60
  * areaX mark; lineX, dotX, and textX marks are also supported.
53
61
  */
54
62
  type: 'areaX';
63
+
64
+ /**
65
+ * Flag indicating if densities should be stacked. Defaults to false.
66
+ */
67
+ stack?: boolean | ParamRef;
55
68
  }
56
69
 
57
70
  export interface DensityAreaYOptions extends Omit<AreaYOptions, 'y' | 'y1' | 'y2'> {
@@ -60,6 +73,11 @@ export interface DensityAreaYOptions extends Omit<AreaYOptions, 'y' | 'y1' | 'y2
60
73
  * areaY mark; lineY, dot, and text marks are also supported.
61
74
  */
62
75
  type?: 'areaY';
76
+
77
+ /**
78
+ * Flag indicating if densities should be stacked. Defaults to false.
79
+ */
80
+ stack?: boolean | ParamRef;
63
81
  }
64
82
 
65
83
  export interface DensityLineXOptions extends Omit<LineXOptions, 'x' | 'x1' | 'x2'> {