Solara

S

Solara

Join the community to ask questions about Solara and get answers from other members.

Join

questions-issues

general

announcements

Google Analytics?

Hello. Has anyone figured out how to inject a google analytics tag into the html <head>? Is this even possible with Solara? Are there any other website analytics for Solara?

Help with running solara

Hello! I am new to solara. I started using solara a couple weeks ago and it was running fine. I use "py -m solara run <filename>/.py" to run my web app on powershell. But tuday i encounter a problem when trying to run it....
No description

Citing solara

Hello! This may be a bit of an odd request, but I'm interested in citing solara. Some popular python packages, such as networkx and mesa provide BibTex citations for the packages. Is anything like this available for solara?

Embedding Solara / iframe / parameter

I would like to integrate Solara to the exiting application using iframe with passing arguments.
<iframe src="http://localhost:8765/?data=test" width="100%" height="100%"></iframe> How can I read arguments in Solara application? ...

Full Screen Output

I am getting an error whenever I click on the full screen button and it also occurs in the documentation, as an example. with the error --- ''' The above exception was the direct cause of the following exception: ...

Setting height of `ipyaggrid` in Solara app gives error

Hi, how can I set the height of a ipyaggrid that is being cross-filtered by a solara component? I am using @MaartenBreddels 's snippet here https://discord.com/channels/1106593685241614489/1106593686223069309/1212429587867504730. However, if I pass an integer height to the grid element like this ipyaggrid.Grid.element(..., height=500) it renders fine but then leads to this error: trait of a Grid instance expected a unicode string, not the int 500, whenever the data is filtered. Could it be a bug in ipyaggrid where the widget expects height to be an int but the trait is defined as unicode, leading to data type issues? I found a workaround but wonder if I am missing something or if there is a better approach. Thanks! ``` from typing import cast import ipyaggrid...

Streaming partial extraction

I want to replicate this streaming partial extraction: https://x.com/jxnlco/status/1755723172228350056 The basic idea is to use an LLM to extract some particular information (for example, name, e-mail and twitter login) from a text. I think I'm able to do it inside the solara chatbot example. That is, I send a message (which will not be displayed) just to activate the extraction and then I will stream the response within the solara.lab.ChatBox. I don't like this solution because ideally I would like to activate the extraction with a button, not with solara.lab.ChatInput. Any hint about how to accomplish this?...

OAuth example fails

https://solara.dev/documentation/examples/general/login_oauth clicking the button results in an error page with Callback URL mismatch.

Switching Tabs resets a state when lazy loading is set to True

I want to keep local state of components when switching Tabs but also I need lazy=True since I don't want inactive tabs to be rendered. Unfortunately, it seems to be impossible to have both. With lazy=True the local state of the components resets to default values, in the attached example I used solara.use_state, but the same holds true for solara.use_reactive. Is there a way to keep local state of the component when switching Tabs and having lazy loading too?...

Running a file vs running a module

Hello! I am trying to get solara up and running for use with mesa but am having some issues. I structured my code as a python package and would like to be able to run solara run my-package (or even better, just my-package) in the cli to start the server. Currently, running solara run __main__.py works, but for some reason running solara run my-package does not. Adding a print statement to __main__.py, I can see it being printed but solara does not appear to be able to find the route:
Page not found by Solara router
Page not found by Solara router
...

Multiple different solara apps under Fastapi endpoints?

Hi, I can follow the explanation from the docs to integrate one solara app into an existing FastAPI application https://solara.dev/docs/deploying/self-hosted ``` from fastapi import FastAPI...

Using existing plotly widget to update figures

With go.FigureWidget it is possible to update the data/properties of a figure without redrawing it. E.g. I can create a scatter plot with a lot of points: ``` N = 1000000 fig = go.FigureWidget(...

Multipage tab color

Is there a way to set the color of the page-tab text in a multipage application? I'm interested in setting the tab text color for both the selected and unselected states. I have tried various tests using style in the AppLayout component but had no luck.

Is there a way to filter the options in a select element

I want to use a select element but I have a rather big amount of options in my list, so I was wondering if it is possible to add a filter to the select element. I already tried the CrossFilterSelect element, but i need the style to be like the select element (without the element count percentage and "x of n").

Trying to understand state management

If I have a reusable component with an internal state value = use_reactive(42) linked to an IntSlider and I have multiple of these components on my page, how do I then get the values of all nested slider components to e.g. use in another component? e.g. ```python @solara.component...

Can't cancel running @task?

I've got a button triggered function that executes a for loop over a data set list and makes an API call for each. I added the @task decorator to keep it from holding up the UI, and a button triggered function to cancel the task(with a running check first). However, when I trigger the task(and I can see for sure that it's running from console logs), calling the task.cancel() didn't work. I threw in some log entries to check the task state, and they all indicate that the task isn't running(pending/is_current False, not_called True). Any ideas? I'll post the code shortly, I don't get discord on the work computer, so example code is a pain to bring over....

Possible to use custom vue components in `component_vue`?

In Voila, it was possible to register custom vue-only components by registering them with ipyvue, which made them available in the VuetifyTemplate use case. Is there an analog when using Solara? That is, can I register a custom vue component, and have it available in the vue file passed to component_vue? Registering it with ipyvue as before does not seem to work.

Plotly FigureWidget axes do not reset ranges within solara's render context

Upon applying an effect to set autorange=True to a figure with autorange='reversed', the Figure does not return to the original axes orientation. I'm wondering what happens behind the scenes here for the render when the use_effect is triggered. I can upload a ipynb with its expected behaviour within a jupyter context vs its behaviour in solara. The partial code (can give complete if needed). plotstate contains 2 reactives for flipx and flipy....

Interactive layout

There are a couple of defunt projects out there like jupyter-flex and jupyter-dashboard for creating user dashboards in Voila. Is there an easy to do create flexlayout interactive dashboards in Reacton/Solara?

Using vue libraries with ipyvuetify & solara

Is it naive to think vuepdf should work out of the box with a ipyvuetify template? I've stripped the code to its bare minimum, it should show a single pdf page from the url. My code isnt showing errors but it also isn't showing a pdf. vue_pdf.vue...