Skip to content

128 add page with graph view - #133

Open
odungern wants to merge 22 commits into
devfrom
128-add-page-with-graph-view
Open

odungern wants to merge 22 commits into
devfrom
128-add-page-with-graph-view

Conversation

@odungern

Copy link
Copy Markdown
Contributor
  • new page with graph in normal or extended mode - with radius=1 or 2.
  • new page with credits (contributors and software used)

odungern and others added 18 commits November 6, 2026 17:41
…vironment.

- now the real browser version of SAxon-JS is used in the browser with a special loading, as no npm-package was available for it
- add 2 test-suites for PlayWright with testing in a setip with a real browser.
- .. and jest 29.7
- ... and import-xml.ts to accept multiple aProperty values
Merge pull request #127 from GfSE/125-Display-CASCaRA-Types-(Ontology)
- improved Turtle export to include property restrictions plus some refinements
getMermaid(item, radius, options) returns the local graph in the
neighbourhood of an item as graph definition in Mermaid text syntax
(flowchart); getMermaidGraph() returns the nodes and edges shown along
with it, as needed for a popup and for navigation. The module composes
text only and does not depend on Mermaid, so it is tested without a
browser. The items to search for neighbours are supplied in
options.items, as the metaclasses reference other items by id.

- Entity and anEntity as round node, Relationship and aRelationship as
  hexagonal node; types in light orange, instances in light yellow
- Link and aLink as arrow with solid line from the element owning the
  link to its endpoint, instanceOf with dashed and specializes with
  dotted line; nodes and edges are labelled with their title
- Enumeration, Link and Property are no nodes; a link to an enumerated
  value is listed with the properties of the element
- a relationship is always shown with the elements it relates
- a referenced item which is not available is shown in a style of its
  own and its neighbourhood is not explored
- the number of nodes is limited (60 by default): the nodes next to the
  selected item take precedence, the omitted ones are counted
- imported text cannot alter the definition: characters with a meaning
  for Mermaid are replaced by entity codes, node ids are generated
The new page 'Graph' (/graph) shows the local graph in the neighbourhood
of the item selected in the outline, rendered with Mermaid:

- outline pane at the left (NavOutline): per package the document
  outline, followed by the types in a folder per metaclass
- graph pane at the right for radius 1 or 2 (user's choice), fitted to
  the pane or in original size
- a popup with title, class, description and properties while hovering
  a node or moving the keyboard focus to it
- a click on a node or the Enter key makes it the selected item; the
  outline follows, if it lists the item

Mermaid is loaded on demand and configured in one place
(src/lib/mermaid-render.ts): security level 'strict', classic look (the
look 'neo' does not show the dash patterns reliably), HTML labels
(entity codes are only resolved there) and the layout engine ELK. The
labels are measured next to the graph, as the letter-spacing Vuetify
applies to the text of a card would otherwise cut them off. A failure
is shown as a message instead of breaking the page.

Bundling Mermaid slows down the production build considerably, so the
timeout of the Playwright web server is raised to 10 minutes. The entry
bundle of the app does not grow.

Tests: Jest for loading and failure handling (Mermaid needs a real
browser to render), Playwright for what is finally drawn, the popup,
the navigation, the radius and the limitation of a large graph.
Changes to the graph view as requested after the first review:

- A reified aRelationship is no node by default, but an arrow with a
  double line from its source to its target entity, labelled with its
  title; the Relationship types are left out. The former view is kept
  as the expanded graph: a switch 'Expanded' on the Graph page (off by
  default) and the option 'expanded' of getMermaid().
- Entity and anEntity are rectangles with rounded corners instead of
  circles.
- The radius counts the edges of the graph as it is shown, so that
  every node is a step, a reified relationship in the expanded graph
  included. A relationship at the rim is no more completed by the
  element at its other end, which makes the expanded graph of radius 2
  smaller.
- The direction is reversed and fixed: the types at the left and the
  instances at the right, all arrows point to the left.

In the graph definition, a relationship drawn as arrow is the thick
link of Mermaid ('==>'), as Mermaid has no double line. The page turns
it into a double line after rendering by a gap along its middle
(drawDoubleLinks() in mermaid-render.ts).

A relationship cannot be selected unless the graph is expanded; the
page then tells how to see it. An aRelationship is drawn from each of
its sources to each of its targets and left out, where an end is a
relationship itself.

Tests: Jest for the composition of both kinds of graph and for the
double lines, Playwright for what is finally drawn (shapes, line styles
including the double line, direction of the arrows) and for the switch.
Copilot AI balanced review requested due to automatic review settings November 14, 2026 00:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical findings permit HTML attribute injection, produce incorrect OWL/SHACL constraints, and allow relationship consolidation to overwrite original files or leave dangling references.

22 open issues

And 2 more that still need to be addressed.

What changed in this PR

This PR adds graph exploration and contributor credits to CASCaRA, alongside a Vite migration and updates to import, export, and browser testing.

Changes:

  • Adds interactive Mermaid graphs with normal/expanded modes, radius controls, navigation, and detail popups.
  • Adds a Credits page and clickable ontology cross-references.
  • Migrates the Vue build to Vite, expands browser coverage, and updates XML parsing, ID validation, and Turtle export.
File Description
tests/​browser/​saxon-js-reqif.spec.ts Adds browser-runtime transformation smoke tests.
tests/​browser/​README.md Documents browser coverage and execution.
tests/​browser/​page-graph.spec.ts Tests graph rendering and interaction.
tests/​browser/​item-cache-pinia-store.spec.ts Tests import persistence and reload.
tests/​browser/​import-reqif-xslt.spec.ts Removes native-browser XSLT tests.
test-results/​.last-run.json Updates recorded test status.
src/​vue/​stores/​asset-cache.ts No textual diff supplied.
src/​vue/​shims-vue.d.ts No textual diff supplied.
src/​vue/​plugins/​export/​neo4j-api/​export-neo4j.vue No textual diff supplied.
src/​vue/​main.ts No textual diff supplied.
src/​vue/​App.vue No textual diff supplied.
src/​common/​lib/​operations.ts No textual diff supplied.
scripts/​consolidate-aRelationships.ts Adds relationship consolidation utility.
playwright.config.ts Runs tests against the production preview.
packages/​vue/​vue.config.js Removes Vue CLI configuration.
packages/​vue/​vite.config.mts Adds Vite configuration and CSP headers.
packages/​vue/​tsconfig.json Uses Vite client types.
packages/​vue/​tests/​mermaid-render.spec.ts Tests rendering helpers and failure handling.
packages/​vue/​src/​router/​index.ts Registers Graph and Credits routes.
packages/​vue/​src/​main.ts Uses Vite plugin discovery.
packages/​vue/​src/​lib/​mermaid-render.ts Adds lazy Mermaid loading and SVG helpers.
packages/​vue/​src/​components/​PageOntology.vue Enables titled cross-reference navigation.
packages/​vue/​src/​components/​PageInterfaces.vue Adjusts panel borders.
packages/​vue/​src/​components/​PageGraph.vue Adds interactive graph exploration.
packages/​vue/​src/​components/​PageCredits.vue Lists contributors and software credits.
packages/​vue/​src/​App.vue Adds Graph and Credits navigation.
packages/​vue/​public/​index.html Removes the Vue CLI HTML template.
packages/​vue/​package.json Updates build tooling and dependencies.
packages/​vue/​jest.config.js Configures standalone Jest transforms.
packages/​vue/​index.html Adds Vite entry and Saxon-JS runtime loading.
packages/​vue/​components.d.ts Declares the new page components.
packages/​vue/​babel.config.js Replaces Vue CLI Babel presets.
packages/​vue/​.eslintignore Excludes generated and vendor files.
packages/​common/​tests/​pig-package-getmermaid.spec.ts Tests graph composition and traversal.
packages/​common/​tests/​pig-metaclasses-xml.spec.ts Tests multi-value property imports.
packages/​common/​src/​schema/​pig/​ts/​pig-metaclasses.ts Preserves multiple XML property values.
packages/​common/​src/​schema/​pig/​json/​pig-schemata.ts Uses the shared ID pattern.
packages/​common/​src/​lib/​platform-independence.ts Separates browser and Node Saxon-JS loading.
packages/​common/​src/​lib/​definitions.ts Updates shared URI and ID validation.
packages/​common/​src/​export/​ttl/​getTTL.ts Adds restrictions, inherited constraints, and typed literals.
packages/​common/​src/​export/​mermaid/​getMermaid.ts Composes bounded graph neighborhoods.
packages/​common/​src/​export/​html/​getHTML.ts Renders titled cross-reference links.
packages/​common/​src/​build-info.ts Refreshes application build metadata.
packages/​common/​package.json Updates version and test tooling.
package.json Updates identity and build/test scripts.
.github/​workflows/​README.md Documents CI and runtime maintenance.
.github/​workflows/​node.js.yml Adds browser installation and browser tests.
.github/​copilot-instructions.md Updates contributor and rendering guidance.

Review effort: Balanced

Comment thread scripts/consolidate-aRelationships.ts Resolved
Comment thread scripts/consolidate-aRelationships.ts Resolved
Comment thread tests/browser/README.md Resolved
Comment thread tests/browser/README.md Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants