Raw HTML

An HTML component is used for inserting images, messages, links and texts on the page, to help document business processes or applications.

The method to use

The method is s.plt.html()

It must contain the following input variables:

html: str
order: int

And accepts the following input variables as optional:

rows_size: Optional[int]
cols_size: Optional[int]
padding: Optional[List[int]]

Examples

1. Default Configuration

s.plt.html(
    order=0,
    html=(
        "<p style='background-color: #daf4f0';>"
        "Comparing the results of predictions that happened in previous "
        "periods vs reality, so that you can measure the accuracy of our predictor."
        "</p>"
    ) 
)

2. Title for HTML, changing data, size and padding

s.plt.html(
    order=0, cols_size=8,
    padding='0,0,0,2',
    html=(
        "<p style='background-color: #daf4f0';>"
        "The goal of this logistics plan is to meet customer "
        "requirements in a timely, cost-effective manner."
        "</p>"
    )
)

3. Adding graphic HTML component

Warning: We do not recommend to abuse on this technique since it can remarkably reduce the performance of your Data App, if possible use Shimoku components.

This component is done using:

html = '''<div class="styles_grid_item_padding__MzexJ" style="grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); grid-area: span 1 / span 2 / span 2 / span 3; gap: 32px 16px;">
    <div class="css-upombs" data-testid="GRID_ITEM-92c7bf38-abb2-473e-8e10-7a446a93d9a5" style="grid-area: 1 / 1 / span 2 / span 2; min-height: 352px; max-height: 352px;">
        <div type="HTML" data-testid="REPORT-HTML-92c7bf38-abb2-473e-8e10-7a446a93d9a5" class="css-cgjako">
            <div class="ReportWrapper_container_report__cT7bu">
                <div class="styles_container__html__pgebp">
                    <div class="">
                        <style>.rectangle{height:300px; width:166px; background-color:#13bfa8; border-radius:0px 100px 0px 100px;}</style>
                        <div class="rectangle">
                            <h1 style="color:#fff; padding:10%;">This is a title</h1>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>'''

s.plt.html(
    order=0,
    html=html
)

Last updated