Skip to content

Wire up ?view=<id> so embedded instances can open on a specific view #68

@paolino

Description

@paolino

Context

`zk-lab` publishes a single Turtle graph with three SKOS concept schemes (Culture, Abstractions, Challenges). Each chapter page in the MkDocs site needs to embed the graph-browser opened on the corresponding chapter.

A chapter filter is already expressible as a SPARQL view in `data/queries.json` (tagged `"view"`) — so no dedicated scheme/filter param is needed. The scheme is the query.

What is missing is a way to select the initial view via URL, so each iframe can open on its own chapter without user clicks inside the browser.

What works today

  • `?repo=owner/repo` deep-links to the data (`src/FFI/Url.js`, `src/Main.purs:100-104`, `src/RepoDiscovery.purs:94-111`).
  • Views are defined in `data/queries.json` with `"view": true` and chosen post-load from the in-app picker (`src/Viewer.purs:291-303`).

What doesn't work

  • `?view=` is dead code. FFI functions `getViewParam` / `setViewParam` exist in `src/FFI/Url.js:17-31` and `src/FFI/Url.purs` but are never referenced by any caller.

Request

  • P1: wire up `?view=` to select the initial view on load, matching entries in `data/queries.json` (or `data/views/index.json`) by id or label. Round-trip it on navigation so sharable links survive selection.
  • P2 (optional): `?embed=1` — hide the repo-manager panel and outer chrome, for iframe use. Not blocking; a plain iframe works today, just with extra chrome.

Use case

```html

<iframe src=\"https://lambdasistemi.github.io/graph-browser/?repo=lambdasistemi/zk-lab&view=culture\"></iframe> \`\`\`

opens the browser on this repo's `culture` SPARQL view.

Not blocking

`zk-lab` can ship its MkDocs site today by embedding the full graph and instructing readers to pick the chapter from the picker. Landing this issue replaces that instruction with a preselected view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions