Skip to content

Commit 503acc6

Browse files
authored
Merge pull request #423 from d45/d45_docs_1_8
Adding draft notes for v1.8 release: Tableau Viz updates
2 parents 8ee0a4b + 9c09dde commit 503acc6

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+
*November 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 (`VizImageSizeSettingType.Manual`) or fixed (`VizImageSizeSettingType.Fixed`). If the type is manual, you can set the mark’s size. If the type is fixed, you can set the alignment (`VizImageSizeSettingAlignmentType`).
31+
32+
* Added support for sorting. You can sort a field (continuous or discrete) by ascending or descending values (`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. You are not restricted to using only 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+
```javascript
42+
43+
palette: tableau.VizImagePaletteType.CustomDiverging, start: "#FFB6C1", end: "#90ee90"
44+
45+
```
46+
47+
Or
48+
49+
```javascript
50+
51+
palette: tableau.VizImagePaletteType.CustomSequential, end: "#FFB6C1"
52+
53+
```
54+
55+
* Added support to show or hide grid lines in the view for rows or columns, or both.
56+
57+
* Starting with the v1.8 release of the Dashboard Extensions API library and Tableau 2021.4, Tableau Viz now uses Tableau fonts as the default font for text in the output SVG image.
58+
59+
For more information, see [Tableau Viz Reference]({{site.baseurl}}/docs/trex_tableau_viz_ref.html){:target="_blank"}
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+
```
171+
172+
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 |
178+
|:--- |:--- |
179+
|`field` | The name of the field to encode. |
180+
|`type`| The way the data is distributed in the view (discrete or continuous).|
181+
|`setting` | For continuous fields of the bar mark type, specifies the size and alignment properties of a mark. The options are manual (`tableau.VizImageSizeSettingType.Manual`) or fixed size (`tableau.VizImageSizeSettingType.Fixed`). 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. |
182+
|`showlegend` | Boolean (`true`, `false`). Specifies whether to show or hide the color legend. |
183+
184+
185+
|`setting` Property | Value |
186+
|:--- |:--- |
187+
|`tableau.VizImageSizeSettingType.Fixed` | Mark size is fixed. When `Fixed` is selected, you can set the `alignment` to `tableau.VizImageSizeSettingAlignmentType.Right`, `tableau.VizImageSizeSettingAlignmentType.Left`, or `tableau.VizImageSizeSettingAlignmentType.Center`. You can set the `width_in_axis_units` to a fixed number of units (floating point values accepted). |
188+
|`tableau.VizImageSizeSettingType.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: tableau.VizImageSizeSettingType.Fixed, alignment: tableau.VizImageSizeSettingAlignmentType.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: tableau.VizImageSizeSettingType.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`
163224

164225
The `color` property corresponds to the Color button on the Marks card. The color can contain additional properties:
165226

166227
| Property | Value |
167228
|:--- |:--- |
168229
|`field` | The name of the field to encode. |
169-
|`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. |
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). |
171232
|`showlegend` | Boolean (`true`, `false`). Specifies whether to show or hide the color legend. |
172233

173-
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+
|`tableau.VizImagePaletteType.CustomDiverging` | Defines a custom diverging palette. Specify the `start` value and an `end` value, each as a hexadecimal value. |
288+
| `tableau.VizImagePaletteType.CustomSequential` | 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: tableau.VizImagePaletteType.CustomDiverging, start: "#FFB6C1", end: "#90ee90"
297+
298+
```
299+
300+
Or
301+
302+
```javascript
303+
304+
palette: tableau.VizImagePaletteType.CustomSequential, 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)