Код: Выделить всё
from shiny import App, ui, render, reactive
import folium
app_ui = ui.page_fluid(
ui.tags.style(
"""
/* apply css to control height of some UI widgets */
.map-container {
height: 700px !important;
width: 100%;
overflow: hidden;
}
.map-container > * {
height: 100% !important;
}
"""
),
ui.column(6,
ui.navset_card_tab(
ui.nav_panel("Map",
ui.div(
ui.output_ui("map"),
class_="map-container"
)
),
ui.nav_panel("Data",
ui.p(
ui.output_table("data_table")
)
)
)
)
)
def server(input, output, session):
@output
@render.ui
def map():
m = folium.Map(location=[51.509865, -0.118092], zoom_start=12)
return ui.HTML(m._repr_html_())
@output
@render.table
def data_table():
# Your data table rendering logic here
pass
app = App(app_ui, server)
В Shiny for R я добился того же результата, используя функцию as_fill_carrier() из bslib вот так:
Код: Выделить всё
card(
style = "height: 80vh;",
full_screen = TRUE,
#card_header("Map"),
card_body(
tmapOutput("map") %>%
withSpinner(type = 6, color = "#30804e") %>% as_fill_carrier()
)
)
)
Подробнее здесь: https://stackoverflow.com/questions/790 ... -container