@bramas/simulant-ui 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +6 -6
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @bramas/simulant-ui
|
|
2
|
+
|
|
3
|
+
SolidJS interface for Simulant experiments: interactive execution navigation,
|
|
4
|
+
adversary choices, settings and presets, state inspection, algorithm source
|
|
5
|
+
highlighting, configuration graphs, and a view of the model and generated Lean.
|
|
6
|
+
|
|
7
|
+
## Start a simulator
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm create @bramas/simulant@latest my-project
|
|
11
|
+
cd my-project
|
|
12
|
+
npm install
|
|
13
|
+
npm run dev
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The generated project includes the Vite configuration and a working `.sim`
|
|
17
|
+
experiment. For an existing Solid/Vite project, install the UI and compiler
|
|
18
|
+
plugin:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install @bramas/simulant-ui solid-js
|
|
22
|
+
npm install --save-dev @bramas/simulant-vite-plugin vite-plugin-solid
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import SimulatorApp from '@bramas/simulant-ui/SimulatorApp';
|
|
27
|
+
import { simProject } from '@bramas/simulant-ui/sim/project';
|
|
28
|
+
import '@bramas/simulant-ui/simulator.css';
|
|
29
|
+
import * as model from './main.sim';
|
|
30
|
+
|
|
31
|
+
const projects = {
|
|
32
|
+
'cautious-pair': simProject(model, 'cautiousPair'),
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default () => <SimulatorApp projects={projects} />;
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Configure Vite with `solid({ exclude: [] })` and `simulant()`; the published UI
|
|
39
|
+
contains Solid JSX that the consuming application must compile. Include the
|
|
40
|
+
Simulant plugin in graph workers too. The initializer supplies this setup.
|
|
41
|
+
|
|
42
|
+
`simProject` supplies a settings form, execution adapter, model description,
|
|
43
|
+
state inspector and default ring renderer from the compiled experiment.
|
|
44
|
+
Projects can supply a custom drawing function, agent names and aliases for
|
|
45
|
+
older parameter names. Settings outside declared domains produce advisory
|
|
46
|
+
warnings; execution remains available.
|
|
47
|
+
|
|
48
|
+
The package uses subpath exports: `SimulatorApp`, `sim/*`, `components/*`,
|
|
49
|
+
`renderers/*`, and the CSS files. It has no root import.
|
|
50
|
+
|
|
51
|
+
[Project guide](https://github.com/Bramas/simulant/tree/main/projects/starter)
|
|
52
|
+
· [Architecture](https://github.com/Bramas/simulant/blob/main/docs/architecture.md)
|
|
53
|
+
· [Source](https://github.com/Bramas/simulant/tree/main/packages/simulator-ui)
|
|
54
|
+
|
|
55
|
+
Licensed under CeCILL-B; see `LICENCE.txt`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bramas/simulant-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "CECILL-B",
|
|
6
6
|
"type": "module",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@bramas/simulant-
|
|
35
|
-
"@bramas/simulant-
|
|
36
|
-
"@bramas/simulant-
|
|
37
|
-
"@bramas/simulant-
|
|
38
|
-
"@bramas/simulant-
|
|
34
|
+
"@bramas/simulant-engine": "0.1.2",
|
|
35
|
+
"@bramas/simulant-core": "0.1.2",
|
|
36
|
+
"@bramas/simulant-lean-gen": "0.1.2",
|
|
37
|
+
"@bramas/simulant-vite-plugin": "0.1.2",
|
|
38
|
+
"@bramas/simulant-lang": "0.1.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"solid-js": "^1.9.3"
|