Common parameters
The following parameters are common to all cards:
Name | Required | Description |
---|---|---|
type | Yes | The type of card, e.g. number or intSlider . |
logic_view_size | Yes | Size of the card in the logic view, e.g. (2,1) . |
label | No | Text to be displayed at the top of the card. |
layout | No | Size and position of the card in one or more decks, e.g. [{"size": (4,3), "position": (1,7), "deck": "default-deck"}] . |
datacards.publish.card(
type='number',
value=42,
label='Number',
logic_view_size=(2,1)
layout=[{"size": (4,3), "position": (1,7), "deck": "default-deck"}],
)
In the above example, the published card is:
- 4 grid squares wide by 3 grid squares tall,
- positioned 1 grid square from the left and 7 grid squares from the top,
- published to the default deck.
Input cards
All input cards take the following extra parameters:
Name | Required | Description |
---|---|---|
variable_key | Yes | The name of the DataCards variable with which an input is connected, e.g. "my_integer_slider" . |
datacards.publish.card(
type='toggle',
label='Toggle',
logic_view_size=(2,1),
layout=[{"size": (4,3), "position": (1,7), "deck": "default-deck"}],
variable_key="my_toggle_input"
)
Last updated on