Shimoku docs
Ask or search…
K

Changing the Menu Path

Create and modify a menu path in the same run

The menu_path can be modified mid execution. If the menu_path does not previously exist, it is created inside the current board when the code is executed. If no board name has been set, the SDK will use the name : 'Default Name'. If the board does not exist it will create it. This will only happen in the case the path didn't exist beforehand, if an existing path is referenced it will link the menu path to the specified board, even if the other boards already have a link to the menu path.
All charts created after setting the menu path will be included in the specified menu path, until it is changed to another.
s.set_board('Custom Board')
s.set_menu_path('menu path', 'sub-path')
data = [
{'date': dt.date(2021, 1, 1), 'x': 5, 'y': 10},
{'date': dt.date(2021, 1, 2), 'x': 6, 'y': 8},
{'date': dt.date(2021, 1, 3), 'x': 4, 'y': 10},
{'date': dt.date(2021, 1, 4), 'x': 7, 'y': 2},
{'date': dt.date(2021, 1, 5), 'x': 3, 'y': 14},
{'date': dt.date(2021, 1, 6), 'x': 6, 'y': 10},
{'date': dt.date(2021, 1, 7), 'x': 3, 'y': 12},
{'date': dt.date(2021, 1, 8), 'x': 8, 'y': 14},
]
s.plt.bar(data=data, x='date', order=0)
A new menu path and board have been created by using the code on an empty workspace.