graphwise-reactodia 0.0.1-TR1 → 0.0.1-TR10

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.
Files changed (54) hide show
  1. package/README.md +115 -1
  2. package/dist/cjs/graphwise-reactodia.cjs.entry.js +27276 -41135
  3. package/dist/cjs/graphwise-reactodia.cjs.js +1 -1
  4. package/dist/cjs/index.cjs.js +7 -0
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/collection/components/graphwise-reactodia/graphwise-reactodia.js +69 -34
  7. package/dist/collection/components/graphwise-reactodia/i18n/language-key.js +5 -0
  8. package/dist/collection/components/graphwise-reactodia/i18n/translations.js +3 -1
  9. package/dist/collection/components/graphwise-reactodia/models/clear-diagram-storage-event.js +5 -0
  10. package/dist/collection/components/graphwise-reactodia/models/reactodia-config.js +1 -0
  11. package/dist/collection/components/graphwise-reactodia/models/subscription-list.js +35 -0
  12. package/dist/collection/components/graphwise-reactodia/models/subscription.js +1 -0
  13. package/dist/collection/components/graphwise-reactodia/models/triple.js +1 -0
  14. package/dist/collection/components/graphwise-reactodia/providers/service/service-inject.js +15 -0
  15. package/dist/collection/components/graphwise-reactodia/providers/service/service.js +19 -0
  16. package/dist/collection/components/graphwise-reactodia/providers/service/service.provider.js +20 -0
  17. package/dist/collection/components/graphwise-reactodia/reactodia-app.js +107 -17
  18. package/dist/collection/components/graphwise-reactodia/services/diagram/diagram.service.js +54 -0
  19. package/dist/collection/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.js +55 -0
  20. package/dist/collection/components/graphwise-reactodia/services/event/event.service.js +35 -0
  21. package/dist/collection/components/graphwise-reactodia/services/window/window.service.js +24 -0
  22. package/dist/collection/components/graphwise-reactodia/styles/type-style.resolver.js +53 -0
  23. package/dist/collection/components/graphwise-reactodia/testing/storage.mock.js +35 -0
  24. package/dist/collection/index.js +1 -1
  25. package/dist/collection/pages/graphwise-reactodia/main.js +50 -0
  26. package/dist/esm/graphwise-reactodia.entry.js +27273 -41132
  27. package/dist/esm/graphwise-reactodia.js +1 -1
  28. package/dist/esm/index.js +6 -0
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/graphwise-reactodia/graphwise-reactodia.esm.js +1 -1
  31. package/dist/graphwise-reactodia/index.esm.js +1 -0
  32. package/dist/graphwise-reactodia/p-b56c58a0.entry.js +1 -0
  33. package/dist/types/components/graphwise-reactodia/graphwise-reactodia.d.ts +25 -12
  34. package/dist/types/components/graphwise-reactodia/i18n/language-key.d.ts +4 -0
  35. package/dist/types/components/graphwise-reactodia/i18n/translations.d.ts +2 -343
  36. package/dist/types/components/graphwise-reactodia/models/clear-diagram-storage-event.d.ts +5 -0
  37. package/dist/types/components/graphwise-reactodia/models/reactodia-app-props.d.ts +15 -14
  38. package/dist/types/components/graphwise-reactodia/models/reactodia-config.d.ts +31 -0
  39. package/dist/types/components/graphwise-reactodia/models/subscription-list.d.ts +26 -0
  40. package/dist/types/components/graphwise-reactodia/models/subscription.d.ts +4 -0
  41. package/dist/types/components/graphwise-reactodia/models/triple.d.ts +19 -0
  42. package/dist/types/components/graphwise-reactodia/providers/service/service-inject.d.ts +13 -0
  43. package/dist/types/components/graphwise-reactodia/providers/service/service.d.ts +28 -0
  44. package/dist/types/components/graphwise-reactodia/providers/service/service.provider.d.ts +16 -0
  45. package/dist/types/components/graphwise-reactodia/services/diagram/diagram.service.d.ts +26 -0
  46. package/dist/types/components/graphwise-reactodia/services/diagram-storage/diagram-storage.service.d.ts +26 -0
  47. package/dist/types/components/graphwise-reactodia/services/event/event.service.d.ts +14 -0
  48. package/dist/types/components/graphwise-reactodia/services/window/window.service.d.ts +7 -0
  49. package/dist/types/components/graphwise-reactodia/styles/type-style.resolver.d.ts +11 -0
  50. package/dist/types/components/graphwise-reactodia/testing/storage.mock.d.ts +18 -0
  51. package/dist/types/components.d.ts +37 -25
  52. package/dist/types/index.d.ts +1 -1
  53. package/package.json +31 -8
  54. package/dist/graphwise-reactodia/p-bafd6be5.entry.js +0 -1
package/README.md CHANGED
@@ -1,2 +1,116 @@
1
1
  # graphwise-reactodia
2
- Graphwise wrapper around Reactodia graph explorer
2
+
3
+ Graphwise wrapper (Stencil component) around the [Reactodia](https://github.com/reactodia/reactodia-workspace) graph explorer.
4
+
5
+ Reactodia is vendored as a **git submodule** (`reactodia-workspace/`, pointing at our [fork](https://github.com/Ontotext-AD/reactodia-workspace-fork)).
6
+ It's built first, then consumed by Stencil as a normal ES module via a `file:` dependency.
7
+
8
+ ## Setup
9
+
10
+ After cloning the repo for the first time you will need to update git submodules, which will fetch the Reactodia fork:
11
+ ```bash
12
+ cd graphwise-reactodia
13
+ git submodule update --init --recursive
14
+ ```
15
+
16
+ Install dependencies, which will symlink the Reactodia fork into `node_modules`:
17
+ ```bash
18
+ npm install
19
+ ```
20
+
21
+ ## Develop
22
+ For development run:
23
+ ```bash
24
+ npm start
25
+ ```
26
+
27
+ ## Build
28
+ Build the fork and the Stencil component:
29
+ ```bash
30
+ npm run build
31
+ ```
32
+
33
+ `npm start` and `npm run build` both run `reactodia:build` first, which installs and builds the fork
34
+ (`reactodia:install` + `reactodia:compile`), then runs `reactodia:dedupe-react` to remove the fork's own
35
+ `react`/`react-dom` copies so the bundle ends up with a single React instance.
36
+
37
+ ## Seeding the canvas
38
+
39
+ By default the canvas starts empty and the user populates it through the workspace search bar. The host can
40
+ instead pre-populate it on startup by passing seed data through `config` (see `ReactodiaAppProps`). Seeding is
41
+ skipped when an `initialDiagram` is restored (e.g. after a language-change remount). There are two mechanisms,
42
+ handled in `reactodia-app.ts`:
43
+
44
+ ### `seedIris` — lazy seed
45
+
46
+ `config.seedIris` is a list of element(node) IRIs. Each IRI is placed as a placeholder node, then `seedCanvas` calls
47
+ the model's `requestData()` so both the element data **and** its links are fetched from the SPARQL endpoint.
48
+ Use this when the relationships are persisted in the repository and can be resolved lazily.
49
+
50
+ ### `seedGraph` — pre-resolved seed
51
+
52
+ `config.seedGraph` is a list of `Triple` objects (mirroring GraphDB's `rest/explore-graph` shape).
53
+ `seedGraphCanvas` places each `source`/`target` as an element and draws the supplied links directly, then
54
+ requests **element data only** (`requestElementData`) — it does *not* ask the endpoint for links.
55
+
56
+ Use this for the result of a CONSTRUCT/DESCRIBE query, whose relationships are computed and therefore not
57
+ persisted in the DB, so they can't be fetched lazily and must be supplied by the host.
58
+
59
+ `Triple` (`models/triple.ts`):
60
+
61
+ | Field | Description |
62
+ |-----------------|----------------------------------------------------------|
63
+ | `source` | Source element IRI. |
64
+ | `target` | Target element IRI. |
65
+ | `rawPredicates` | Full (absolute) predicate IRIs — used as the link types. |
66
+
67
+ When both are supplied `seedGraph` takes precedence over `seedIris`.
68
+
69
+ ## Editing the fork
70
+
71
+ Reactodia lives in the `reactodia-workspace/` submodule, which is its own git repo (remote:
72
+ [reactodia-workspace-fork](https://github.com/Ontotext-AD/reactodia-workspace-fork)). The parent repo does not
73
+ store the fork's files — it stores a single pointer to a commit in the fork. So a fork change involves two repos
74
+ and two commits: one in the fork (the source change) and one here (the pointer bump).
75
+
76
+ Simple setup in IntelliJ so you don't switch between projects: map the submodule as a second VCS root
77
+ (Settings → Version Control → Directory Mappings → add `reactodia-workspace`) so both repos appear
78
+ in the branch widget and Commit panel.
79
+
80
+ ### Testing fork changes locally
81
+
82
+ `npm start` and `npm run build` both run `reactodia:build`, which recompiles the fork from its current
83
+ files, so edits are picked up immediately.
84
+
85
+ ### Persisting a fork change
86
+ 1. In the fork (reactodia-workspace/): create a new branch,
87
+ 2. Make edit, commit and push changes
88
+ 3. Open a PR against the fork's `master` (reactodia-workspace-fork).
89
+ 4. Merge the PR.
90
+ 5. In the parent (graphwise-reactodia/):
91
+ 1. `git submodule update --remote` to fetch the fork's new commit and update the pointer,
92
+ 2. Make a branch, commit the pointer bump and push.
93
+
94
+ The parent commit's diff is just the pointer, never the fork's direct file changes.
95
+ Always bump the pointer to a commit that is merged and pushed on the fork's `master`, so
96
+ anyone running `git submodule update` can fetch it.
97
+
98
+ ## Test
99
+
100
+ Cypress runs against the dev server (`http://localhost:3333`), so start the app first in a separate terminal:
101
+
102
+ ```bash
103
+ npm start
104
+ ```
105
+
106
+ Then, in another terminal:
107
+ ```bash
108
+ npm run cy:open # for interactive browser tests
109
+ npm run cy:run # for headless tests
110
+ ```
111
+
112
+ OR run tests in a container
113
+
114
+ ```bash
115
+ docker compose up
116
+ ```