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
Copy file name to clipboardExpand all lines: notebooks/templates.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -176,10 +176,10 @@ fig.show()
176
176
Note that because we built the template with a list of 3 scatter trace graph objects (one each for the diamond, square, and circle symbols), the forth scatter trace in the figure cycles around and takes on the defaults specified in the first template trace (The diamond symbol).
177
177
178
178
179
-
###Themingarray properties
180
-
Some properties in the figure hierarchy are specified asarrays of objects. For example, the text annotations for a graph object figure are stored as a tuple of`go.layout.Annotation` objects in the`annotations` property of the figure's layout.
179
+
###Themingobject tuple properties
180
+
Some properties in the figure hierarchy are specified astuples of objects. For example, the text annotations for a graph object figure are stored as a tuple of`go.layout.Annotation` objects in the`annotations` property of the figure's layout.
181
181
182
-
To use a template to configure the default properties of all of the elements in an objectarray property (e.g.`layout.annotations`), use the`*defaults` property in the template that corresponds to thearray property (e.g.`layout.template.layout.annotationdefaults`). The`*defaults` template property should be set to a single graph object that matches the type of the elements of the correspondingarray. The properties of this`*defaults` object in the template will be applied to all elements of the objectarray in the figure that the template is applied to.
182
+
To use a template to configure the default properties of all of the elements in an objecttuple property (e.g.`layout.annotations`), use the`*defaults` property in the template that corresponds to thetuple property (e.g.`layout.template.layout.annotationdefaults`). The`*defaults` template property should be set to a single graph object that matches the type of the elements of the correspondingtuple. The properties of this`*defaults` object in the template will be applied to all elements of the objecttuple in the figure that the template is applied to.
183
183
184
184
Here is an example that creates a template that specifies the default annotation text color, and then constructs a figure that uses this template.
185
185
@@ -199,11 +199,11 @@ fig.update_layout(
199
199
fig.show()
200
200
```
201
201
202
-
###Includingarray elements in a theme
202
+
###Includingtuple elements in a theme
203
203
204
-
The previous section described how to use a template to customize the default properties ofarray elements that are added to a figure that the template is applied to. This is useful for styling, for example, any annotations, shapes, or images that will eventually be added to the figure.
204
+
The previous section described how to use a template to customize the default properties oftuple elements that are added to a figure that the template is applied to. This is useful for styling, for example, any annotations, shapes, or images that will eventually be added to the figure.
205
205
206
-
It is also possible for a template to definearray elements that should be included, as is, in any figure that the template is applied to. This is done by specifying a list of one or morearray element graph objects (e.g.`go.layout.Annotation` objects) as the value of the correspondingarray property in the template (e.g. at`template.layout.annotations`). Note that the`name` property of thesearray element graph objects must be set to a unique non-empty string.
206
+
It is also possible for a template to definetuple elements that should be included, as is, in any figure that the template is applied to. This is done by specifying a list of one or moretuple element graph objects (e.g.`go.layout.Annotation` objects) as the value of the correspondingtuple property in the template (e.g. at`template.layout.annotations`). Note that the`name` property of thesetuple element graph objects must be set to a unique non-empty string.
207
207
208
208
Here is an example that creates a template that adds a large semi-transparent "DRAFT" watermark to the middle of the figure, and constructs a figure using this template.
The previous section described how a template can be used to add defaultarray element graph objects (e.g. annotations, shapes, or images) to a figure. The properties of these defaultarray elements can be customized from within the figure by adding anarray element with a`templateitemname` property that matches the`name` property of the template object.
234
+
###Customizing themetuple elements in a figure
235
+
The previous section described how a template can be used to add defaulttuple element graph objects (e.g. annotations, shapes, or images) to a figure. The properties of these defaulttuple elements can be customized from within the figure by adding antuple element with a`templateitemname` property that matches the`name` property of the template object.
236
236
237
237
Here is an example, using the same`draft_template` defined above, that customizes the watermark from within the figure to read "CONFIDENTIAL" rather than "DRAFT".