mariobuikhuizen
mariobuikhuizen
SSolara
Created by Wyvn on 10/11/2024 in #questions-issues
ipyaggrid switch between light and dark mode
Not plans yet. Anything specific you need from the newer versions?
12 replies
SSolara
Created by Wyvn on 10/11/2024 in #questions-issues
ipyaggrid switch between light and dark mode
ah, no, theme isn't wired to update on change in ipyaggrid I see now. It did seem to work when I tried it on py.cafe, but that was the hot reload.
12 replies
SSolara
Created by Wyvn on 10/11/2024 in #questions-issues
ipyaggrid switch between light and dark mode
12 replies
SSolara
Created by Wyvn on 10/11/2024 in #questions-issues
ipyaggrid switch between light and dark mode
yeah, you can use ag-theme-dark as dark theme
12 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
v3.0.0alpha4 now supports typescript. Example: https://py.cafe/mariobuikhuizen/vue3-script-setup-ts
11 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
yeah, I just found out I couldn't access the poperties in data from <script setup>. Maybe I can make it optional to use Composition for the databinding.
11 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
11 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
Yeah, I think it's possible, I will also see if I can get that working.
11 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
I've released a new alpha version of ipyvue, which has support for setup() and <script setup>. Minimal demo: https://py.cafe/mariobuikhuizen/vue3-script-setup
11 replies
SSolara
Created by ntjess on 9/23/2024 in #questions-issues
Example vue component using `<script setup>` pattern?
Hi @ntjess , ipyvue[tify] is based on Vue[tify] 2, the composition API was introduced in Vue3. We've started working on a Vue3 version of ipyvue[tify] and an alpha relaase is available (ipyvue==3.0.0a2 and ipyvuetify==3.0.0a2). However, I just found out the composition API is not yet working. I think I can fix it fairly quickly if you're interested in trying the alpha version. I can then also create an example. Everything will still work the same, but with the new Vue3 syntax (and the new feature of being able to load esmodules). Note that the data binding will still be done with the options API internally.
11 replies
SSolara
Created by fnc00 on 9/17/2024 in #questions-issues
Current best practices for deploying a solara app for testing on an ubuntu server(or other)?
9 replies
SSolara
Created by Delkrak on 9/15/2024 in #questions-issues
Nested Vue Component import for Web
Example of doing the composing in Solara: https://py.cafe/mariobuikhuizen/solara-compose-vue
7 replies
SSolara
Created by Delkrak on 9/15/2024 in #questions-issues
Nested Vue Component import for Web
It's also possible to compose in Solara, wil make an example for that ...
7 replies
SSolara
Created by Delkrak on 9/15/2024 in #questions-issues
Nested Vue Component import for Web
You'll need to use ipyvue.register_component_from_file to register the component. Also, we need to use modules.export = in stead of export default in the templates. Note: <style scoped> is not supported, it will do the same as just <style>
7 replies
SSolara
Created by Delkrak on 9/15/2024 in #questions-issues
Nested Vue Component import for Web
7 replies
SSolara
Created by Cyrus on 8/8/2024 in #questions-issues
Redirect URI error when testing login in solara app
Is URL of the browser error your configured SOLARA_OAUTH_API_BASE_URL ? or is it showing: dev-y02f2bpr8skxu785.us.auth0.com?
13 replies
SSolara
Created by Jan-Hendrik Müller on 8/8/2024 in #questions-issues
How to make `slider.value` reactive?
nice!
5 replies
SSolara
Created by Jan-Hendrik Müller on 8/8/2024 in #questions-issues
How to make `slider.value` reactive?
Hi @Jan-Hendrik Müller, you can replace silder.value with solara.use_trait_observe(slider, "value")
5 replies
SSolara
Created by Chainedflows on 7/6/2024 in #questions-issues
ipyaggrid styling
@solara.component
def Page():
data = solara.use_reactive([
{"make": "Toyota", "model": "Celica", "price": 35000, "rowColor": True},
{"make": "Ford", "model": "Mondeo", "price": 32000},
{"make": "Porsche", "model": "Boxster", "price": 72000}
])

first_row_color = solara.lab.Ref(data.fields[0]["rowColor"])

AgGrid(
css_rules="""
div.ag-cell.my-green {
background-color: lightgreen;
}
""",
grid_data=data.value,
grid_options={
"defaultColDef": {
"cellClass": """function(params) {
return params.data.rowColor ? "my-green" : "";
}""",
},
"columnDefs": [
{"headerName": "Make", "field": "make"},
{"headerName": "Model", "field": "model"},
{"headerName": "Price", "field": "price"}
],
},
)

def toggle():
first_row_color.value = not first_row_color.value

solara.Button("toggle row color", icon_name="mdi-plus", color="primary", on_click=toggle)

solara.Text("We can use JavaScript code in the grid_options, see aggrid docs on how to use it:")
link = "https://www.ag-grid.com/archive/28.1.1/javascript-data-grid/cell-styles/#cell-class"
solara.HTML(tag="div", unsafe_innerHTML=f'<a href="{link}">{link}</a>')

@solara.component
def Page():
data = solara.use_reactive([
{"make": "Toyota", "model": "Celica", "price": 35000, "rowColor": True},
{"make": "Ford", "model": "Mondeo", "price": 32000},
{"make": "Porsche", "model": "Boxster", "price": 72000}
])

first_row_color = solara.lab.Ref(data.fields[0]["rowColor"])

AgGrid(
css_rules="""
div.ag-cell.my-green {
background-color: lightgreen;
}
""",
grid_data=data.value,
grid_options={
"defaultColDef": {
"cellClass": """function(params) {
return params.data.rowColor ? "my-green" : "";
}""",
},
"columnDefs": [
{"headerName": "Make", "field": "make"},
{"headerName": "Model", "field": "model"},
{"headerName": "Price", "field": "price"}
],
},
)

def toggle():
first_row_color.value = not first_row_color.value

solara.Button("toggle row color", icon_name="mdi-plus", color="primary", on_click=toggle)

solara.Text("We can use JavaScript code in the grid_options, see aggrid docs on how to use it:")
link = "https://www.ag-grid.com/archive/28.1.1/javascript-data-grid/cell-styles/#cell-class"
solara.HTML(tag="div", unsafe_innerHTML=f'<a href="{link}">{link}</a>')

Run and edit this code snippet at PyCafe
7 replies
SSolara
Created by Chainedflows on 7/6/2024 in #questions-issues
ipyaggrid styling
Some thing like this?: (I can't reproduce the errors when clicking on a component)
import solara
from ipyaggrid import Grid

@solara.component
def AgGrid(grid_data, grid_options, **kwargs):

def update_data():
widget = solara.get_widget(el)
widget.grid_options = grid_options
widget.update_grid_data(grid_data)

el = Grid.element(
grid_data=grid_data,
grid_options=grid_options,
**kwargs,
)

solara.use_effect(update_data, [grid_data, grid_options])
import solara
from ipyaggrid import Grid

@solara.component
def AgGrid(grid_data, grid_options, **kwargs):

def update_data():
widget = solara.get_widget(el)
widget.grid_options = grid_options
widget.update_grid_data(grid_data)

el = Grid.element(
grid_data=grid_data,
grid_options=grid_options,
**kwargs,
)

solara.use_effect(update_data, [grid_data, grid_options])
7 replies