v.0.11

On 2022.12.07

This version has been deprecated. If used with the current API version it can produce unexpected behaviour or errors.

The package shimoku-api-python is no longer maintained

To get the new version 🎨🖌️

pip install --upgrade shimoku-api-python

This new version comes full of improvements! Some quality of life upgrades and some important features.

Improvements

  • Now the classes that handle the "app metadata" and "input output" have the "business_id" as an attribute so it doesn't need to be provided for each call.

  • A new input form component is available! The smart search menu, to use it just define the field "inputType" as "multiSelect", like the following example:

    {
      'mapping': 'objectives',
      'fieldName': 'Objetivos',
      'inputType': 'multiSelect',
      'options': ['sleep', 'close eyes', 'awake']
    }

    And use the same function used to create the input form, to get:

We have new navigation components to make the use of the dashboard as fluid as possible:

  • Breadcrumbs have been added! They will tell you your current path above in the page. To use them you just have to call the activation function:

    s.app.show_breadcrumbs(app_id: Optional[str], app_name: Optional[str])

    You can pass the app_id or the app_name and it will activate the breadcrumbs for that app. It also exists the opposite function, in case they have to be deactivated:

    s.app.hide_breadcrumbs(app_id: Optional[str], app_name: Optional[str])

  • History navigation has been added too! This activates two arrows that let you go to previously visited pages. It's activated and deactivated the same way as the breadcrumbs, just changing the function name:

    s.app.show_history_navigation(app_id: Optional[str], app_name: Optional[str])
    s.app.hide_history_navigation(app_id: Optional[str], app_name: Optional[str])

  • Apps can be hidden from the left menu and linked by a dashboard element to give infinite navigation possibilities! To activate it you can use the same type of functions as before, just changing the name:

    s.app.show_path(app_id: Optional[str], app_name: Optional[str])
    s.app.hide_path(app_id: Optional[str], app_name: Optional[str])

    If we create a hidden path app and link it with a button:

we get the following result after clicking on it:

  • Tabs give the option to separate elements further by grouping them, and only showing a handfull each time. Tabs reset the order so they can be thinked of as subpaths but work as reports so they are very versatile! In the following images we can see that groups of reports with complex behaviour (bentobox and grid behaviour) are being rendered correctly:

  • To use it you just have to define the location of the chart the same way you define the menu, it needs a tabs group name and the name of the tab where it will be inserted:

    s.plt.plotting_function(
        data=data,
        ...
        menu_path=menu_path,
        tabs_index=(tabs_group_name, tab_name)
        ...
    )

    The parameter is called "tabs_index" and it is expecting a tuple with the group_name and the tab_name. After executing the following code:

    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}]
    
    menu_path = "tabs_test"
    s.plt.indicator(data={
        "description": "",
        "title": "",
        "value": "Indicator",
        "color": "warning"
        },
        menu_path=menu_path,
        order=0,
        value='value',
        header='title',
        footer='description',
        color='color',
        tabs_index=("Charts", "Indicator tab")
    )
    s.plt.bar(
        data=data,
        x='date', y=['x', 'y'],
        menu_path=menu_path,
        x_axis_name='Date',
        y_axis_name=['Revenue'],
        # row=1, column=1,
        order=0, rows_size=2,
        cols_size=12,
        tabs_index=("Charts", "Bar tab")
    )

    The result is:

    The order and cols_size attributes can be modified using the following method:

    s.plt.update_tabs_group_metadata(
        group_name: str,
        menu_path: str, 
        order: Optional[int] = None,
        cols_size: Optional[int] = None
    )

    Because this component is treated as a report we are able to include tabs inside of tabs! This means that we can have as much indexing of data as we need! To link a tab to another, it has to be used the following method:

    s.plt.insert_tabs_group_in_tab(
        menu_path: str, 
        parent_tab_index: Tuple[str, str], 
        child_tabs_group: str, 
        last_in_order: Optional[bool]
    )

    It has the option to put the tabs group last in order by default, as it will be the most common way to use this.

Last updated