@uwdata/mosaic-spec 0.9.0 → 0.10.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/LICENSE +47 -0
- package/dist/mosaic-schema.json +103 -33
- package/dist/mosaic-spec.js +2815 -2464
- package/dist/mosaic-spec.min.js +20 -20
- package/dist/types/ast/ASTNode.d.ts +2 -2
- package/dist/types/ast/DataNode.d.ts +3 -3
- package/dist/types/ast/SelectionNode.d.ts +3 -1
- package/dist/types/ast/TransformNode.d.ts +9 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/parse-spec.d.ts +1 -1
- package/dist/types/spec/Input.d.ts +5 -0
- package/dist/types/spec/Param.d.ts +6 -0
- package/dist/types/spec/PlotAttribute.d.ts +6 -0
- package/dist/types/spec/Transform.d.ts +33 -13
- package/dist/types/util.d.ts +3 -3
- package/package.json +7 -7
- package/src/ast/ParamNode.js +2 -2
- package/src/ast/SelectionNode.js +11 -7
- package/src/ast/TransformNode.js +44 -10
- package/src/spec/Input.ts +5 -0
- package/src/spec/Param.ts +7 -0
- package/src/spec/PlotAttribute.ts +7 -0
- package/src/spec/Transform.ts +44 -15
package/LICENSE
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023, UW Interactive Data Lab
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
Portions of this software are derived from Observable Plot, which is released
|
|
33
|
+
under the ISC license.
|
|
34
|
+
|
|
35
|
+
Copyright 2020-2023 Observable, Inc.
|
|
36
|
+
|
|
37
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
38
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
39
|
+
and this permission notice appear in all copies.
|
|
40
|
+
|
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
42
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
43
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
44
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
45
|
+
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
46
|
+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
47
|
+
THIS SOFTWARE.
|
package/dist/mosaic-schema.json
CHANGED
|
@@ -14387,58 +14387,56 @@
|
|
|
14387
14387
|
"maxItems": 1,
|
|
14388
14388
|
"minItems": 1,
|
|
14389
14389
|
"type": "array"
|
|
14390
|
-
},
|
|
14391
|
-
{
|
|
14392
|
-
"items": [
|
|
14393
|
-
{
|
|
14394
|
-
"description": "A transform argument.",
|
|
14395
|
-
"type": [
|
|
14396
|
-
"string",
|
|
14397
|
-
"number",
|
|
14398
|
-
"boolean"
|
|
14399
|
-
]
|
|
14400
|
-
},
|
|
14401
|
-
{
|
|
14402
|
-
"$ref": "#/definitions/BinOptions"
|
|
14403
|
-
}
|
|
14404
|
-
],
|
|
14405
|
-
"maxItems": 2,
|
|
14406
|
-
"minItems": 2,
|
|
14407
|
-
"type": "array"
|
|
14408
14390
|
}
|
|
14409
14391
|
],
|
|
14410
|
-
"description": "Bin a continuous variable into discrete intervals.
|
|
14411
|
-
}
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
"type": "object"
|
|
14417
|
-
},
|
|
14418
|
-
"BinOptions": {
|
|
14419
|
-
"additionalProperties": false,
|
|
14420
|
-
"description": "Bin transform options.",
|
|
14421
|
-
"properties": {
|
|
14392
|
+
"description": "Bin a continuous variable into discrete intervals. The bin argument specifies a data column or expression to bin. Both numerical and temporal (date/time) values are supported."
|
|
14393
|
+
},
|
|
14394
|
+
"interval": {
|
|
14395
|
+
"$ref": "#/definitions/BinInterval",
|
|
14396
|
+
"description": "The interval bin unit to use, typically used to indicate a date/time unit for binning temporal values, such as `hour`, `day`, or `month`. If `date`, the extent of data values is used to automatically select an interval for temporal data. The value `number` enforces normal numerical binning, even over temporal data. If unspecified, defaults to `number` for numerical data and `date` for temporal data."
|
|
14397
|
+
},
|
|
14422
14398
|
"minstep": {
|
|
14423
|
-
"description": "The minimum allowed bin step size (default `0`). For example, a setting of `1`
|
|
14399
|
+
"description": "The minimum allowed bin step size (default `0`) when performing numerical binning. For example, a setting of `1` prevents step sizes less than 1. This option is ignored when **step** is specified.",
|
|
14424
14400
|
"type": "number"
|
|
14425
14401
|
},
|
|
14426
14402
|
"nice": {
|
|
14427
14403
|
"const": true,
|
|
14428
|
-
"description": "A flag requesting \"nice\" human-friendly step sizes (
|
|
14404
|
+
"description": "A flag (default `true`) requesting \"nice\" human-friendly end points and step sizes when performing numerical binning. When **step** is specified, this option affects the binning end points (e.g., origin) only.",
|
|
14429
14405
|
"type": "boolean"
|
|
14430
14406
|
},
|
|
14431
14407
|
"offset": {
|
|
14432
14408
|
"description": "Offset for computed bins (default `0`). For example, a value of `1` will result in using the next consecutive bin boundary.",
|
|
14433
14409
|
"type": "number"
|
|
14434
14410
|
},
|
|
14411
|
+
"step": {
|
|
14412
|
+
"description": "The step size to use between bins. When binning numerical values (or interval type `number`), this setting specifies the numerical step size. For data/time intervals, this indicates the number of steps of that unit, such as hours, days, or years.",
|
|
14413
|
+
"type": "number"
|
|
14414
|
+
},
|
|
14435
14415
|
"steps": {
|
|
14436
|
-
"description": "The target number of binning steps to use. To accommodate human-friendly bin boundaries, the actual number of bins may diverge from this exact
|
|
14416
|
+
"description": "The target number of binning steps to use. To accommodate human-friendly (\"nice\") bin boundaries, the actual number of bins may diverge from this exact value. This option is ignored when **step** is specified.",
|
|
14437
14417
|
"type": "number"
|
|
14438
14418
|
}
|
|
14439
14419
|
},
|
|
14420
|
+
"required": [
|
|
14421
|
+
"bin"
|
|
14422
|
+
],
|
|
14440
14423
|
"type": "object"
|
|
14441
14424
|
},
|
|
14425
|
+
"BinInterval": {
|
|
14426
|
+
"description": "Binning interval names.",
|
|
14427
|
+
"enum": [
|
|
14428
|
+
"date",
|
|
14429
|
+
"number",
|
|
14430
|
+
"millisecond",
|
|
14431
|
+
"second",
|
|
14432
|
+
"minute",
|
|
14433
|
+
"hour",
|
|
14434
|
+
"day",
|
|
14435
|
+
"month",
|
|
14436
|
+
"year"
|
|
14437
|
+
],
|
|
14438
|
+
"type": "string"
|
|
14439
|
+
},
|
|
14442
14440
|
"BrushStyles": {
|
|
14443
14441
|
"additionalProperties": false,
|
|
14444
14442
|
"description": "Styles for rectangular selection brushes.",
|
|
@@ -14867,6 +14865,9 @@
|
|
|
14867
14865
|
"content": {
|
|
14868
14866
|
"type": "string"
|
|
14869
14867
|
},
|
|
14868
|
+
"contentVisibility": {
|
|
14869
|
+
"type": "string"
|
|
14870
|
+
},
|
|
14870
14871
|
"counterIncrement": {
|
|
14871
14872
|
"type": "string"
|
|
14872
14873
|
},
|
|
@@ -15653,6 +15654,12 @@
|
|
|
15653
15654
|
"textWrap": {
|
|
15654
15655
|
"type": "string"
|
|
15655
15656
|
},
|
|
15657
|
+
"textWrapMode": {
|
|
15658
|
+
"type": "string"
|
|
15659
|
+
},
|
|
15660
|
+
"textWrapStyle": {
|
|
15661
|
+
"type": "string"
|
|
15662
|
+
},
|
|
15656
15663
|
"top": {
|
|
15657
15664
|
"type": "string"
|
|
15658
15665
|
},
|
|
@@ -15674,6 +15681,9 @@
|
|
|
15674
15681
|
"transition": {
|
|
15675
15682
|
"type": "string"
|
|
15676
15683
|
},
|
|
15684
|
+
"transitionBehavior": {
|
|
15685
|
+
"type": "string"
|
|
15686
|
+
},
|
|
15677
15687
|
"transitionDelay": {
|
|
15678
15688
|
"type": "string"
|
|
15679
15689
|
},
|
|
@@ -15917,6 +15927,9 @@
|
|
|
15917
15927
|
"whiteSpace": {
|
|
15918
15928
|
"type": "string"
|
|
15919
15929
|
},
|
|
15930
|
+
"whiteSpaceCollapse": {
|
|
15931
|
+
"type": "string"
|
|
15932
|
+
},
|
|
15920
15933
|
"widows": {
|
|
15921
15934
|
"type": "string"
|
|
15922
15935
|
},
|
|
@@ -15946,6 +15959,9 @@
|
|
|
15946
15959
|
},
|
|
15947
15960
|
"zIndex": {
|
|
15948
15961
|
"type": "string"
|
|
15962
|
+
},
|
|
15963
|
+
"zoom": {
|
|
15964
|
+
"type": "string"
|
|
15949
15965
|
}
|
|
15950
15966
|
},
|
|
15951
15967
|
"type": "object"
|
|
@@ -69929,6 +69945,20 @@
|
|
|
69929
69945
|
],
|
|
69930
69946
|
"description": "A power scale’s exponent (*e.g.*, 0.5 for sqrt); defaults to 1 for a linear scale. For *pow* scales only."
|
|
69931
69947
|
},
|
|
69948
|
+
"rLabel": {
|
|
69949
|
+
"anyOf": [
|
|
69950
|
+
{
|
|
69951
|
+
"type": "string"
|
|
69952
|
+
},
|
|
69953
|
+
{
|
|
69954
|
+
"type": "null"
|
|
69955
|
+
},
|
|
69956
|
+
{
|
|
69957
|
+
"$ref": "#/definitions/ParamRef"
|
|
69958
|
+
}
|
|
69959
|
+
],
|
|
69960
|
+
"description": "A textual label to show on the axis or legend; if null, show no label. By default the scale label is inferred from channel definitions, possibly with an arrow (↑, →, ↓, or ←) to indicate the direction of increasing value."
|
|
69961
|
+
},
|
|
69932
69962
|
"rNice": {
|
|
69933
69963
|
"anyOf": [
|
|
69934
69964
|
{
|
|
@@ -72777,6 +72807,20 @@
|
|
|
72777
72807
|
],
|
|
72778
72808
|
"description": "A power scale’s exponent (*e.g.*, 0.5 for sqrt); defaults to 1 for a linear scale. For *pow* scales only."
|
|
72779
72809
|
},
|
|
72810
|
+
"rLabel": {
|
|
72811
|
+
"anyOf": [
|
|
72812
|
+
{
|
|
72813
|
+
"type": "string"
|
|
72814
|
+
},
|
|
72815
|
+
{
|
|
72816
|
+
"type": "null"
|
|
72817
|
+
},
|
|
72818
|
+
{
|
|
72819
|
+
"$ref": "#/definitions/ParamRef"
|
|
72820
|
+
}
|
|
72821
|
+
],
|
|
72822
|
+
"description": "A textual label to show on the axis or legend; if null, show no label. By default the scale label is inferred from channel definitions, possibly with an arrow (↑, →, ↓, or ←) to indicate the direction of increasing value."
|
|
72823
|
+
},
|
|
72780
72824
|
"rNice": {
|
|
72781
72825
|
"anyOf": [
|
|
72782
72826
|
{
|
|
@@ -84770,6 +84814,10 @@
|
|
|
84770
84814
|
"description": "A flag for cross-filtering, where selections made in a plot filter others but not oneself (default `false`, except for `crossfilter` selections).",
|
|
84771
84815
|
"type": "boolean"
|
|
84772
84816
|
},
|
|
84817
|
+
"empty": {
|
|
84818
|
+
"description": "A flag for setting an initial empty selection state. If true, a selection with no clauses corresponds to an empty selection with no records. If false, a selection with no clauses selects all values.",
|
|
84819
|
+
"type": "boolean"
|
|
84820
|
+
},
|
|
84773
84821
|
"select": {
|
|
84774
84822
|
"description": "The type of reactive parameter. One of:\n- `\"value\"` (default) for a standard `Param`\n- `\"intersect\"` for a `Selection` that intersects clauses (logical \"and\")\n- `\"union\"` for a `Selection` that unions clauses (logical \"or\")\n- `\"single\"` for a `Selection` that retains a single clause only\n- `\"crossfilter\"` for a cross-filtered intersection `Selection`",
|
|
84775
84823
|
"enum": [
|
|
@@ -85456,6 +85504,10 @@
|
|
|
85456
85504
|
"description": "An object of per-column alignment values. Column names should be object keys, which map to alignment values. Valid alignment values are: `\"left\"`, `\"right\"`, `\"center\"`, and `\"justify\"`. By default, numbers are right-aligned and other values are left-aligned.",
|
|
85457
85505
|
"type": "object"
|
|
85458
85506
|
},
|
|
85507
|
+
"as": {
|
|
85508
|
+
"$ref": "#/definitions/ParamRef",
|
|
85509
|
+
"description": "The output selection. A selection clause is added for each currently selected table row."
|
|
85510
|
+
},
|
|
85459
85511
|
"columns": {
|
|
85460
85512
|
"description": "A list of column names to include in the table grid. If unspecified, all table columns are included.",
|
|
85461
85513
|
"items": {
|
|
@@ -87343,6 +87395,20 @@
|
|
|
87343
87395
|
],
|
|
87344
87396
|
"description": "A power scale’s exponent (*e.g.*, 0.5 for sqrt); defaults to 1 for a linear scale. For *pow* scales only."
|
|
87345
87397
|
},
|
|
87398
|
+
"rLabel": {
|
|
87399
|
+
"anyOf": [
|
|
87400
|
+
{
|
|
87401
|
+
"type": "string"
|
|
87402
|
+
},
|
|
87403
|
+
{
|
|
87404
|
+
"type": "null"
|
|
87405
|
+
},
|
|
87406
|
+
{
|
|
87407
|
+
"$ref": "#/definitions/ParamRef"
|
|
87408
|
+
}
|
|
87409
|
+
],
|
|
87410
|
+
"description": "A textual label to show on the axis or legend; if null, show no label. By default the scale label is inferred from channel definitions, possibly with an arrow (↑, →, ↓, or ←) to indicate the direction of increasing value."
|
|
87411
|
+
},
|
|
87346
87412
|
"rNice": {
|
|
87347
87413
|
"anyOf": [
|
|
87348
87414
|
{
|
|
@@ -179672,6 +179738,10 @@
|
|
|
179672
179738
|
"description": "An object of per-column alignment values. Column names should be object keys, which map to alignment values. Valid alignment values are: `\"left\"`, `\"right\"`, `\"center\"`, and `\"justify\"`. By default, numbers are right-aligned and other values are left-aligned.",
|
|
179673
179739
|
"type": "object"
|
|
179674
179740
|
},
|
|
179741
|
+
"as": {
|
|
179742
|
+
"$ref": "#/definitions/ParamRef",
|
|
179743
|
+
"description": "The output selection. A selection clause is added for each currently selected table row."
|
|
179744
|
+
},
|
|
179675
179745
|
"columns": {
|
|
179676
179746
|
"description": "A list of column names to include in the table grid. If unspecified, all table columns are included.",
|
|
179677
179747
|
"items": {
|