AlgebraicJulia / AlgebraicJulia/Semagrams.jl
Refactor semagrams initialization code
- Ngôn ngữ chính
- Scala
- Star
- 108
- Fork
- 10
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
Currently, Semagrams calls the render function inside its intialization code:
https://github.com/AlgebraicJulia/Semagrams.jl/blob/01b51a602e5fcf309497ee7d9e77aba6cc266c57/scala/core/src/base.scala#L66-L79
It would be better to separate the code that creates the svg element into something like a "semagram widget", so that it can be inserted at arbitrary places inside of a Laminar application. In the long run, I think we may realistically want to have multiple "semagram widgets" within a more complex DOM structure.
I think it would be nice if the "apps" were in control of calling `render` and determining what gets passed to it.
```
val sharedState: ACSet = ...
val appElement = div(
h1("Process"),
SemagramWidget(projectProcess(sharedState)),
h1("Structure"),
SemagramWidget(projectStructure(sharedState)),
)
render(appContainer, appElement)
```
The pseudo-code above is meant to illustrate a page with two embedded semagram widgets that share some common state via an `ACSet`. It's intended as a sketch, a lot of details still need to be fleshed out.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.