v.0.4

On 2022.02.15

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

We have started a set of new features to become without any shadow of doubt the best Data App Creator in the world by April.2022. What is coming will change the way Data delivers value.

Fixes

  • For the tables when you get to the last page there is not an extra page that shows nothing (this is fixed):

  • Fixed predictive_line() that was broken

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.predictive_line(
    data=data,
    x='date', y=['x', 'y'],
    min_value_mark=dt.date(2021, 1, 4).isoformat(),
    max_value_mark=dt.date(2021, 1, 5).isoformat(),
    menu_path='test/predictive-line-test',
    row=1, column=1,
)

  • Now the Shimoku API returns 201 instead of 200 for successful requests.

Refactor

  • Breaking change: Gauge component s.plt.gauge() renamed as s.plt.ring_gauge()

Improvements

  • Now the Shimoku API paginates what makes possible to work with big chunks of data.

  • Now the table can be rendered sorted by a column by default. For instance for time-series tables they can be rendered by date.

    • Currently this feature can only be used for a single column of the table

    • Options are asc for ascending or desc for descending:

data_ = [
        {'date': dt.date(2021, 1, 1), 'x': 5, 'y': 5, 'filtA': 'A', 'filtB': 'B'},
        {'date': dt.date(2021, 1, 2), 'x': 6, 'y': 5, 'filtA': 'B', 'filtB': 'Z'},
        {'date': dt.date(2021, 1, 3), 'x': 4, 'y': 5, 'filtA': 'C', 'filtB': 'W'},
        {'date': dt.date(2021, 1, 4), 'x': 7, 'y': 5, 'filtA': 'B', 'filtB': 'T'},
        {'date': dt.date(2021, 1, 5), 'x': 3, 'y': 5, 'filtA': 'A', 'filtB': 'Z'},
]

filter_columns: List[str] = ['filtA', 'filtB']

s.plt.table(
   data=data_,
   menu_path='audrey/table-test',
   row=1, column=1,
   filter_columns=filter_columns,
   sort_table_by_col={'date': 'asc'}
)

That is going to look by default sorted as follows:

New

  • Multifilter. Now you can define filters for any chart. Moreover it is a very easy operation. It can be used with:

    • line()

    • predictive_line()

    • bar()

    • horizontal_bar()

    • zero_centered_bar()

    • scatter()

    • sunburst()

    • candlestick()

    • funnel()

    • heatmap()

Imagine you have a dataset with the following backbone columns:

And a different set of metric columns such as:

You can create now charts that allow you to filter by the categorical columns to show the value columns easily. Note that you must specify the position of the filters and the chart:

filters: Dict = {
    'row': 1, 'column': 1,  # position of the filter
    'filter_cols': [
        'seccion', 'frecuencia', 'region',  # columns from the dataset to filter by
    ],
}

s.plt.bar(
    data=data_,
    x='fecha', y=y,
    menu_path='test/multifilter-bar-test',
    row=2, column=1,
    filters=filters,
)

You can also add afterwards new cases. Imagine you have a now a new values of section called Enfermedades

and you want to add this new dataset with the values for Enfermedades, but keeping all the other options that you posted before. You can do that easily specifying in the filters 'update_filter_type': 'concat'

filters: Dict = {
    'update_filter_type': 'concat',
    'row': 1, 'column': 1,
    'filter_cols': [
        'seccion', 'frecuencia', 'region',
    ],
}

s.plt.bar(
    data=data_2,
    x='fecha', y=y,
    menu_path=menu_path,
    row=2, column=1,
    filters=filters,
)

You can also connect multiple components from different grid positions to the multifilter. Suppose that you have another dataset_3 with the same filter_cols and filter values. You can connect that new component to the same multifilter. In general multifilters can be connected to any number of reports from the same path. You can do that easily specifying in the filters 'update_filter_type': 'append'

filters: Dict = {
    'update_filter_type': 'append',
    'row': 1, 'column': 1,
    'filter_cols': [
        'seccion', 'frecuencia', 'region',
    ],
}

s.plt.bar(
    data=data_3,
    x='fecha', y=y,
    menu_path=menu_path,
    row=2, column=2,
    filters=filters,
)pyt

With all the changes above you can have the following (in this case we have the same dataset duplicated in two different barcharts for simplicity):

Current limitations of multifilter:

. append_data_to_trend_chart() cannot be used for charts with multifilter.

. delete() an existing specific multifilter combination is not possible yet.

. update an existing specific multifilter combination is not possible yet

. It cannot be applied to all the charts catalog yet.

  • New method s.app_type.rename_app_type_by_old_name() to rename Apps without the id:

new_app_type: Dict = (
  s.app_type.rename_app_type_by_old_name(
    old_name='old_name', 
    new_name=new_name,
  )
)
  • Speed Gauge Chart

data_ = [
    {
        "value": 60,
        "name": "Third"
    },
]

s.plt.speed_gauge(
    data=data_, name='name', value='value',
    menu_path='test/speed-gauge-test',
    row=1, column=1,
    min=0, max=70,
)

You can also plug more than one speed gauge in the same component, nevertheless the user experience is, in general, not as good as to create two different speed gauge or a single one with filters (see multifilter above)

Last updated