v.0.8
On 2022.08.01
This version has been deprecated. If used with the current API version it can produce unexpected behaviour or errors.
To get the new version
🪄
pip install --upgrade shimoku-api-python
pip install --upgrade shimoku-components-catalog
Created a Bento box component that allow to group components in the grid without gaps, opening up a new galaxy of grid configurations
🍱
🍱
- Added time sleep to the
POST
operations for table rows which allows now to put large tables of thousands of rows avoidingToo many requests error
- Now reports could be hidden and unhidden easily with a new method.
First create a component
report_id: str = s.plt.html(
html=html,
menu_path=menu_path,
order=0,
rows_size=2, cols_size=6,
)
Now, to hide it use
hide_report()
# to pick your target app
target_app = [
app
for app in s.business.get_business_apps(s.plt.business_id)
if app['name'] == 'test'
]
asseert len(target_app) == 1
app_id = target_app[0]['id']
s.report.hide_report(
business_id=s.plt.business_id,
app_id=app_id,
report_id=report_id,
th
Now the report cannot be seen in the FrontEnd web app
To unhide it just undo the operation with
unhide_report()
s.report.unhide_report(
business_id=s.plt.business_id,
app_id=app_id,
report_id=report_id,
)
Combined with the
Input forms
this allow users to see the components they want to.- Now all the components have an input attribute
bentobox_data
that allow to group multiple components in a Bento box.
bentobox: Dict[str, Union[str, int] = {
bentoboxId: string
bentoboxOrder: int
bentoboxSizeColumns: int
bentoBoxSizeRows: intpy
}
Some behaviour considerations:
If two or more Reports have the same bentoboxId, they are grouped inside the Bento Group Component. Report Group has its Grid. Every Report inside the Report Group must be distributed like the available Grid. This Grid inside Report Group must be:a) 24 columns - NO gap b) Row size 16 px height - NO gap If bentoBoxId has been informed, but not sizeRows was not informed:
Indicators reports will have, by default, eight rows. Other reports will have, by default, 14 rows. If bentoBoxId has been informed, but not sizeColumns was not informed:
Indicators reports will have, by default, 12 cols. Other reports will have, by default, 24 cols. The Report with bentoboxOrder with the smallest number was the "master.” This Report defines the bentoboxSizeRows and the bentoboxSizeColumns.
Example:
menu_path: str = 'test/bentobox-test'
bentobox_id: Dict = {'bentoboxId': 'test20220101'}
bentobox_data: Dict = {
'bentoboxOrder': 0,
'bentoboxSizeColumns': 8,
'bentoboxSizeRows': 20,
}
bentobox_data.update(bentobox_id)
data_ = [
{
"description": "",
"title": "Estado",
"value": "Abierto",
},
]
s.plt.indicator(
data=data_,
menu_path=menu_path,
order=0, rows_size=8, cols_size=12,
value='value',
header='title',
footer='description',
bentobox_data=bentobox_data,
)
s.plt.indicator(
data=data_,
menu_path=menu_path,
order=1, rows_size=8, cols_size=12,
value='value',
header='title',
footer='description',
bentobox_data=bentobox_id,
)
data = [
{'date': dt.date(2021, 1, 1), 'x': 5, 'y': 5},
{'date': dt.date(2021, 1, 2), 'x': 6, 'y': 5},
{'date': dt.date(2021, 1, 3), 'x': 4, 'y': 5},
{'date': dt.date(2021, 1, 4), 'x': 7, 'y': 5},
{'date': dt.date(2021, 1, 5), 'x': 3, 'y': 5},
]
s.plt.bar(
data=data,
x='date', y=['x', 'y'],
menu_path=menu_path,
order=2, rows_size=14, cols_size=24,
bentobox_data=bentobox_id,
)
And create stuff such as:


Last modified 1mo ago