Commit 071e14d8 authored by Sanjay Yadav's avatar Sanjay Yadav

DOC: Updated documentation.

parent fde4d22e
Pipeline #32575 passed with stage
in 1 minute and 9 seconds
......@@ -229,20 +229,23 @@ shape's style and content, or add new content (like charts).
The following CSS-like commands change the shape's display attributes:
- `opacity`: sets the shape's opacity level as a decimal from 0 - 1
- `color`: sets the text / foreground color as CSS colors
- `fill`: sets the shape's background color as CSS colors
- `stroke`: sets the shape outline color as CSS colors
- `stroke-width`: sets the shape outline width in points
- `width`: sets the shape width in points
- `height`: sets the shape height in points
- `left`: sets the shape X position in points
- `top`: sets the shape Y position in points
- `font-size`: sets the font size in points
- `font-family`: sets the font family as a font name
- `data`: Loads data
- `style`: Accepts css like properties
- `opacity`: sets the shape's opacity level as a decimal from 0 - 1
- `color`: sets the text / foreground color as CSS colors
- `fill`: sets the shape's background color as CSS colors
- `stroke`: sets the shape outline color as CSS colors
- `stroke-width`: sets the shape outline width in points
- `width`: sets the shape width in points
- `height`: sets the shape height in points
- `left`: sets the shape X position in points
- `top`: sets the shape Y position in points
- `font-size`: sets the font size in points
- `font-family`: sets the font family as a font name
CSS colors can be specified in the same way they can in CSS.
1 point is 1/72 inches.
1 point is 1/72 inches. All `style` elements and `data` will accept python expression or python function.
Values support [expressions](#expressions).
......@@ -347,18 +350,36 @@ To create multiple shapes using data, use `replicate:` and `data:`. For example:
```yaml
data:
sales: {xlsx: sales.xlsx}
multiple-objects:
multiple-objects: # Rule
# Slide 1, 2 will get replicated for all Categories (that is unique groups from groupby below), if slide-number is defined else all slides will get replicated.
slide-number: [1, 2] # This rule will get apply only on these slides.
data: data['sales'].groupby('Category')
replicate: True # Entire rule will replicate for defined slides, if slide-number is defined else all slides will get replicated.
Picture 1: # Take the Picture 1 shape
data: sales # Duplicate it for each row in sales
replicate: horizontal # Lay the images out horizontally to the right
margin: 10 # With a padding of 10 units
image: "{{ region }}.png" # Change the picture using this template
```
### Stack
Replicate a shape multiple times based on data vertically or horizontally. For example:
```yaml
data:
sales: {xlsx: sales.xlsx}
multiple-objects: # Rule
Text 1: # Take the Picture 1 shape
data: data['sales'].to_dict(orient='records')
stack: horizontal # Lay the images out horizontally to the right
margin: 10 # With a padding of 10 units
text: "{{ Category }}" # Change the text using this template
```
This `data:` is an [expression](#expressions) using the root `data:` variables.
For each row in `data`, the shape is duplicated and laid out based on `replicate:`.
`replicate:` supports these layouts:
`stack:` supports these layouts:
- `horizontal` copies the element right with an optional `margin` (default: 0)
- `vertical` copies the element below with an optional `margin` (default: 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment