[Question] Accessing Model sub-structures
See original GitHub issueHello! Let me begin by thanking you for the amazing framework, I started playing with Stipple two days ago and I find it rather pleasant to use (except for the lack of docstrings, but well, that’s life).
I am trying to develop a fairly complex dashboard to monitor my simulations, and would like to split my model, which otherwise will have more than 100 fields, into several sub-structures for code clarity and maintainability/sanity.
However, I need to be able to read/set those fields from some UI elements like Selector, Checkboxes or plot them.
Is it possible to turn something like
Base.@kwdef mutable struct Model <: ReactiveModel
group1_field1::R{Bool} = true
group1_field2::R{Bool} = true
group1_field3::R{Bool} = true
group2_field1::R{Bool} = true
group2_field2::R{Bool} = true
group2_field3::R{Bool} = true
...
end
model = Stipple.init(Model())
function ui()
[dashboard(vm(model),class = "container",title = "My thingy",[
heading("Group1"),
checkbox("Field1", : group1_field1),
checkbox("Field2", : group1_field2),
checkbox("Field3", : group1_field3),
heading("Group2"),
checkbox("Field1", : group2_field1),
checkbox("Field2", : group2_field2),
checkbox("Field3", : group2_field3),
])]
end
into something like
Base.@kwdef mutable struct ModelGroup
field1::R{Bool} = true
field2::R{Bool} = true
field3::R{Bool} = true
end
Base.@kwdef mutable struct Model <: ReactiveModel
group1::R{ModelGroup} = ModelGroup(true, true, false)
group2::R{ModelGroup} = ModelGroup(true, true, false)
end
and still use it from the ui?
Issue Analytics
- State:
- Created 2 years ago
- Comments:27 (15 by maintainers)
Top Results From Across the Web
Leveraging Frequent Query Substructures to Generate ...
In this paper, we propose SubQG, a new query generation approach based on frequent query substructures, which helps rank the existing (but ...
Read more >How do I create and use Sub Structures to filter my model?
Sub Structures can be useful to filter drawings and reports, create smaller views, design certain members ... Access the Report ribbon; Click Model...
Read more >Optimal Substructure Property in Dynamic Programming
A given problem is said to have Optimal Substructure Property if the optimal solution of the given problem can be obtained by using...
Read more >Access List inside model - asp.net mvc
This model holds all data to be shown in the View and is created by the Controller.
Read more >Recognizing Protein Substructure Similarity Using Segmental ...
First, the conserved structure pieces excised from different protein structures can be directly used to assemble new protein structure models in approaches such ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

It’s done and, as far as I can see, works like a charm. See also my post in PR 43. So now we have
For me it’s still not clear what Dicts are we talking about. Is this about
Stipple.render?I believe it’s useful to brainstorm features and improvements as they pop-up in different contexts, but to address them properly we should set separate issues for each individual topic with a well defined problem and a minimal working example.