You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Vega-Lite is still in alpha phase and we are working on improving the code and [documentation](Documentation).
7
+
**Vega-Lite is still in alpha phase and we are working on improving the code and [documentation](docs/Documentation.md).
8
8
Note that our syntax might change slightly before we release 1.0.**
9
9
10
10
Vega-Lite provides a higher-level grammar for visual analysis, comparable to ggplot or Tableau, that generates complete [Vega](https://vega.github.io/) specifications.
@@ -14,7 +14,7 @@ Vega-Lite specifications consist of simple mappings of variables in a data set t
14
14
If you are using Vega-Lite for your project(s), please let us know by emailing us at [Vega-Lite \[at\] cs.washington.edu](mailto:[email protected]). Feedback is also welcome.
15
15
If you find a bug or have a feature request, please [create an issue](https://github.com/vega/vega-lite/issues/new).
16
16
17
-
Use Vega-Lite in the [online editor](https://vega.github.io/vega-lite/).
17
+
__Try using Vega-lite in the online [Vega Editor](http://vega.github.io/vega-editor/?mode=vega-lite)__.
18
18
19
19
The complete schema for specifications as [JSON schema](http://json-schema.org/) is at [vega-lite-schema.json](https://vega.github.io/vega-lite/vega-lite-schema.json).
20
20
@@ -29,9 +29,9 @@ We have more example visualizations in our [gallery](https://vega.github.io/vega
| name | String | A field/variable from which to pull a data value. __<sup>1</sup>__|
21
-
| value | String,Integer ||
20
+
| name __<sup>1</sup>__| String | A field/variable from which to pull a data value. |
21
+
| value | String,Integer |A constant value|
22
22
| type | String | Data Type (`Q` for quantitative, `O` for ordinal, `T` for temporal, and `N` for nominal). __<sup>2</sup>__|
23
23
|[axis](#axis)| Object | Configuration object for the encoding's axis |
24
24
|[legends](#legends)| Object | Configuration object for the encoding's legends |
25
25
|[scale](#scale)| Object | Configuration object for the encoding's scale |
26
-
|[sort](#sort)| String \| Object | For all types of fields, if specified to `ascending` or `descending`, the domain values are sorted in based on the field's value in ascending or descending order. For nominal and ordinal fields, if set to an object, the values in the scale domain will be sorted based on an aggregate calculation over a specified sort field. <!-- TODO say what happen when sort is unspecified. --> See [Sort](#sort) section for more information. |
27
-
|[aggregate](#aggregate)| String | Aggregation function for the field (`mean`, `sum`, `median`, `min`, `max`, `count`) |
28
-
29
-
|[bin](#bin)| Object | Binning properties. See [Binning](#Binning)|
26
+
|[sort](#sort)| String \| Object | Sort order for a particular field. This can be string (`'ascending'`, `'descending'`, or `'unsorted'`) or a sort field definition object for sorting by an aggregate calculation of a specified sort field. If unspecified, the default value is `ascending`. See [Sort](#sort) section for more information. |
27
+
|[aggregate](#aggregate)| String | Aggregation function for the field (e.g., `mean`, `sum`, `median`, `min`, `max`, `count`) |
28
+
|[bin](#bin)| Boolean \| Object | Binning properties. See [Binning](#Binning)|
30
29
|[timeUnit](#timeunit)| String | Property for converting time unit |
If at least one of the specified encoding channel contains aggregation, a summary data table (`aggregate`) will be computed from the source data table (after binning and time unit have been derived) and the resulting visualization shows data from this summary table. In this case, all fields without aggregation function specified are treated as dimensions. The summary statistics are grouped by these dimensions.
66
73
@@ -116,9 +123,9 @@ Moreover, Vega-lite supports the following additional axis properties.
116
123
| titleOffset | Integer | Offset between the axis title and the axis. |
117
124
118
125
<sup>1</sup>
119
-
If `grid` is unspecified, the default value is `true` for ROW and COL. For X
120
-
and Y, the default value is `true` for quantitative and time fields and `false`
121
-
otherwise.
126
+
If `grid` is unspecified, the default value is `true` for ROW and COL.
127
+
For X and Y, the default value is `true` for (1) quantitative fields that are not binned and (2) time fields.
128
+
Otherwise, the default value is `false`.
122
129
123
130
<sup>2</sup>
124
131
If `title` is unspecified, the default value is produced from the field's name and transformation function applied e.g, "field_name", "SUM(field_name)", "BIN(field_name)", "YEAR(field_name)".
@@ -142,17 +149,20 @@ For now please see [legends json schema in schema.js](https://github.com/uwdata/
142
149
143
150
## sort
144
151
145
-
`sort` property can be specify for sorting the field's values in multiple ways:
152
+
`sort` property can be specify for sorting the field's values in two ways:
153
+
154
+
1. (Supported by all types of fields) as __String__ with the following values:
155
+
-`'ascending'` – the field is sort by the field's value in ascending order. This is the default value when `sort` is not specified.
156
+
-`'descending'` – the field is sort by the field's value in descending order.
157
+
-`'unsorted`' – The field is not sorted. (This is equivalent to specifying `sort:false` in [Vega's scales](https://github.com/vega/vega/wiki/Scales).)
146
158
147
-
-`undefined` - the field is unsorted.
148
-
- (as __String__) `'ascending'` or `'descending'` – the field is sort by the field's value in ascending or descending order.
149
-
- (as __Object__) A sort field object - for sorting the field by an aggregate calculation over a specified sort field. A sort field object has the following properties:
159
+
2. (Supported by nominal and ordinal fields only) as a __sort field definition object__ - for sorting the field by an aggregate calculation over another sort field. A sort field object has the following properties:
0 commit comments