AlgebraicJulia / AlgebraicJulia/Semagrams.jl

Refactor semagrams initialization code

Aperta
#130 9 commenti 0 reazioni 1 assegnatario Rivendicata da @olynch Vedi su GitHub
Lingua principale
Scala
Stelle
108
Fork
10
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.