Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Revise window transform + Add Docs / Examples #3199

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ec345b8
Fix broken link to site examples gallery at CONTRIBUTE.md (#3555)
italo-batista Mar 19, 2018
c96dbef
Make bar starting point correct when a custom domain that include zer…
kanitw Mar 20, 2018
7ed8832
Refactor `zeroOrMin/Max` logic to be only a part of `pointPosition`/`…
kanitw Mar 20, 2018
3c047e9
Refactor model.mark() to be a getter
kanitw Mar 20, 2018
db976d5
Throw warning for bar/area with log/time scale, with zero = false, or…
kanitw Mar 20, 2018
d72d739
Follow up fixes
kanitw Mar 20, 2018
9430496
Update TOC
domoritz Mar 21, 2018
c264f9d
Zero works for subsequent layers when default angle not specified (#3…
swojit Mar 22, 2018
8f457b1
DOC: Change default nominal scheme reference
eitanlees Mar 23, 2018
cfb550c
Add links to color schemes
domoritz Mar 23, 2018
bfde11a
Added documentation for window transform
AkshatSh Mar 18, 2018
6ee30ec
Examples for WindowTransform
AkshatSh Mar 18, 2018
753452c
Resolved code comments
AkshatSh Mar 18, 2018
600b901
Updated examples and added new exampels for window transform
AkshatSh Mar 19, 2018
4edebfd
Updated code comments, and updated docs to contain examples
AkshatSh Mar 19, 2018
010d953
Updated vega-lite-schema.json
AkshatSh Mar 19, 2018
52b2dd7
Updated examples, and resolved some issues
AkshatSh Mar 20, 2018
d7d7476
included build file
AkshatSh Mar 20, 2018
2d85080
removed json blobs
AkshatSh Mar 24, 2018
49260ca
Resolving comments
AkshatSh Mar 24, 2018
6e80eab
[WIP] resolving comments
AkshatSh Mar 25, 2018
0b5fe97
Don't include non-existing type template
kanitw Mar 25, 2018
cc5d7ee
fixed example name in window.md
AkshatSh Mar 25, 2018
5b791d7
fixed mark issues for tests
AkshatSh Mar 25, 2018
a5fc1ca
Update doc versions and TOC
kanitw Mar 25, 2018
c33a33d
Simplify window_transform_activities
kanitw Mar 25, 2018
af7a3e1
Add Rule to mean difference example
kanitw Mar 25, 2018
a488051
Update examples more
kanitw Mar 25, 2018
f22bab6
Resolve broken links
kanitw Mar 25, 2018
8bdc1fa
Added introduction before specs in window.md
AkshatSh Mar 25, 2018
b1827df
fixed default value false issue
AkshatSh Mar 25, 2018
0b660e9
added introduction for examples in window.md
AkshatSh Mar 25, 2018
4214e3f
fixed style on examples
AkshatSh Mar 25, 2018
749b3cc
renamed examples
AkshatSh Mar 25, 2018
2634c56
Fix descriptions in the schema
kanitw Mar 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ You can find [tasks with the "Help wanted" label in the issue tracker](https://g

### Help Create New Examples

To submit a new example, fork our [example Block](https://bl.ocks.org/domoritz/455e1c7872c4b38a58b90df0c3d7b1b9) and send us a [pull request to add a link](https://github.com/vega/vega-lite/edit/master/site/examples/gallery.md) to it to our [example gallery](https://vega.github.io/vega-lite/examples/).
To submit a new example, fork our [example Block](https://bl.ocks.org/domoritz/455e1c7872c4b38a58b90df0c3d7b1b9) and send us a [pull request to add a link](https://github.com/vega/vega-lite/edit/master/site/examples/index.md) to it to our [example gallery](https://vega.github.io/vega-lite/examples/).

## Documentation and Website

Expand Down
10 changes: 10 additions & 0 deletions _data/link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,23 @@ TimeUnit:
link: timeunit.html
LookupData:
link: "lookup.html#lookup-data"
Window:
link: window.html

# Transform - Time Unit
Month:
name: Number
Day:
name: Number

# Transform - Window
WindowFieldDef:
link: window.html#field-def
WindowSortField:
link: window.html#sort-field-def
WindowOnlyOp:
link: window.html#ops

# Mark
AnyMark:
name: Mark
Expand Down
59 changes: 26 additions & 33 deletions _includes/docs_toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,71 +52,64 @@
- [Time Unit in Encoding Field Definition]({{site.baseurl}}/docs/timeunit.html#encoding)
- [Time Unit Transform]({{site.baseurl}}/docs/timeunit.html#transform)
- [UTC time]({{site.baseurl}}/docs/timeunit.html#utc)
- [Window]({{site.baseurl}}/docs/window.html)
- [Window Field Definition]({{site.baseurl}}/docs/window.html#window-field-definition)
- [Window Transform Definition]({{site.baseurl}}/docs/window.html#window-transform-definition)
- [
Window Only Operation Reference]({{site.baseurl}}/docs/window.html#-window-only-operation-reference)
- [Examples]({{site.baseurl}}/docs/window.html#examples)
- [Mark]({{site.baseurl}}/docs/mark.html)
- [Documentation Overview]({{site.baseurl}}/docs/mark.html#documentation-overview)
- [Mark Definition Object]({{site.baseurl}}/docs/mark.html#mark-def)
- [Mark Config]({{site.baseurl}}/docs/mark.html#config)
- [Mark Style Config]({{site.baseurl}}/docs/mark.html#style-config)
- [Area]({{site.baseurl}}/docs/area.html)
- [Documentation Overview]({{site.baseurl}}/docs/area.html#documentation-overview)
- [Area Chart]({{site.baseurl}}/docs/area.html#area-chart)
- [Stacked Area Chart]({{site.baseurl}}/docs/area.html#stacked-area-chart)
- [Normalized Stacked Area Chart]({{site.baseurl}}/docs/area.html#normalized-stacked-area-chart)
- [Streamgraph]({{site.baseurl}}/docs/area.html#streamgraph)
- [Ranged Area]({{site.baseurl}}/docs/area.html#ranged)
- [Area Mark Properties]({{site.baseurl}}/docs/area.html#properties)
- [Examples]({{site.baseurl}}/docs/area.html#examples)
- [Area Config]({{site.baseurl}}/docs/area.html#config)
- [Bar]({{site.baseurl}}/docs/bar.html)
- [Documentation Overview]({{site.baseurl}}/docs/bar.html#documentation-overview)
- [Single Bar Chart]({{site.baseurl}}/docs/bar.html#single-bar-chart)
- [Bar Chart]({{site.baseurl}}/docs/bar.html#bar-chart)
- [Histogram]({{site.baseurl}}/docs/bar.html#histogram)
- [Stacked Bar Chart]({{site.baseurl}}/docs/bar.html#stack)
- [Layered Bar Chart]({{site.baseurl}}/docs/bar.html#layered-bar-chart)
- [Normalized Stacked Bar Chart]({{site.baseurl}}/docs/bar.html#normalized-stacked-bar-chart)
- [Grouped Bar Chart]({{site.baseurl}}/docs/bar.html#grouped-bar-chart)
- [Ranged Bars]({{site.baseurl}}/docs/bar.html#ranged)
- [Bar Mark Properties]({{site.baseurl}}/docs/bar.html#properties)
- [Examples]({{site.baseurl}}/docs/bar.html#examples)
- [Bar Config]({{site.baseurl}}/docs/bar.html#config)
- [Circle]({{site.baseurl}}/docs/circle.html)
- [Scatterplot with Circle]({{site.baseurl}}/docs/circle.html#scatterplot-with-circle)
- [Circle Mark Properties]({{site.baseurl}}/docs/circle.html#properties)
- [Examples]({{site.baseurl}}/docs/circle.html#examples)
- [Circle Config]({{site.baseurl}}/docs/circle.html#config)
- [Line]({{site.baseurl}}/docs/line.html)
- [Documentation Overview]({{site.baseurl}}/docs/line.html#documentation-overview)
- [Line Chart]({{site.baseurl}}/docs/line.html#line-chart)
- [Multi-series Line Chart with the Detail Channel]({{site.baseurl}}/docs/line.html#line-detail)
- [Connected Scatter Plot (Line Chart with Custom Path)]({{site.baseurl}}/docs/line.html#connected-scatter-plot)
- [Line interpolation]({{site.baseurl}}/docs/line.html#line-interpolation)
- [Geo Line]({{site.baseurl}}/docs/line.html#geo-line)
- [Line Mark Properties]({{site.baseurl}}/docs/line.html#properties)
- [Examples]({{site.baseurl}}/docs/line.html#examples)
- [Line Config]({{site.baseurl}}/docs/line.html#config)
- [Point]({{site.baseurl}}/docs/point.html)
- [Documentation Overview]({{site.baseurl}}/docs/point.html#documentation-overview)
- [Dot Plot]({{site.baseurl}}/docs/point.html#dot-plot)
- [Scatter Plot]({{site.baseurl}}/docs/point.html#scatter-plot)
- [Bubble Plot]({{site.baseurl}}/docs/point.html#bubble-plot)
- [Scatter Plot with Color and/or Shape]({{site.baseurl}}/docs/point.html#color)
- [Geo Point]({{site.baseurl}}/docs/point.html#geo-point)
- [Point Mark Properties]({{site.baseurl}}/docs/point.html#properties)
- [Examples]({{site.baseurl}}/docs/point.html#examples)
- [Point Config]({{site.baseurl}}/docs/point.html#config)
- [Rect]({{site.baseurl}}/docs/rect.html)
- [Documentation Overview]({{site.baseurl}}/docs/rect.html#documentation-overview)
- [Rect Mark Properties]({{site.baseurl}}/docs/rect.html#rect-mark-properties)
- [Examples]({{site.baseurl}}/docs/rect.html#examples)
- [Rect Config]({{site.baseurl}}/docs/rect.html#config)
- [Rule]({{site.baseurl}}/docs/rule.html)
- [Documentation Overview]({{site.baseurl}}/docs/rule.html#documentation-overview)
- [Width/Height-Spanning Rules]({{site.baseurl}}/docs/rule.html#widthheight-spanning-rules)
- [Ranged Rules]({{site.baseurl}}/docs/rule.html#ranged)
- [Rule Mark Properties]({{site.baseurl}}/docs/rule.html#properties)
- [Examples]({{site.baseurl}}/docs/rule.html#examples)
- [Rule Config]({{site.baseurl}}/docs/rule.html#config)
- [Square]({{site.baseurl}}/docs/square.html)
- [Scatterplot with Square]({{site.baseurl}}/docs/square.html#scatterplot-with-square)
- [Square Mark Properties]({{site.baseurl}}/docs/square.html#properties)
- [Example: Scatterplot with Square]({{site.baseurl}}/docs/square.html#example-scatterplot-with-square)
- [Square Config]({{site.baseurl}}/docs/square.html#config)
- [Text]({{site.baseurl}}/docs/text.html)
- [Documentation Overview]({{site.baseurl}}/docs/text.html#documentation-overview)
- [Text Table Heatmap]({{site.baseurl}}/docs/text.html#text-table-heatmap)
- [Labels]({{site.baseurl}}/docs/text.html#labels)
- [Scatterplot with Text]({{site.baseurl}}/docs/text.html#scatterplot-with-text)
- [Geo Text]({{site.baseurl}}/docs/text.html#geo-text)
- [Text Mark Properties]({{site.baseurl}}/docs/text.html#properties)
- [Examples]({{site.baseurl}}/docs/text.html#examples)
- [Text Config]({{site.baseurl}}/docs/text.html#config)
- [Tick]({{site.baseurl}}/docs/tick.html)
- [Documentation Overview]({{site.baseurl}}/docs/tick.html#documentation-overview)
- [Dot Plot]({{site.baseurl}}/docs/tick.html#dot-plot)
- [Strip Plot]({{site.baseurl}}/docs/tick.html#strip-plot)
- [Tick Mark Properties]({{site.baseurl}}/docs/tick.html#properties)
- [Examples]({{site.baseurl}}/docs/tick.html#examples)
- [Tick Config]({{site.baseurl}}/docs/tick.html#config)
- [Geoshape]({{site.baseurl}}/docs/geoshape.html)
- [Geoshape Config]({{site.baseurl}}/docs/geoshape.html#config)
Expand Down
2 changes: 2 additions & 0 deletions _layouts/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
url: lookup
- text: Time Unit
url: timeunit
- text: Window
url: window
- text: Mark
url: mark
sub-sidebar:
Expand Down
21 changes: 12 additions & 9 deletions build/vega-lite-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7314,11 +7314,11 @@
"additionalProperties": false,
"properties": {
"as": {
"description": "The output name for each field. If none is defined will use the format op_field. For example, count_field for count,\n and sum_field for sum.",
"description": "The output name for each field.",
"type": "string"
},
"field": {
"description": "The data fields for which to compute aggregate or window functions. Field can be omitted for operations that do not\noperate over a specific data field, including count, rank, and dense_rank.",
"description": "The data field for which to compute the aggregate or window function. This can be omitted for functions that do not operate over a field such as `count`, `rank`, `dense_rank`.",
"type": "string"
},
"op": {
Expand All @@ -7330,15 +7330,16 @@
"$ref": "#/definitions/WindowOnlyOp"
}
],
"description": "The operations supported for the window aggregation. See the list of supported operations here:\n https://vega.github.io/vega-lite/docs/transforms/window.html"
"description": "The window or aggregation operations to apply within a window, including `rank`, `lead`, `sum`, `average` or `count`. See the list of all supported operations [here](https://vega.github.io/vega-lite/docs/transforms/window.html)."
},
"param": {
"description": "Parameter values for the window functions. Parameter value can be null for operations that do not accept a\nparameter.",
"description": "Parameter values for the window functions. Parameter values can be omitted for operations that do not accept a parameter.\n\nSee the list of all supported operations and their parameters [here](https://vega.github.io/vega-lite/docs/transforms/window.html).",
"type": "number"
}
},
"required": [
"op"
"op",
"as"
],
"type": "object"
},
Expand All @@ -7363,9 +7364,11 @@
"description": "A compartor for fields within the window transform",
"properties": {
"field": {
"description": "The name of the field to sort.",
"type": "string"
},
"order": {
"description": "Whether to sort the field in ascending or descending order.",
"enum": [
"ascending",
"descending"
Expand All @@ -7382,7 +7385,7 @@
"additionalProperties": false,
"properties": {
"frame": {
"description": "The frame for the window, if none is set the default is `[null, 0]` everything before the\ncurrent item.",
"description": "A frame specification as a two-element array indicating how the sliding window should proceed. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. The default value is `[null, 0]`, indicating that the sliding window includes the current object and all preceding objects. The value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object. Finally, `[null, null]` indicates that the window frame should always include all data objects.\n\n__Default value:__: `[null, 0]` (includes the current object and all preceding objects)",
"items": {
"type": [
"null",
Expand All @@ -7392,18 +7395,18 @@
"type": "array"
},
"groupby": {
"description": "The fields to group by.",
"description": "The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be a single group.",
"items": {
"type": "string"
},
"type": "array"
},
"ignorePeers": {
"description": "Will indicate whether to ignore peer values (items with the same rank) in the window. The default value is `False`.",
"description": "Indicates if the sliding window frame should ignore peer values. (Peer values are those considered identical by the sort criteria). The default is false, causing the window frame to expand to include all peer values. If set to true, the window frame will be defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.\n\n__Default value:__ `false`",
"type": "boolean"
},
"sort": {
"description": "The definitions of how to sort each of the fields in the window.",
"description": "A comparator definition for sorting data objects within a window. If two data objects are considered equal by the comparator, they are considered “peer” values of equal rank. If sort is not specified, the order is undefined: data objects are processed in the order they are observed and none are considered peers (the ignorePeers parameter is ignored and treated as if set to `true`).",
"items": {
"$ref": "#/definitions/WindowSortField"
},
Expand Down
10 changes: 4 additions & 6 deletions examples/compiled/area_horizon.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@
"field": "y"
},
"y2": {
"field": {
"group": "height"
}
"scale": "y",
"value": 0
}
}
}
Expand Down Expand Up @@ -209,9 +208,8 @@
"field": "ny"
},
"y2": {
"field": {
"group": "height"
}
"scale": "y",
"value": 0
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/circle_natural_disasters.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@
"scale": "x",
"orient": "bottom",
"title": "Year",
"labelOverlap": true,
"encode": {
"labels": {
"update": {
Expand All @@ -147,6 +146,7 @@
}
}
},
"labelOverlap": true,
"zindex": 1
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/compiled/layer_bar_annotations.vg.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@
"scale": "x",
"orient": "bottom",
"title": "Day",
"labelOverlap": true,
"encode": {
"labels": {
"update": {
Expand All @@ -373,6 +372,7 @@
}
}
},
"labelOverlap": true,
"zindex": 1
},
{
Expand Down
Loading