can someone please help me to understand what is the difference between writing: import ipyleaflet

can someone please help me to understand what is the difference between writing: import ipyleaflet import solara url = ipyleaflet.basemaps.OpenStreetMap.Mapnik["url"] @solara.component def Page(): marker = ipyleaflet.Marker.element(location=(52.1, 10.1), draggable=True) map = ipyleaflet.Map.element( center=(52, 10), zoom=8, layers=[ ipyleaflet.TileLayer.element(url=url), marker, ], ) and, import ipyleaflet import solara class Map(ipyleaflet.Map): def init(self): super().init()
marker = ipyleaflet.Marker(location=(52.1, 10.1), draggable=True) tile_layer = ipyleaflet.TileLayer(url=url, name="name") self.center = (52, 10) self.zoom = 8 self.layers = [ tile_layer, marker ]
@solara.component def Page(): Map.element() ???
15 Replies
Cezik
Cezik5mo ago
Hello, has anyone encountered something like this where the ChatMessage component does not display the username above the message? I am using the TrainChatMessage component (my abstraction for a recurring component) and I am also attaching a screenshot of the application. I checked on pycafe with the example from the documentation and it correctly attaches the specified name over the message.
@solara.component
def TrainChatMessage(
message: TrainMessage,
):
with solara.lab.ChatMessage(
user=message['role'] == Role.USER,
name='User' if message['role'] == Role.USER else 'System',
avatar_background_color='primary',
color='#292929',
border_radius='20px',
notch=True,
):
solara.Markdown(message['content'])
@solara.component
def TrainChatMessage(
message: TrainMessage,
):
with solara.lab.ChatMessage(
user=message['role'] == Role.USER,
name='User' if message['role'] == Role.USER else 'System',
avatar_background_color='primary',
color='#292929',
border_radius='20px',
notch=True,
):
solara.Markdown(message['content'])
No description
jay
jay5mo ago
discord account nuker broncode @here
Cyrus
Cyrus5mo ago
Hi, I am trying to test auth with solara. I am noticing that the redirect_uri query param in the url of this request to the auth provider is not the same as the one that I pass to solara here. Instead of being something like {my_base_url}/_solara/auth/authorize it is http://{ip}:{port}/_solara/auth/authorize, which is not one of the allowed urls in the auth provider config, leading to a browser error. I tried setting SOLARA_BASE_URL=my_base_url but it did not work. Do you know where that redirect comes from and how I can overwrite it? Thanks!
MaartenBreddels
MaartenBreddels5mo ago
Did you check the https://solara.dev/documentation/advanced/enterprise/oauth possible issues section? I'm not sure what you mean by {http//:{ip_server}:{host}/_solara/auth/authorize ip and host combined doesn't seem correct
Using OAuth in your Solara app
Open Authorization can be readily integrated into your Solara applications via the Solara-Enterprise package.
Cyrus
Cyrus5mo ago
Sorry, I meant to say http://{ip}:{port} (typo). And yes I did see the docs, and it mentions to set SOLARA_BASE_URL=my_base_url to overwrite any defaults that solara might be using. But it seems like the default is still not being overwritten in this request because when I print out the request.session content I see something like
{
"data": {
"redirect_uri": "some_default_that_is_not_my_base_url/_solara/auth/authorize",
"nonce": "some_random_string",
"url": "https://{api_base_url}/oauth2/v1/authorize?response_type=code&client_id=xxxxxxxxxx&redirect_uri=some_default_that_is_not_my_base_url/_solara/auth/authorize&scope=openid+profile+email&state=some_long_string&nonce=some_long_string"
}
}
{
"data": {
"redirect_uri": "some_default_that_is_not_my_base_url/_solara/auth/authorize",
"nonce": "some_random_string",
"url": "https://{api_base_url}/oauth2/v1/authorize?response_type=code&client_id=xxxxxxxxxx&redirect_uri=some_default_that_is_not_my_base_url/_solara/auth/authorize&scope=openid+profile+email&state=some_long_string&nonce=some_long_string"
}
}
As the docs also say I should double check how HOST headers are being sent. Will let you know how that goes. Thanks!
izumi.qu
izumi.qu5mo ago
is these a bug or there is a correct way of using filter with cell_actions? @solara.component def CrossFilterDataFrame_mod( df, items_per_page=20, column_actions: List[ColumnAction] = [], cell_actions: List[CellAction] = [], scrollable=False, ): dff = df filter, set_filter = solara.use_cross_filter(id(df), "dataframe") if filter is not None: dff = df[filter] return solara.DataFrame( dff, items_per_page=items_per_page, scrollable=scrollable, column_actions=column_actions, cell_actions=[ solara.CellAction( icon=action.icon, name=action.name, on_click=lambda row, col, action=action: action.on_click(row, col, dff), ) for action in cell_actions ], ) a modified cell_actions which work fine in my case
dguerrero
dguerreroOP5mo ago
is there a way to change the version of fontawesome that is used in solara? I would like to use the latest v6 version, solara uses 5
MaartenBreddels
MaartenBreddels5mo ago
yes, we have https://github.com/widgetti/solara/blob/ce584ee660f30413706dfcc44148941c61b0149a/solara/server/settings.py#L82 which you can also set as env var: SOLARA_ASSETS_FONTAWESOME_PATH
Monty Python
Monty Python5mo ago
solara/server/settings.py line 82
fontawesome_path: str = "/[email protected]/css/font-awesome.min.css"
fontawesome_path: str = "/[email protected]/css/font-awesome.min.css"
izumi.qu
izumi.qu5mo ago
how Can I generate a wordcloud such like bar echarts? https://github.com/ecomfe/echarts-wordcloud?tab=readme-ov-file
GitHub
GitHub - ecomfe/echarts-wordcloud: Word Cloud extension based on Ap...
Word Cloud extension based on Apache ECharts and wordcloud2.js - ecomfe/echarts-wordcloud
izumi.qu
izumi.qu5mo ago
it is a third-parts extension for echarts...
No description
Dheeraj
Dheeraj5mo ago
hey ...what is minimum cpu and memory required to run solara application ? @everyone
dvein
dvein5mo ago
how to download solara
MaartenBreddels
MaartenBreddels5mo ago
this is not about roblox I think plotly does wordcloud
Cyrus
Cyrus5mo ago
Hi is there a way to force a solara application to use https scheme/protocol for redirect URIs (for auth). I tried setting SOLARA_SESSION_HTTPS_ONLY=True but it didn't work (more details in question-issue). Thanks!
Want results from more Discord servers?
Add your server