Skip to content

Commit 0f7b3d2

Browse files
committed
Adding draft notes for v1.8 release: Tableau Viz updates
1 parent 7f89ae5 commit 0f7b3d2

File tree

3 files changed

+146
-8
lines changed

3 files changed

+146
-8
lines changed

docs/trex_release-notes.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,54 @@ layout: docs
1212
See also: [Known Issues]({{site.baseurl}}/docs/trex_known_issues.html)
1313

1414

15+
16+
17+
18+
### Tableau Dashboard Extensions API version 1.8
19+
20+
*October 2021*
21+
22+
* Tableau Dashboard Extensions API library: `tableau.extensions.1.8.0.js` <br>(download or clone the Extensions API repository on [GitHub](https://github.com/tableau/extensions-api){:target="_blank"}.) <br/>
23+
24+
* Certain features in this release are only available in Tableau 2021.4 or later. Preview the features and test your extension with the latest version of Tableau in the Developer Sandbox. To gain access to the Developer Sandbox, join the [Tableau Developer Program](http://www.tableau.com/developer){:target="_blank"} and request your own Tableau Online developer site.
25+
26+
About this release:
27+
28+
This release contains updates for [Tableau Viz]({{site.baseurl}}/docs/trex_tableau_viz.html){:target="_blank"}, including:
29+
30+
* Added support for setting the size of a bar mark to be manual or fixed. You can also set the mark’s size and alignment.
31+
32+
* Added support for sorting. You can sort a field (continuous or discrete). Supports sorting by ascending or descending values for continuous fields and discrete fields (`VizImageSortDirectionType.Ascending`, `VizImageSortDirectionType.Descending`).
33+
34+
```javascript
35+
sort: { field: "Category", sortby: "Weather", direction: tableau.VizImageSortDirectionType.Ascending }
36+
```
37+
38+
* For continuous fields, you can set the color palette to a custom diverging or custom sequential color palette and not just a Tableau defined palate, such as, `green_blue_white_diverging_10_0`.
39+
For example, you could set the custom palette as shown in the following examples:
40+
41+
42+
```javascript
43+
44+
palette: "custom-diverging", start: "#FFB6C1", end: "#90ee90"
45+
46+
```
47+
48+
Or
49+
50+
```javascript
51+
52+
palette: "custom-sequential", end: "#FFB6C1"
53+
54+
```
55+
56+
* Added support to show or hide grid lines in the view for rows or columns, or both.
57+
58+
For more information, see [Tableau Viz Reference]({{site.baseurl}}/docs/trex_tableau_viz_ref.html){:target="_blank"}
59+
60+
61+
----
62+
1563
### Tableau Dashboard Extensions API version 1.7
1664

1765
*October 2021*

docs/trex_tableau_viz_ref.md

Lines changed: 97 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ The following shows an example `inputSpec` that creates a bar chart image.
5151
encoding: {
5252
columns: {field: "Sales", type: tableau.VizImageEncodingType.Continuous},
5353
rows: {field: "Category", type: tableau.VizImageEncodingType.Discrete, hidden: "true"},
54+
sort: { field: "Category", sortby: "Sales", direction: tableau.VizImageSortDirectionType.Ascending }
5455
color: {field: "Weather", type: tableau.VizImageEncodingType.Discrete, palette: "seattle_grays_10_0"},
5556
size: {field: "Quantity", type: tableau.VizImageEncodingType.Continuous},
5657
text: {field: "Category", type: tableau.VizImageEncodingType.Discrete}
@@ -138,17 +139,18 @@ Within these properties, you must specify the field to encode and its type (`tab
138139

139140
---
140141

141-
#### `columns` and `rows`
142+
#### encoding: `columns` and `rows`
142143

143144
| Property | Value |
144145
|:--- |:--- |
145146
|`field` | The name of the field to encode. |
146147
|`type`| The type of field, either `tableau.VizImageEncodingType.Discrete` (blue "pill") or `tableau.VizImageEncodingType.Continuous` (green "pill"). |
147148
|`hidden` | Boolean (`true`, `false`). Specifies whether to show or hide the column or row header. |
149+
| `showgridline` | Boolean (`true`, `false`). Specifies whether to show or hide the gridlines. |
148150
|`title` | Specifies a custom field label (x-axis, or header) or custom axis title (y-axis) for the columns and rows. |
149151
| `showtitle` | Boolean (`true`, `false`). Specifies whether to show or hide the custom column or row title. |
150152

151-
The following is an example of how you might specify the encodings for columns and rows:
153+
The following are examples of how you might specify the encodings for columns and rows:
152154

153155
```javascript
154156

@@ -159,23 +161,81 @@ encoding: {
159161

160162
```
161163

162-
#### `color`
164+
```javascript
165+
mark: tableau.MarkType.Line,
166+
encoding: {
167+
columns: {field: "Category", type: tableau.VizImageEncodingType.Discrete, showgridline: true},
168+
rows: {field: "Measure", type: tableau.VizImageEncodingType.Continuous, showgridline: true},
169+
}
170+
```
163171

164-
The `color` property corresponds to the Color button on the Marks card. The color can contain additional properties:
165172

166-
| Property | Value |
173+
#### encoding: `size`
174+
175+
Specifies the size encoding of the mark. The `size` property corresponds to the Size button on the Marks card. For continuous fields, you can set the bar mark to either manual or fixed size. You can also set the mark’s alignment.
176+
177+
| `size` Property | Value |
167178
|:--- |:--- |
168179
|`field` | The name of the field to encode. |
169180
|`type`| The way the data is distributed in the view (`discrete` or `continuous`).|
170-
|`palette` | Specifies color encoding for the field from the Tableau palette. Note that there are separate palettes for `discrete` or `continuous` fields. |
181+
|`setting` | For continuous fields of the bar mark type, specifies the size and alignment properties of a mark. The options are `manual` or `fixed` size. For `manual`, you can specify a `size` value from `0` to `2`. For `fixed` you can set the alignment and width in axis units. See the `setting` properties for more information. |
171182
|`showlegend` | Boolean (`true`, `false`). Specifies whether to show or hide the color legend. |
172183

173184

185+
|`setting` Property | Value |
186+
|:--- |:--- |
187+
|`fixed` | Mark size is fixed. When `fixed` is selected, you can set the `alignment` to `right`, `left`, or `center`. You can set the `width_in_axis_units` to a fixed number of units (floating point values accepted). |
188+
|`manual` | Specifies that the mark size type is manual. When this is selected, set the `marksize` value (from 0 to 2, floating point values accepted). |
189+
190+
Example of fixed sized type:
191+
192+
```javascript
193+
194+
encoding: {
195+
...
196+
size: {field: "Age", setting: "fixed", alignment: "right", width_in_axis_units: 3}
197+
198+
}
199+
```
200+
201+
Example of manual sized type:
202+
203+
```javascript
204+
encoding: {
205+
...
206+
size: {field: "Measure", type: tableau.VizImageEncodingType.Continuous, setting: "manual", marksize: 0.35}
207+
}
208+
```
209+
210+
211+
#### encoding: `sort`
212+
213+
Specifies the sort order for a field (continuous or discrete). Supports sorting the field by ascending or descending values (`VizImageSortDirectionType.Ascending`, `VizImageSortDirectionType.Descending`), based on the `sortby` criteria you provide.
214+
215+
```javascript
216+
sort: { field: "Category", sortby: "Weather", direction: tableau.VizImageSortDirectionType.Ascending }
217+
```
218+
219+
220+
221+
222+
223+
#### encoding: `color`
224+
225+
The `color` property corresponds to the Color button on the Marks card. The color can contain additional properties:
226+
227+
| Property | Value |
228+
|:--- |:--- |
229+
|`field` | The name of the field to encode. |
230+
|`type`| The way the data is distributed in the view (discrete or continuous).|
231+
|`palette` | Specifies color encoding for the field from the Tableau palette. Note that there are separate palettes for discrete or continuous fields. You can also create custom color palettes for continuous fields. See [Create Custom Color Palettes](#create-custom-color-palettes). |
232+
|`showlegend` | Boolean (`true`, `false`). Specifies whether to show or hide the color legend. |
233+
174234
**`palette` names for continuous fields**
175235

176236
You can specify one of the following Tableau color palettes with the `palette` property for continuous fields. Note that the list of available palettes depends upon the version of Tableau that is being used. Be aware that the palette colors are subject to change.
177237

178-
The following is an example that shows how you might encode a continuous field with a Tableau palette.
238+
The following is an example that shows how you might encode a continuous field with a Tableau palette. You can also create custom color palettes for continuous fields. See [Create Custom Color Palettes](#create-custom-color-palettes).
179239

180240
```javascript
181241

@@ -214,3 +274,33 @@ encoding: {
214274
| ![Tableau Discrete Palette]({{site.baseurl}}/assets/discrete_palette.png) | `tableau10_10_0` <br/> `tableau20_10_0` <br/> `color_blind_10_0` <br/>`seattle_grays_10_0`<br/>`traffic_light_10_0` <br/>`superfishel_stone_10_0` <br/>`miller_stone_10_0` <br/>`nuriel_stone_10_0`<br/>`jewel_bright_10_0`<br/>`summer_10_0`<br/>`winter_10_0`<br/>`green_orange_cyan_yellow_10_0`<br/>`blue_red_brown_10_0`<br/>`purple_pink_gray_10_0`<br/>`tableau-10`<br/>`tableau-10-medium`<br/>`tableau-20`<br/>`blue_10_0`<br/>`orange_10_0`<br/>`green_10_0`<br/>`red_10_0`<br/>`purple_10_0`<br/>`brown_10_0`<br/>`gray_10_0`<br/>`gray_warm_10_0`<br/>`blue_teal_10_0`<br/>`orange_gold_10_0`<br/>`green_gold_10_0`<br/>`red_gold_10_0`<br/>`cyclic_10_0` |
215275

216276
---
277+
278+
279+
280+
#### Create custom color palettes
281+
282+
You can set the color palette to a custom diverging or custom sequential color palette that you specify, and not just the Tableau defined palates, such as, `green_blue_white_diverging_10_0`.
283+
284+
285+
| Custom Palette Property | Value |
286+
|:--- |:--- |
287+
|`custom-diverging` | Defines a custom diverging palette. Specify the `start` value and an `end` value, each as a hexadecimal value. |
288+
| `custom-sequential` | Defines a custom sequential palette. Specify the `end` value as a hexadecimal value. |
289+
290+
291+
For example, you could set a custom palette as shown in the following examples:
292+
293+
294+
```javascript
295+
296+
palette: "custom-diverging", start: "#FFB6C1", end: "#90ee90"
297+
298+
```
299+
300+
Or
301+
302+
```javascript
303+
304+
palette: "custom-sequential", end: "#FFB6C1"
305+
306+
```

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h3>Get Started</h3>
3434
<!-- <a href="/extensions-api/docs/trex_getstarted.html">
3535
<img src="{{ site.baseurl }}/assets/docs.png" /> -->
3636
<h3>Extensions API Reference</h3>
37-
<p>Consult the <a href="{{ site.baseurl }}/docs/index.html" target="_blank">Tableau Extensions API Reference</a> and <a href="{{{site.baseurl}}/docs/trex_tableau_viz_ref.html">Tableau Viz Reference</a> while you build your extensions.</p>
37+
<p>Consult the <a href="{{ site.baseurl }}/docs/index.html" target="_blank">Tableau Extensions API Reference</a> and <a href="{{ site.baseurl }}/docs/trex_tableau_viz_ref.html">Tableau Viz Reference</a> while you build your extensions.</p>
3838
</div>
3939
</div>
4040
</div>

0 commit comments

Comments
 (0)