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
  • Functioning
  • Properties
  • Order
  • Column
  • Row
  • Padding
  • Information of interest – Q & A
  • Examples

Was this helpful?

  1. Building Web App

Grid

PreviousDeleting the Menu PathNextUsing the Grid

Last updated 1 year ago

Was this helpful?

The grid is the distribution system for the charts, tables and other components in the views that we are creating. To make the customization of these views as comfortable as possible, but at the same time easy to create, the basic operating concepts of the grid are shown below.

Functioning

To create our dashboard in a customized way, we have to give the components an order, and define what size they will occupy on the screen. By default, the grid is divided as follows:

  • 12 auto-sized columns.

  • Infinite rows of fixed size (160 pixels in height).

Properties

Order, Columns, Rows, Padding: [ top, right, bottom, left ]

The following properties act on the components to give them size, position and space if required.

Order

  • Place the component in a position from 0 to n The property places elements from left to right, starting at 0 and following a logical order, 0,1,2,3...etc.

If an order is not defined for a component, it will be placed visually as the last element.

Columns and padding: The maximum number of columns for a component is 12 (including padding). If a component exceeds this number, the width of the columns will be subtracted to fit.

A component with 8 columns and 4 padding on the left and on the right. The end result will be a component with 4 columns and 4 padding on the left and on the right, as in here:

Column

  • Defines the width size of a component.

  • At most 12 columns can be defined.

  • If more than 12 columns are defined, the component will avoid the number and will define the maximum possible columns(12).

  • If columns are not defined, the components have predefined sizes for their correct visualization.

  • If the component does not have enough size in columns, a horizontal scroll will appear.

Row

  • Defines the height size of a component.

  • Infinite rows can be used.

  • If rows are not defined, the components have predefined sizes for their correct visualization.

  • If the component does not have enough size in rows, a vertical scroll will appear.

  • With indicators the minimum rows_size is 2; thecols_size must accommodate the text that you want to show, maximum cols_size is 12.

  • HTML: its rows_size will not have a minimum height of 160px (like all other components), it will only take up the necessary space.

Padding

  • Defines the size of space around a component.

  • It has 4 sub-properties (padding-top, padding-right, padding-bottom, padding-left) These are always set in a clockwise direction, first up, then right, then down, and finally left.

  • Each sub-property leaves a different space, being the right and left paddings the ones that leave space the size of the column width. On the other hand, the top and bottom padding will leave space of the size of the rows.

  • On mobile devices all components will be placed one below the other and padding will be removed.

This property is not mandatory in the definition of a component

Information of interest – Q & A

The breakpoint at which the drawer (left menu) appears is 900px. The width of the drawer is 240px. It’s fixed. It doesn’t scale. The height of the top navbar is 66px. It doesn’t scale. 1. What is the actual distance between columns and rows, and what is the behavior when it comes to scaling? The column gap is 16px and the row gap is currently 32px. The width of the columns is automatic and is reduced with the screen. The height of the rows is not automatic and is not reduced at any time, currently. The redistribution of the elements is done automatically as the screen is reduced. The behavior that we now have inherited from a MUI material breakpoint, is that at less than 1200px, all the elements start to be distributed as in “mobile”. Putting one under the other. We will also change the breakpoint, coming soon.

2. How does the space between the grid boxes influence the padding? The gaps are added to the padding. We will work on a better idea for the use of padding.

3. Can the padding be subdivided? The minimum size of one box is quite rough. Currently, we cannot subdivide the padding. We understand that it is a pain point because the size in some cases can be very large. We will consider it.

4. What is the behavior of text/graph inside a component? How is it arrangeable? Texts (HTML components) have special behavior in the grid. The texts (HTML components), if they are not told otherwise, do not have the height of 160px of a row. The texts have the height defined in their style, if it is a title for example, by having a larger font width and line height. Your row will be taller than the base text for example.

Examples

from os import getenv
import datetime as dt

from shimoku import Client

universe_id: str = getenv('UNIVERSE_ID')
workspace_id: str = getenv('WORKSPACE_ID')
environment: str = getenv('ENVIRONMENT')
access_token: str = getenv('API_TOKEN')

s = Client(
    access_token=access_token,
    universe_id=universe_id,
    environment=environment,
    verbosity='INFO',
    async_execution=True
)
s.set_workspace(uuid=workspace_id)
s.set_board('Custom Board')
s.set_menu_path('menu path', 'sub-path')

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.html(html='<h1>Test</h1>', order=0)

s.plt.bar(
    data=data, x='date',
    order=1, rows_size=2, cols_size=6
)

s.plt.bar(
    data=data, x='date',
    order=2, rows_size=2, cols_size=4,
    padding="2, 2, 2, 2"
)

s.run()

For more information refer to .

For more information refer to .

🛠️
Using the grid
Using the grid
12 columns and infinite rows.
Size of rows and columns, and gaps between them.
Examples of using order, rows_size, cols_size and padding to locate a component in the page.