alizarin 2.0.0-alpha.98 → 2.0.0-beta.3
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 +21 -17
- package/dist/alizarin.full.js +1123 -671
- package/dist/alizarin.full.js.map +1 -1
- package/dist/alizarin.inline-full.js +1 -1
- package/dist/alizarin.inline.js +1 -1
- package/dist/alizarin.js +1 -1
- package/dist/alizarin_bg.wasm +0 -0
- package/dist/backend.d.ts +7 -0
- package/dist/csvModelLoader.d.ts +4 -3
- package/dist/full.d.ts +2 -2
- package/dist/graphManager.d.ts +2 -2
- package/dist/{main-eKsw3ofT.js → main-ChvJ0Ejx.js} +316 -233
- package/dist/main-ChvJ0Ejx.js.map +1 -0
- package/dist/pseudos.d.ts +1 -1
- package/dist/renderers.d.ts +2 -2
- package/dist/wasmTiming.d.ts +12 -4
- package/package.json +7 -4
- package/dist/main-eKsw3ofT.js.map +0 -1
package/README.md
CHANGED
|
@@ -38,36 +38,40 @@ npm install alizarin
|
|
|
38
38
|
### Basic Usage
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
|
-
import {
|
|
41
|
+
import { client, graphManager, staticStore, RDM } from 'alizarin';
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
const
|
|
45
|
-
|
|
43
|
+
// Point the shared graphManager (and the stores it uses) at an Arches instance
|
|
44
|
+
const archesClient = new client.ArchesClientRemote('https://your-arches-instance.org');
|
|
45
|
+
graphManager.archesClient = archesClient;
|
|
46
|
+
staticStore.archesClient = archesClient;
|
|
47
|
+
RDM.archesClient = archesClient;
|
|
48
|
+
await graphManager.initialize();
|
|
46
49
|
|
|
47
|
-
// Load a resource model
|
|
50
|
+
// Load a resource model and query all monuments
|
|
48
51
|
const MonumentModel = await graphManager.loadGraph('Monument');
|
|
49
|
-
|
|
50
|
-
// Query all monuments
|
|
51
52
|
const monuments = await MonumentModel.all();
|
|
52
53
|
|
|
53
|
-
//
|
|
54
|
+
// Property access is asynchronous — values are lazily hydrated, so `await` each.
|
|
54
55
|
for (const monument of monuments) {
|
|
55
|
-
console.log(monument.name);
|
|
56
|
-
console.log(monument.constructionDate);
|
|
57
|
-
console.log(monument.heritage_status
|
|
56
|
+
console.log(await monument.name);
|
|
57
|
+
console.log(await monument.constructionDate);
|
|
58
|
+
console.log(await monument.heritage_status); // concept: a String subclass, stringifies to its label
|
|
58
59
|
}
|
|
59
60
|
```
|
|
60
61
|
|
|
61
62
|
### Working with Static Data
|
|
62
63
|
|
|
63
64
|
```typescript
|
|
64
|
-
import {
|
|
65
|
+
import { client, graphManager, staticStore, RDM } from 'alizarin';
|
|
65
66
|
|
|
66
|
-
// Load from static JSON exports
|
|
67
|
-
const
|
|
68
|
-
|
|
67
|
+
// Load from static JSON exports (no live server needed)
|
|
68
|
+
const archesClient = new client.ArchesClientRemoteStatic('/data/exports');
|
|
69
|
+
graphManager.archesClient = archesClient;
|
|
70
|
+
staticStore.archesClient = archesClient;
|
|
71
|
+
RDM.archesClient = archesClient;
|
|
72
|
+
await graphManager.initialize();
|
|
69
73
|
|
|
70
|
-
// Usage is identical to remote client
|
|
74
|
+
// Usage is identical to the remote client
|
|
71
75
|
const PersonModel = await graphManager.loadGraph('Person');
|
|
72
76
|
```
|
|
73
77
|
|
|
@@ -105,7 +109,7 @@ newPerson.birthDate = new Date(1990, 5, 15);
|
|
|
105
109
|
- `NumberViewModel` - Numeric values
|
|
106
110
|
- `DateViewModel` - Date/time values
|
|
107
111
|
- `ConceptValueViewModel` - Controlled vocabulary concepts
|
|
108
|
-
- `
|
|
112
|
+
- `GeoJSONViewModel` - Geographic data
|
|
109
113
|
- `ResourceInstanceListViewModel` - Related resources
|
|
110
114
|
- `SemanticViewModel` - Complex nested structures
|
|
111
115
|
|