Solara

S

Solara

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

Join

questions-issues

general

announcements

Trying to show a shap plot with solara

This is the code for the image: df_encoded is a global variable that has been updated in another function #imports... shap_image = solara.reactive(None)...

Troubleshooting Jupyter Lab Installation

When I run the Solara getting started code (word count) I get the not so helpful "Error displaying widget" message. I followed the troubleshooting guide and ran solara.check_jupyter(force = True) and it showed that ipyvuetify and ipvue is installed at the server. I'm running under Anaconda on Ubuntu and Chrome...

How to execute code that was generated by the solara chatbot?

I was already able to extract the code block that was returned from the chat interface. Now I want to execute that code and show the result in a solara component. Is there an easy way to directly execute this new code? Thanks for any advice on this!...
No description

Changing text color in a Selectable DataTable cell by using an external function

Hello, I am trying to customize certain cells display in DataTable by using for example a format function. I am trying to do this on a DataTable that allows me to select rows for further inspection. I managed to get the "selectable" part by using rv.DataTable instead of solara.DataFrame/DataTable and setting up v_model="selected" and using on_v_model to get results back. ...

Model Interaction Interface

Hello, has anyone done a Solara web app to interact with a ML model and get predictions based on some inputs? If so, please text me or send me any information on how to proceed. Thank you very much....

Example vue component using `<script setup>` pattern?

There are numerous helpful templates in solara's vue components. However, they all use the Options API, including in the vuetify and ipyvuetify documentation. Can you provide an example Composotion API example that shows how to expose data attributes, calling JS functions, etc.? Does it all work the same way? Thanks for the amazing library, by the way!...

Highlight values in dataframe

Hello, I have a dataframe with a bunch of numbers and want to find extremes and show what is going on in these cases. To locate extremes I find useful to style dataframe by df.style.background_gradient and show by solara.display. However, with this I cannot attach cell actions. When using solara.DataFrame I can attach cell actions, but it does not work for styled dataframes. Is there any chance to combine both? The attempt is attached, but it does not work due the lack of pandas and seaborn ...

Sidebar not hiding

My sidebar is not collapsing I am assuming it is an environment issue. I have tried with Solara==1.39.0 and Solara==1.34.1 I am also running: python 3.12...

Current best practices for deploying a solara app for testing on an ubuntu server(or other)?

What are the current best practices for deploying a solara app for testing?

Solved: Can solara.Card(title="Long title to word wrap instead of wrapping mid word")?

Looks a little funny that longer titles on solara.Card wrap mid word rather than on whitespace. Any solution to this?

Nested Vue Component import for Web

Hi all, I'm new to Solara and is planning on using Vue for interactive components for web development that include drag and drop (e.g., kanban boards). I have some experience with Vue, but I can't figure out how imports work with a Vue component....

Solved: Solara example apps not working at the moment

Tried to study Solara example app https://solara.dev/apps/jupyter-dashboard-1 but it renders empty page (only empty page with 'This website runs on Solara' text). I'm in MacOS Sonoma and Chrome browser. Developer console shows: ...

Annoying transition between Plotly figure updates

I have a data analysis application that allows selection from a number of datasets. When updating the FigurePlotly component with a new figure, an odd multi-step transition occurs in the figure. Does anyone know what is going on and how to force a cleaner transition? I have tried several ideas such as updating only the data in the figure structure but nothing works. Is this transition inherent to Solara or Plotly (since Solara uses the Plotly FigureWidget)?...

rendering pdf

```py @solara.component def Page(): solara.use_effect(generate_pdf, dependencies=[]) ...

CrossFilterPlotlyFigure

I am struggling a bit to make more complex layout figures with crossfilter enabled. In the app example below the two figures should look the same, but some of the layout properties are not properly passed by the solara_px wrap. https://py.cafe/balbinot/euclid-ou-ext-tileviewer Mainly the marker_line_width is ignore on render for some reason. Any tips on how to fix this?...

Debugging Solara in PyCharm

Hi all, I want to stop a debug point when I'm interacting with a component in browser. I tried to find some documentation about setting up debugging in PyCharm when working with Solara libraries. But the official documentation suggesting to use "pdb" and "debugpoint()" Is there any easier way to setup debugging and be able to stop at a point in a code when some button is pressed or an event is invoked? ...

Disable "FileDownload" button once user has downloaded the file

Hi, I would like to disable to "FileDownload" button once the user has downloaded the file but struggling to find a solution. Something along these lines: def DownloadFile(file_object, file_name): def done():...

Preventing parent re-renders or preventing input fields from losing their current value on re-render

Hi all. I have a Solara application where there is a separate thread (using solara.thread) that periodically performs some work and updates a text component, at some interval. In addition, there are some other components that use solara.InputInt/solara.InputFloat/solara.InputText that the user can interact with. However, if the user is in the middle of inputting a value (the cursor is located in the Input component) and the thread runs its work and updates its text component, the current value of the Input component is resetted. This makes it very hard to input values if the thread runs at .e.g. once every second, as it will just reset the value the user tries to input....

Markdown editor not entering space characters properly

When using the markdown editor, new lines will not accept spaces as input. Every time a space char is inputted, it is displayed and then immediately overwritten by whatever the user types next. However, if the space is deleted by the user by pressing backspace, the bug goes away and the editor works as intended (on that line). By looking at the raw markdown, you can see that the string "&#x20;" is appended at the end of the line. It looks like the presence of that char at the end of the line fixes the bug. I tested it in both vscode and mozilla firefox (both solara server and jupyter lab) and i can reproduce in all of them....

How to cancel task?

Hello, I tried to cancel tasks which are not current and tried the following code. My expectation was, that the task will wait until the previous task is finished and if it is not current anymore, then it is canceled (From the docs: The task object will execute the function only once per virtual kernel and will only store one result per virtual kernel. When called multiple times, the previously started thread or asyncio task result will be ignored.) So my expectation was, that if I click 10-times the button when running the task for the first time, some of the tasks will be canceled and the total number of runs will be smaller than the number of clicks. What I am doing wrong? The code is shared as gist, since it does not run in pycafe, (however it works fine on local PC) and the URL generated by pycafe is too long https://gist.github.com/robert-marik/f41782f83e361636677099808cf1621a...