AlgebraicJulia / AlgebraicJulia/Semagrams.jl

Refactor semagrams initialization code

Ouverte
#130 9 commentaires 0 réactions 1 personne assignée Réclamée par @olynch Voir sur GitHub
Langage dominant
Scala
Étoiles
108
Forks
10
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.