python-plotto 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

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.
plotto/__init__.py CHANGED
@@ -3,7 +3,7 @@
3
3
  https://github.com/theoradusz/plotto
4
4
  """
5
5
 
6
- __version__ = "0.6.0"
6
+ __version__ = "0.7.0"
7
7
 
8
8
  from .plot import Plot, plot # noqa: E402
9
9
 
plotto/_assets/README.md CHANGED
@@ -70,7 +70,7 @@ draw(plot(rows, { x: "time", y: "value", color: "sensor" }).line().facet("indica
70
70
  ### Data
71
71
 
72
72
  - Use long format: one row per observation, one column per variable.
73
- - Python takes a pandas DataFrame or a list of dicts. JavaScript takes an array of row objects.
73
+ - Python takes a pandas DataFrame (also a GeoDataFrame) or a list of dicts. JavaScript takes an array of row objects. Both take a GeoJSON FeatureCollection.
74
74
  - A time-zone-aware datetime column shows its local clock time.
75
75
  - To set the order of categories, use a pandas categorical column or `x(limits=[...])`.
76
76
 
@@ -81,6 +81,15 @@ draw(plot(rows, { x: "time", y: "value", color: "sensor" }).line().facet("indica
81
81
  | Axis range | `x(limits=[0, 10])`; `y(limits=[0, None])` keeps the data bound on the `None` side |
82
82
  | Category order | `x(limits=["low", "mid", "high"])` |
83
83
  | Log axis, time labels | `y(type="log")`; `x(format="%a %H:%M")` |
84
+ | Set ticks and their text | `x(type="log", breaks=[1, 1.5, 2, 3, 5, 10])`; `y(breaks=[0, 50], labels=["none", "50"])` |
85
+ | Colors side by side in a category | `point(position="dodge")`, `segment(..., position="dodge")`: on a category x or y |
86
+ | Name lines at their ends | `line(direct=True)` with `theme(legend="none")` |
87
+ | Areas from GeoJSON or a GeoDataFrame | `plot(geojson).polygon(fill="households", tooltip="name")`; outlines only: `polygon()` |
88
+ | Classes with a stepped legend | `fill(breaks=[0, 50, 1000, 10000])`; class names: `labels=[...]`; the same for `color()` |
89
+ | Maps | `coord("geo")`: x = longitude, y = latitude, equal distance per px, degree labels; `coord("geo", scalebar=True, north=True)` |
90
+ | Distant areas in the same figure | `inset(x=[122.9, 131.4], y=[24.0, 28.6], at=[0.02, 0.6, 0.3, 0.98])` |
91
+ | Labels that do not overlap | `text(label="name", repel=True)` |
92
+ | A grid under the map (1 km intensity mesh) | `raster(data=grid, x="lon", y="lat", fill="intensity")` with `fill(breaks=...)` |
84
93
  | Category colors | `color(palette="sakura")`, or `color(values={"a": "red", "b": "#123456"})` |
85
94
  | Number colors | `color(scheme="ai")`; diverging: `color(scheme="aiaka", mid=0)` |
86
95
 
plotto/_assets/SPEC.md CHANGED
@@ -39,9 +39,11 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
39
39
  | `layers[].mapping` | Layer channels → column names |
40
40
  | `layers[].set` | Constants: channel values and options |
41
41
  | `facet` | `{wrap, free, ncol}`, `{rows, cols, free}` or `null` |
42
- | `scales` | `x`, `y`: `type`, `limits`, `format`. `color`: `values`, `palette`, `scheme`, `limits`, `mid`, `clamp`. |
43
- | `labels` | `title`, `subtitle`, `caption`, `x`, `y`, `color`. `null` removes a title. A missing key uses the first mapped column name. |
42
+ | `scales` | `x`, `y`: `type`, `limits`, `format`, `breaks`, `labels`. `color`, `fill`: `values`, `palette`, `scheme`, `limits`, `mid`, `clamp`, `breaks`, `labels`. |
43
+ | `labels` | `title`, `subtitle`, `caption`, `x`, `y`, `color`, `fill`. `null` removes a title. A missing key uses the first mapped column name. |
44
44
  | `info` | Optional. `entries`: `[key, value]` pairs in order; a value is a string, a number, a boolean or `null`. `position`: `right` or `bottom`; without it, `right`, or the place with the most room in a fixed size. |
45
+ | `coord` | Optional. `{type: "geo", scalebar?, north?}`: map coordinates, with the corners of the scale bar and the north arrow (§5) |
46
+ | `insets` | Optional. `[{x: [low, high], y: [low, high], at: [left, bottom, right, top]}]`: inset panels (§6) |
45
47
  | `theme` | `style`, `format`, and the overrides `width`, `height`, `size`, `legend` |
46
48
 
47
49
  ### Column types
@@ -51,10 +53,13 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
51
53
  | `number` | numbers | numeric dtypes | `number` |
52
54
  | `time` | wall-clock epoch ms | `datetime64`. A time-zone-aware column keeps its local clock time. | `Date` (local clock time) |
53
55
  | `string` | strings | object, string, bool (`"true"`, `"false"`), categorical (with `levels`) | any other value |
56
+ | `geometry` | GeoJSON geometries (`{type, coordinates}`) | values with `__geo_interface__` (a GeoDataFrame geometry column, shapely) or GeoJSON dicts | GeoJSON geometry objects |
54
57
 
55
58
  - Times are wall-clock times. The axis shows the clock time of the data, in every output and every time zone.
56
59
  - A float that is not an integer keeps 6 significant digits.
57
60
  - The builders send only the columns that a mapping or a facet uses.
61
+ - Geometry coordinates keep 5 decimals (about 1 m in degrees).
62
+ - `plot()` and the `data` of a layer also take a GeoJSON FeatureCollection: one row per feature, with its properties as columns and its geometry in the column `geometry`.
58
63
 
59
64
  ## 3. Builder rules
60
65
 
@@ -73,10 +78,10 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
73
78
 
74
79
  | Method | Channels | Options | Statistic | Observable Plot mark |
75
80
  |---|---|---|---|---|
76
- | `line` | x, y, color, group, tooltip | size, alpha, dash, summary | `summary` | `line`, sorted by x |
81
+ | `line` | x, y, color, group, tooltip | size, alpha, dash, summary, direct | `summary` | `line`, sorted by x; `text` for the direct labels |
77
82
  | `path` | x, y, color, group, tooltip | size, alpha, dash | – | `line`, in row order |
78
83
  | `step` | x, y, color, group, tooltip | size, alpha, dash | – | `line`, step after each point |
79
- | `point` | x, y, color, tooltip | size, alpha, jitter, summary | `summary` | `dot` |
84
+ | `point` | x, y, color, tooltip | size, alpha, jitter, summary, position | `summary`, dodge | `dot` |
80
85
  | `bar` | x, y, color, tooltip | alpha, position | stack or dodge | `barY` (category x), `rect` (number or time x, 90% of the data step) |
81
86
  | `hist` | x, color | alpha, bins, density, position | bins | `rect` |
82
87
  | `density` | x, color | size, alpha, dash | Gaussian kernel density | `areaY` + `line` |
@@ -85,12 +90,14 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
85
90
  | `smooth` | x, y, color | size, alpha, dash, method, span, band | linear fit or loess | `areaY` (band) + `line` |
86
91
  | `hline`, `vline` | y or x, color | size, alpha, dash | – | `ruleY`, `ruleX` |
87
92
  | `abline` | color | slope, intercept, size, alpha, dash | – | `line` across the x domain |
88
- | `segment` | x, y, xend, yend, color | size, alpha, dash | – | `link` |
93
+ | `segment` | x, y, xend, yend, color | size, alpha, dash, position | dodge | `link` |
89
94
  | `rect` | xmin, xmax, ymin, ymax, color, tooltip | alpha | – | `rect` |
90
95
  | `band` | xmin, xmax, ymin, ymax, color | alpha | – | `rect`. A missing bound is the panel edge. |
91
96
  | `tile` | x, y, color, tooltip | alpha | – | `cell` (two categories), `barX`/`barY` (one category), `rect` (two numbers) |
92
- | `text` | x, y, label, color | size, alpha | – | `text` |
93
- | `errorbar` | x, ymin, ymax, color | size, alpha | – | `ruleX` and two caps |
97
+ | `text` | x, y, label, color | size, alpha, repel | – | `text`; with `repel`, leader lines (`path`) |
98
+ | `errorbar` | x, ymin, ymax, color | size, alpha, position | dodge | `ruleX` and two caps |
99
+ | `polygon` | geometry, fill, color, tooltip | size, alpha | – | `geo`, through the x and y scales |
100
+ | `raster` | x, y, fill | alpha | the grid of the cells | one `image` (a PNG) in an `svg` clipped to the frame |
94
101
  | `box` | x, y, color | alpha (of the box fill, default 0.3) | Tukey box per category (`boxStats` in `stats.js`): quartiles, whiskers to the last values within 1.5 IQR, outliers | `barY` (q1 to q3, outlined in the series color), `tickY` (bold median and whisker caps), `ruleX` (whiskers), `dot` (outliers, in the series color) |
95
102
 
96
103
  | Option | Values | Meaning |
@@ -100,18 +107,25 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
100
107
  | `dash` | `solid`, `dashed`, `dotted`, `dashdot` | Line pattern |
101
108
  | `jitter` | number | Random horizontal offset, as a share of the category width or of the x step. The seed is fixed, so each output is the same. |
102
109
  | `summary` | `mean`, `median`, `min`, `max`, `sum` | One row per (x, color, group), with the summary of y |
103
- | `position` | `stack` (default), `dodge` (bar only), `overlay` | Stack: the colors add up at each x, in the legend order. Dodge: one bar per color, side by side. Overlay: each color starts at 0; fills are see-through. |
110
+ | `position` | `stack`, `dodge`, `overlay` | Bars and areas (default `stack`): the colors add up at each x, in the legend order. Dodge (bars): one bar per color, side by side. Overlay: each color starts at 0; fills are see-through. Points, segments and error bars (default `overlay`; `stack` is an error): dodge puts each color in its own slot of the category band (below). |
104
111
  | `bins` | number | About this number of bins on round values (default 30). All panels and colors use the same bins. |
105
112
  | `density` | `true`, `false` | `hist` counts divided by (rows × bin width), so the area is 1 |
106
113
  | `method` | `lm` (default), `loess` | `lm`: least squares with a 95% confidence band (Student t). `loess`: local linear fit with tricube weights, without a band. |
107
114
  | `span` | 0–1 | The share of the points in each local fit of `loess` (default 0.75) |
108
115
  | `band` | `true` (default), `false` | The confidence band of `lm` |
116
+ | `direct` | `true`, `false` (default) | The name of each line at its end (below) |
117
+ | `repel` | `true`, `false` (default) | Text labels move to a free place near their point (below) |
109
118
 
110
- - `color` maps the stroke of lines and the fill of points, bars, areas, rects, tiles and text.
119
+ - `color` maps the stroke of lines and the fill of points, bars, areas, rects, tiles and text, and the outline of polygons. `fill` maps the fill of polygons and rasters.
111
120
  - A line, path or step without `group` has one line per color value. A missing value (`null`) makes a gap.
112
121
  - A layer without columns, for example `hline(y=0)`, draws once in each panel.
113
122
  - A layer table without the facet column draws in each panel.
114
123
  - A statistic runs on the rows of each panel, after the legend filter. Bin edges do not depend on the panel.
124
+ - Dodge of `point`, `segment` and `errorbar`: the band of each category has one slot per color of the plot, in the legend order, so a color has the same place in every category, panel and layer, and the segments of a color meet its points. A color that the legend hides leaves its slot empty. The slots are along the category axis: x, else y (`errorbar` draws vertical bars, so it needs a category x). Dodge needs a category axis and a color mapped to a string column; a constant color takes the center. The caps of an error bar are 30% of the band, or 60% of a slot.
125
+ - `polygon` draws the GeoJSON `Polygon` and `MultiPolygon` geometries of a geometry column, with x as the first coordinate (longitude) and y as the second (latitude). Holes stay empty (even-odd rule). Without `geometry`, it takes the column named `geometry`. `fill` fills the areas (a column, through the fill scale, or a color); `color` is the outline. Without `fill`, it draws outlines in `muted`, 0.6 px; with `fill`, thin outlines (0.5 px) in the `background` color separate the areas. `size` is the outline width; `alpha` the opacity of the fill (or of the outline without fill). The bounding boxes of the geometries train the axis domains. A geometry column goes to `geometry` only.
126
+ - `raster` draws a regular grid of cells (one row per cell center, for example a 1 km mesh of seismic intensity) as one image of one pixel per cell, colored by the fill scale, without smoothing, under the layers after it. The grid step in x and y is the mean of the gaps between neighbouring distinct values over the number of steps that each gap spans (refined three times), so values with 6 significant digits keep their columns; a missing cell, or a `null` fill, is transparent. A value more than a quarter of a step off the grid is an error. The cell edges train the axis domains. x and y must be number or time axes. The PNG is made once per figure and a zoom moves it; Node and the browser write the same bytes.
127
+ - `text(repel=true)` places each label, in row order (put the important ones first), at the first free place around its anchor: right, upper right, lower right, left, upper left, lower left, above, below (0.4 em beside, 0.2 em above or below, beyond a point drawn there), then on rings 0.5 em apart, up to 10 em. A place is free when the label is inside the panel and clear of the labels placed before, of the anchors, of the points of the `point` layers of the panel, of the insets and of the scale bar and north arrow. When no place is free, the label goes to the right of its anchor anyway. A label further than 1.5 em from its anchor gets a thin leader line in `muted`. The placement uses the font metrics (the same in Node and the browser) and runs again at each zoom.
128
+ - Direct labels (`line(direct=true)`): each series (the `group` value, else the `color` value) gets its name right of its last point in view, in its color, darkened (or lightened on a dark background) to a contrast of 3:1 at least. A long name wraps to 2 lines, at most 160 px or 20% of the figure width. Labels that would overlap move apart vertically, and stay in the panel when there is room. Each panel gets a right margin for the longest name; the legend stays unless `theme(legend="none")`.
115
129
 
116
130
  ## 5. Scales
117
131
 
@@ -121,7 +135,8 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
121
135
  - The axis domain trains on the layer views, which include the statistics. For example, it includes the 0 of a bar and the top of a stack.
122
136
  - The first view is `limits` when it is set. A `null` bound keeps the data bound on that side, with its 5% space. Without limits, the first view is the data range plus 5% on each side.
123
137
  - A category axis shows the categories in the `limits` order, then in the `levels` order, then in natural sort order. A label that is too wide for its band wraps at its spaces, to 3 lines at most. If a word is still too wide, all labels rotate by 40°; a rotated label gets 60% of the panel height (at least 10 em) and ends with an ellipsis beyond it, and the left margin grows so that the first one is not cut off.
124
- - Continuous axes have major ticks and minor grid lines at the midpoints. A log axis has ticks at the powers of ten, with minor lines at 2–9 times each power.
138
+ - Continuous axes have major ticks and minor grid lines at the midpoints. A log axis has ticks at the powers of ten, with minor lines at 2–9 times each power; with fewer than three powers of ten in view, it has ticks at 1, 2 and 5 times each power.
139
+ - `breaks` (a list of numbers or times) sets the major ticks of a number, log or time axis, with no minor grid lines; a zoom keeps them, and a break outside the view does not show. `labels` (strings, one per break) are the tick labels; without them, the label is `format`, or `~g` (log), `,~r` (linear) or the time pattern. Breaks on a category axis are an error.
125
140
  - Time labels are on one line. The pattern follows the tick step: `%Y-%m`, `%m-%d`, `%m-%d %H:%M` (more than one day in view), `%H:%M` or `%H:%M:%S`. `format`, a d3-format or d3-time-format string, replaces it.
126
141
 
127
142
  ### Color
@@ -130,15 +145,42 @@ builder → spec → normalize (spec.js) → views (views.js, stats.js) → scal
130
145
  |---|---|---|
131
146
  | `string` | One color per category: `values` (a list, or a map category → color), else `palette`, else the style palette, in order | Swatches: a square for fills, a line for lines, a point for points |
132
147
  | `number`, `time` | `values` (a list of colors), else `scheme`, else the style scheme | A color ramp |
148
+ | `number`, `time`, with `breaks` | One color per class: `values` (a list of one color per break), else the scheme at the middle of each class | Steps: one box per class |
133
149
 
150
+ There are two color scales: `color` (`color()`, the `color` channel) and `fill` (`fill()`, the `fill` channel of `polygon` and `raster`). They have the same options, each its own legend, and they can map different columns: for example the outage of each area (`fill`) and the class of each town (`color`).
151
+
152
+ - `breaks` (numbers or times that increase) make a binned scale. The classes are `[b0, b1)`, …, `[b(n-1), bn)` and `[bn, ∞)`: one class per break, closed on the left. They depend on the breaks only, so two plots with the same breaks have the same colors. A value below `b0` is `muted` (with `clamp: true`, the first class) and has no legend entry; `null` is `muted`. `labels` (one per break) names the classes. `mid` and a map of `values` do not apply. Breaks on a string column are an error.
153
+ - The steps legend has one box per class, low to high: left to right at the bottom, bottom to top on the right. The break values (format `,~r`, or the time pattern) are at the lower edge of each box; class names (`labels`) are on the boxes.
134
154
  - `limits` sets the categories (and their order) or the range of the color scale. A `null` bound keeps the data bound.
135
155
  - `mid` makes a diverging scale: `mid` takes the center color of the scheme, and each side stretches to its limit.
136
156
  - A list of colors and a plotto scheme interpolate in Lab space. A d3 scheme name (such as `viridis` or `blues`) uses the d3 interpolator.
137
157
  - A continuous value outside the domain is `muted`. `clamp: true` gives it the end color.
138
- - All color mappings of one plot must use the same column.
158
+ - All the color mappings of one scale must use the same column.
159
+ - A plot with mappings on both scales stacks the two legends (color first), at the right or at the bottom. The fill legend does not toggle values.
139
160
  - A long legend wraps into columns.
161
+ - A horizontal color ramp has fewer ticks when their labels would touch.
140
162
  - A right legend keeps a narrow column (20% of the width, 110 to 200 px): a long label wraps to 3 lines at most, then ends with an ellipsis, and its full text is its SVG title. A bottom legend has one line per label.
141
163
 
164
+ ### Map coordinates
165
+
166
+ `coord("geo")` makes x the longitude and y the latitude, in degrees, at the same distance per px in x and y.
167
+
168
+ - One degree of longitude is `cos φ` degrees of latitude, at the center latitude φ of the view. This is exact for a region and about 10% off east-west at the edges of a map of all Japan (no projection).
169
+ - The panels take the shape of the map (the median shape when the panels have their own extent), unless `theme(aspect=)` sets it. Each panel then grows its extent in x or in y, around its center, to fill its box. `limits` is the area that must show; one side can grow.
170
+ - The stored view does not change: zoom, pan, reset, a resize and "Copy for a slide" draw it at equal scale again.
171
+ - Tick labels are in degrees: `135°E`, `35°N` (W and S for negative values), unless `format` is set. There are no axis titles unless `labels()` sets them.
172
+ - x and y must be number axes (not log, time or category), and `facet(free=)` must be `both` or unset.
173
+ - `coord("geo", scalebar=, north=)`: `true` or a corner (`bottom-left`, `bottom-right`, `top-left`, `top-right`). `scalebar=true` is at the bottom left, `north=true` at the top right, 0.8 em inside the frame of each main panel (not the insets). The scale bar is a round length (1, 2 or 5 × 10^k km) near a fifth of the panel width, at 111.32 km × cos φ per degree of longitude, with its length as text above it; it follows the zoom. The north arrow points up.
174
+
175
+ ### Insets
176
+
177
+ `inset(x=[low, high], y=[low, high], at=[left, bottom, right, top])` draws the extent x × y in a box of each panel; `at` is in shares of the panel, from its bottom left. For example the Okinawa islands, the Izu and Ogasawara islands, or eastern Hokkaido on a map of Japan, so that no point is left out of the main extent. Each call adds one inset.
178
+
179
+ - An inset draws the layers of its panel (with the rows of that panel), on the `background` color, with a frame in `tick` and without axes and grid lines. It covers the panel under it.
180
+ - In map coordinates, the extent grows on one side to fill the box at the same distance per px in x and y.
181
+ - An inset keeps its extent: zoom, pan and the zoom buttons apply to the main panels only. Hover and pinned labels work in insets.
182
+ - Insets need number or time axes.
183
+
142
184
  ## 6. Facets
143
185
 
144
186
  | Call | Panels | Strips |
@@ -201,7 +243,7 @@ A style can also list theme color names as its palette: the `paper` and `dark` s
201
243
  - A bottom legend has its title on its first row, before the items.
202
244
  - A format with `shrink` makes the facet strip text smaller (the same size for all strips) before it cuts a label, down to that share of its size.
203
245
  - `aspect` is the shape of each panel, height / width: `1` gives square panels (for observed-against-predicted plots, with the same `limits` on x and y). The panels shrink in one direction to get that shape. A `screen` plot without `height` changes its height instead (at most 1.2 times its usual height), so the panels fill it. The space that is left goes half on each side of the panels.
204
- - The title and the subtitle align left with the panels and wrap to two lines at most. A format with `shrink` first makes a long title or subtitle smaller, down to that share of its size, so that it stays on one line; one that does not fit even then keeps its size and wraps. A `screen` plot keeps room on the right for the toolbar; a fixed size uses the full width. The caption is at the bottom left.
246
+ - The title and the subtitle align left with the panels and wrap to two lines at most. A format with `shrink` first makes a long title or subtitle smaller, down to that share of its size, so that it stays on one line; one that does not fit even then keeps its size and wraps. A `screen` plot keeps room on the right for the toolbar; a fixed size uses the full width. The caption is at the bottom left, aligned with the panels: it wraps at the width of the figure less the y axis, to 4 lines at most (a longer one ends with an ellipsis), and starts further left only when it would run off the figure.
205
247
  - A bottom info table puts its entries in up to 3 columns, as many as fit on one line each; else one column whose values wrap.
206
248
  - `src/metrics.js` holds the glyph widths of each style font for the layout. CJK characters are one em wide.
207
249
 
@@ -253,6 +295,8 @@ Hover:
253
295
  | bar, hist | The column nearest the pointer: one row per color, the segment under the pointer in bold, and the total of a stack | Outline of the segment |
254
296
  | box | The box under the pointer: whiskers, quartiles, median, count and outliers. It wins over the points drawn with it. | – |
255
297
  | tile | The value of the cell, and its x and y | Outline of the cell |
298
+ | polygon | The area under the pointer (the top one): its tooltip value as the header, and its fill and color values. A point near the pointer wins. | – |
299
+ | raster | The cell under the pointer: its fill value as the header, and its x and y | – |
256
300
  | point, path, errorbar | The nearest point within 40 px. It stays picked until another point is at least 4 px nearer. | Dot |
257
301
 
258
302
  - The label box is flat and square. Its header has the color of the hovered series. A light color gets dark text; any other color gets white text, on the color darkened until the contrast is at least 4:1. On several series, the header is dark and each row has a color swatch.
@@ -279,7 +323,9 @@ The Node SVG and the browser SVG are the same, except for the numbers of the cli
279
323
  ## 10. Limits
280
324
 
281
325
  - Themes are styles and formats with four overrides. There is no `element_*` theming.
282
- - There is one color scale per plot. Size and shape are constants, not mappings.
326
+ - There are two color scales per plot: `color` and `fill`. Size and shape are constants, not mappings.
327
+ - A raster has one row per cell in the spec (about 30 bytes per cell) and an image of 4 bytes per cell, without compression: crop the grid to the map (90 000 cells make a spec of about 3 MB).
328
+ - A geometry column is JSON in the spec and in the notebook HTML: simplify the geometries first (for example `GeoSeries.simplify` or mapshaper). Each zoom and pan draws every area again.
283
329
  - There is no plot composition.
284
330
  - More than about 20 000 points make a large SVG: the SVG of 20 000 points is about 1.7 MB.
285
331
  - A saved SVG uses the fonts of the viewer. Without the style font, the text has other widths.
@@ -12,13 +12,15 @@
12
12
  "density": "boolean",
13
13
  "method": ["lm", "loess"],
14
14
  "span": "number",
15
- "band": "boolean"
15
+ "band": "boolean",
16
+ "direct": "boolean",
17
+ "repel": "boolean"
16
18
  },
17
19
  "layers": {
18
- "line": { "channels": ["x", "y", "color", "group", "tooltip"], "options": ["size", "alpha", "dash", "summary"], "requires": ["x", "y"] },
20
+ "line": { "channels": ["x", "y", "color", "group", "tooltip"], "options": ["size", "alpha", "dash", "summary", "direct"], "requires": ["x", "y"] },
19
21
  "path": { "channels": ["x", "y", "color", "group", "tooltip"], "options": ["size", "alpha", "dash"], "requires": ["x", "y"] },
20
22
  "step": { "channels": ["x", "y", "color", "group", "tooltip"], "options": ["size", "alpha", "dash"], "requires": ["x", "y"] },
21
- "point": { "channels": ["x", "y", "color", "tooltip"], "options": ["size", "alpha", "jitter", "summary"], "requires": ["x", "y"] },
23
+ "point": { "channels": ["x", "y", "color", "tooltip"], "options": ["size", "alpha", "jitter", "summary", "position"], "requires": ["x", "y"] },
22
24
  "bar": { "channels": ["x", "y", "color", "tooltip"], "options": ["alpha", "position"], "requires": ["x", "y"] },
23
25
  "hist": { "channels": ["x", "color"], "options": ["alpha", "bins", "density", "position"], "requires": ["x"] },
24
26
  "density": { "channels": ["x", "color"], "options": ["size", "alpha", "dash"], "requires": ["x"] },
@@ -28,24 +30,31 @@
28
30
  "hline": { "channels": ["y", "color"], "options": ["size", "alpha", "dash"], "requires": ["y"], "inherit": false },
29
31
  "vline": { "channels": ["x", "color"], "options": ["size", "alpha", "dash"], "requires": ["x"], "inherit": false },
30
32
  "abline": { "channels": ["color"], "options": ["slope", "intercept", "size", "alpha", "dash"], "requires": [], "inherit": false },
31
- "segment": { "channels": ["x", "y", "xend", "yend", "color"], "options": ["size", "alpha", "dash"], "requires": ["x", "y", "xend", "yend"] },
33
+ "segment": { "channels": ["x", "y", "xend", "yend", "color"], "options": ["size", "alpha", "dash", "position"], "requires": ["x", "y", "xend", "yend"] },
32
34
  "rect": { "channels": ["xmin", "xmax", "ymin", "ymax", "color", "tooltip"], "options": ["alpha"], "requires": ["xmin", "xmax", "ymin", "ymax"] },
33
35
  "band": { "channels": ["xmin", "xmax", "ymin", "ymax", "color"], "options": ["alpha"], "requires": [], "inherit": false },
34
36
  "tile": { "channels": ["x", "y", "color", "tooltip"], "options": ["alpha"], "requires": ["x", "y", "color"] },
35
- "text": { "channels": ["x", "y", "label", "color"], "options": ["size", "alpha"], "requires": ["x", "y", "label"] },
36
- "errorbar": { "channels": ["x", "ymin", "ymax", "color"], "options": ["size", "alpha"], "requires": ["x", "ymin", "ymax"] },
37
- "box": { "channels": ["x", "y", "color"], "options": ["alpha"], "requires": ["x", "y"] }
37
+ "text": { "channels": ["x", "y", "label", "color"], "options": ["size", "alpha", "repel"], "requires": ["x", "y", "label"] },
38
+ "errorbar": { "channels": ["x", "ymin", "ymax", "color"], "options": ["size", "alpha", "position"], "requires": ["x", "ymin", "ymax"] },
39
+ "box": { "channels": ["x", "y", "color"], "options": ["alpha"], "requires": ["x", "y"] },
40
+ "polygon": { "channels": ["geometry", "fill", "color", "tooltip"], "options": ["size", "alpha"], "requires": ["geometry"] },
41
+ "raster": { "channels": ["x", "y", "fill"], "options": ["alpha"], "requires": ["x", "y", "fill"] }
38
42
  },
39
43
  "scales": {
40
- "x": ["type", "limits", "format"],
41
- "y": ["type", "limits", "format"],
42
- "color": ["values", "palette", "scheme", "limits", "mid", "clamp"]
44
+ "x": ["type", "limits", "format", "breaks", "labels"],
45
+ "y": ["type", "limits", "format", "breaks", "labels"],
46
+ "color": ["values", "palette", "scheme", "limits", "mid", "clamp", "breaks", "labels"],
47
+ "fill": ["values", "palette", "scheme", "limits", "mid", "clamp", "breaks", "labels"]
43
48
  },
44
49
  "scaleTypes": ["linear", "log", "time", "category"],
45
50
  "facet": ["free", "ncol"],
46
51
  "grid": ["free"],
47
52
  "free": ["x", "y", "both"],
48
- "labels": ["title", "subtitle", "x", "y", "color", "caption"],
53
+ "labels": ["title", "subtitle", "x", "y", "color", "fill", "caption"],
54
+ "coord": ["geo"],
55
+ "coordOptions": ["scalebar", "north"],
56
+ "corners": ["bottom-left", "bottom-right", "top-left", "top-right"],
57
+ "inset": ["x", "y", "at"],
49
58
  "theme": ["format", "width", "height", "size", "legend", "aspect"],
50
59
  "legend": ["right", "bottom", "none"],
51
60
  "info": ["position"],