Shimoku docs
  • 🚀QuickStart
    • Installation & Setup
    • Minimal APP example
    • Extended Example
    • Templates & tutorials
  • 🤖Artificial Intelligence
    • Classification
      • Train Classification
        • Train Classification Outputs
      • Predict Classification
        • Predict Classification Outputs
    • Generate Insights
      • Generate Insights Outputs
  • 🛠️Building Web App
    • Environment
      • Overview
      • Environment Variables
    • Management
      • Managing Universes
      • Managing Workspaces
      • Managing Boards
    • Menu
      • Changing the Menu Path
      • Updating the Menu Path
      • Deleting the Menu Path
    • Grid
      • Using the Grid
    • Theming
      • Colors Usage
    • Actions
    • Modals
    • IO
  • 💡Elements
    • Summary
    • Charts
      • Table
        • Buttons Column
        • Filters
        • Search bars
        • Colored labels
      • HTML
        • Raw HTML
        • Beautiful Titles
        • Background Indicators
        • Click to New Tab
        • Box With Button
        • Panel
      • Indicators
        • Indicator
        • Grouped Indicators
        • Vertical Indicators
        • Color by Value
        • Gauge Indicator
        • Indicators with Header
      • Scatter Charts
        • Scatter
        • Scatter with Effect
      • Line Charts
        • Line
        • Predictive Line
        • Segmented Line
        • Marked Line
        • Line With Confidence Area
        • Top Bottom Line Charts
        • Summary Line
      • Area Charts
        • Area
        • Stacked Area
        • Segmented Area
        • Top Bottom Area Charts
      • Bar Charts
        • Bar
        • Stacked Bar
        • Horizontal Bar
        • Stacked Horizontal Bar
        • Zero Centered Bar
      • Pie Charts
        • Pie
        • Doughnut
        • Rose
      • Gauge Charts
        • Shimoku Gauge
        • Speed Gauge
      • Input forms
        • Group chained Inputs
        • List input search
        • Conditional inputs
        • Audio input
        • Drag & Drop
      • Line and Bar
      • Waterfall
      • Annotated Chart
      • Heatmap
      • Radar
      • Sunburst
      • Tree
      • Treemap
      • Sankey Diagram
      • Funnel chart
      • iFrame
    • Composite Template Charts
      • Infographics text bubble
      • Chart and Modal Button
      • Chart and Indicators
    • Data Sets
      • Data Set Filters
    • Create your own charts
      • Free Echarts
      • Bento box
    • Features & Navigation
      • Tabs
      • History navigation & Breadcrumb
  • 🔍Advanced usage
    • CLI
    • Workflow Triggers
    • Code Generation
  • 🌍Cloud & Community
    • Shimoku Cloud
    • Shared links
    • Handling Workspaces & Users
      • User authentication
      • Inviting users
      • Creating users
      • Users with multi-workspace access
  • 🌐Releases
    • 2024
      • v.2.6
      • v.2.5
      • v.2.4
      • v.2.3
        • v.2.3.1
      • v.2.2
        • v.2.2.3
        • v.2.2.2
        • v.2.2.1
      • v.2.1
        • v.2.1.2
        • v.2.1.1
      • v.2.0
        • v.2.0.(1..4)
      • v.1.6
        • v.1.6.1
      • v.1.5
    • 2023
      • v.1.4
        • v.1.4.1
        • v.1.4.2
      • v.1.3
      • v.1.2
        • v.1.2.1
      • v.1.1
        • v.1.1.1
      • v.1.0
        • v.1.0.2
        • v.1.0.1
      • v.0.20
      • v.0.19
      • v.0.18
      • v.0.17
        • v.0.17.1
      • v.0.16
        • v.0.16.3
        • v.0.16.2
        • v.0.16.1
      • v.0.15
      • v.0.14
    • 2022
      • v.0.13
        • v.0.13.3
      • v.0.12
      • v.0.11
      • v.0.10
        • v.0.10.4
        • v.0.10.3
        • v.0.10.1
      • v.0.9
      • v.0.8
      • v.0.7
        • v.0.7.1
      • v.0.6
      • v.0.5
      • v.0.4
      • v.0.3
        • v0.3.2
        • v0.3.1
      • v.0.2
Powered by GitBook
On this page
  • The Method To Use
  • Examples
  • 1. Default Configuration
  • 2. Customization And Context
  • 3. Table with Links
  • Behavior
  • Pagination
  • Download Data In .csv Format
  • Interesting Usages

Was this helpful?

  1. Elements
  2. Charts

Table

Resources on how to build a table with your data, and personalize it.

The Method To Use

The method is s.plt.table()

It must contain the following input variables:

order: int, 
data: Union[str, pd.DataFrame, List[Dict], Dict],

And accepts the following input variables as optional:

columns: Optional[List[str]] = None, 
columns_button: bool = True,
filters: bool = True, 
export_to_csv: bool = True, 
search: bool = True,
page_size: int = 10, 
page_size_options: Optional[List[int]] = None,
initial_sort_column: Optional[str] = None, 
sort_descending: bool = False,
columns_options: Optional[Dict] = None,
categorical_columns: Optional[List[str]] = None,
label_columns: Optional[Dict] = None,
web_link_column: Optional[str] = None,
open_link_in_new_tab: bool = False,
**component_params

Examples

1. Default Configuration

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'},
]

s.plt.table(data=data, order=0)

2. Customization And Context

You can personalize the table by changing the column names in the input dataframe, defining by which columns the table can be sorted and adding a title:

data = [
    {'date': dt.date(2021, 1, 1), 'Bus1': 5, 'Bus2': 5, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 2), 'Bus1': 6, 'Bus2': 7, 'filtA': 'B', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 3), 'Bus1': 4, 'Bus2': 5, 'filtA': 'A', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 4), 'Bus1': 7, 'Bus2': 8, 'filtA': 'B', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 5), 'Bus1': 3, 'Bus2': 5, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 6), 'Bus1': 5, 'Bus2': 5, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 7), 'Bus1': 6, 'Bus2': 7, 'filtA': 'B', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 8), 'Bus1': 4, 'Bus2': 5, 'filtA': 'A', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 9), 'Bus1': 7, 'Bus2': 5, 'filtA': 'B', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 10), 'Bus1': 3, 'Bus2': 7, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 11), 'Bus1': 5, 'Bus2': 5, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 12), 'Bus1': 6, 'Bus2': 5, 'filtA': 'B', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 13), 'Bus1': 4, 'Bus2': 8, 'filtA': 'A', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 14), 'Bus1': 7, 'Bus2': 5, 'filtA': 'B', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 15), 'Bus1': 3, 'Bus2': 5, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 16), 'Bus1': 5, 'Bus2': 8, 'filtA': 'A', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 17), 'Bus1': 6, 'Bus2': 5, 'filtA': 'B', 'filtB': 'Z'},
    {'date': dt.date(2021, 1, 18), 'Bus1': 4, 'Bus2': 7, 'filtA': 'A', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 19), 'Bus1': 7, 'Bus2': 5, 'filtA': 'B', 'filtB': 'W'},
    {'date': dt.date(2021, 1, 20), 'Bus1': 3, 'Bus2': 7, 'filtA': 'A', 'filtB': 'Z'},
]

s.plt.table(
    data=data, order=0, 
    rows_size=4, title='Table test', page_size_options=[3, 5, 10],
    initial_sort_column='date', sort_descending=True, 
    categorical_columns=['filtA', 'filtB']
)

3. Table with Links

data = [
    {'link': 'https://www.shimoku.com'},
    {'link': 'https://docs.shimoku.com'},
    {'link': 'https://www.shimoku.io'},
    {'link': 'https://github.com/shimoku-tech/shimoku-app-templates'},
    {'link': 'https://github.com/shimoku-tech/shimoku-api-python'}
]
s.plt.table(
    order=0, data=data, 
    web_link_column='link', 
    open_in_new_tab=True
)

Behavior

Important behavior considerations to have in mind.

Pagination

If you build a table with more than 10 rows, more pages are added and to show the entire table just click the > symbol:

Download Data In .csv Format

You can retrieve the data from the table in .csv format by clicking the download button showed bellow:

When clicked the file is stored with an automatic name generated with the name of the table:

This feature is enabled by default, but can be easily disabled by changing the parameter downloadable_to_csv to False:

s.plt.table(
    data=data, order=0,
    title="No csv button",
    export_to_csv=False,
)

Interesting Usages

  • Data visualization: Tables are a great way to display large amounts of data in a structured format. For example, you could use a table to display sales data for different products over multiple time periods. The rows can be sorted by the specified sorting columns, allowing the user to quickly find the information they need. For example, you could use a table to display a list of products and allow the user to sort the list by price, popularity, or other attributes.

  • Filtering data: Tables can also be used to filter data by text and/or by categories. For example, you could use a table to display a list of customers and allow the user to filter the list by name, location, or other attributes.

Featured Content

Changing the Menu Path The menu path can be modified.

Using the Grid

It is possible to use any number of rows.

PreviousChartsNextButtons Column

Last updated 1 year ago

Was this helpful?

💡
The table is in the default configuration.
Table with more data and title.
Table with links
Table with pagination activated
Table with the option to download the data
Result from a table named "test table"
Contents of the generated file
Product sales table
Filter by product and category