Warning, /firebird/docs/deep-links.md is written in an unsupported language. File is not indexed.
0001 # Deep Links and URL Parameters
0002
0003 Firebird reads URL query parameters at startup, so a single link can open data,
0004 select an event, change settings, and position the camera. Use deep links to
0005 share a specific view with a colleague, embed a preconfigured display in a web
0006 page, or drive batch screenshots.
0007
0008 All parameters attach to the display route, and equally to the quad
0009 projection view (`/split-window` — Top/Side/Front cross-sections plus the 3D
0010 view, each with its own geometry cut):
0011
0012 ```
0013 https://seeeic.org/display?dex=<url>&event=2
0014 http://localhost:5454/display?dex=mydata.firebird.zip&event=0
0015 https://seeeic.org/split-window?dex=<url>&event=2&config.quadView.front.clipPos=1500
0016 ```
0017
0018 Quad-view settings (usable as `config.<key>=` overrides): cut positions
0019 `quadView.top.clipPos`, `quadView.side.clipPos`, `quadView.front.clipPos`
0020 (millimeters), and tracks-over-geometry toggles `quadView.top.tracksOnTop`,
0021 `quadView.side.tracksOnTop`, `quadView.front.tracksOnTop`,
0022 `quadView.main.tracksOnTop`.
0023
0024 ## Parameter cheat sheet
0025
0026 | Parameter | Example | Action |
0027 |------------------|--------------------------------------------|------------------------------------------------------------------------|
0028 | `dex=<url>` | `dex=https://host/events.firebird.zip` | Load event data. Accepts DEX `.firebird.json` / `.zip`, or `.root` files (converted server-side when a pyrobird backend is available). |
0029 | `geometry=<url>` | `geometry=epic://tgeo/epic_craterlake.root` | Load detector geometry instead of the configured default. |
0030 | `event=<N>` | `event=2` | Select event number `N` (0-based) after the data loads. |
0031 | `config.<key>=<value>` | `config.geometry.themeName=cad` | Override a setting for this browser session only (see below). |
0032 | `cmd=<list>` | `cmd=camera-preset:farforward` | Run commands, `type:arg` items separated by `;` (see [Command Bus](/command-bus)). |
0033
0034 Notes:
0035
0036 - What a link loads stays on screen when you go to **Configure** and back to
0037 the display: the configured default geometry or events load again only after
0038 you change that setting or apply a choice in the data selector.
0039 - File URLs can be absolute (`https://...`, `epic://...`) or relative. Relative
0040 paths resolve through the pyrobird server's download endpoint, so
0041 `dex=subdir/events.firebird.zip` opens a file under the server's
0042 `--work-path`. `local://subdir/events.firebird.zip` is the same thing
0043 spelled explicitly.
0044 - Percent-encode every value that is not a plain word or a plain URL; see
0045 [Percent-encode values](#percent-encode-values).
0046
0047 ## Percent-encode values
0048
0049 The browser decodes the query string before Firebird reads it, so characters
0050 with a meaning in a query string must be percent-encoded inside a value:
0051
0052 | Character | Encoded | What happens without encoding |
0053 |---|---|---|
0054 | `&` | `%26` | Ends the value; the rest becomes another parameter. |
0055 | `+` | `%2B` | Turns into a space. |
0056 | `#` | `%23` | Ends the query; everything after it is dropped. |
0057 | `%` | `%25` | Starts an escape sequence. |
0058 | `=` | `%3D` | Usually survives, but encode it for safety. |
0059 | space | `%20` | Not a valid URL character. |
0060
0061 `:` and `/` may stay as they are, so a plain `https://host/file.zip` value
0062 needs no encoding.
0063
0064 Signed and tokened download URLs always need encoding. A presigned S3 URL
0065 carries its own query string:
0066
0067 ```
0068 https://bucket.s3.amazonaws.com/run1.firebird.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA%2F20261005%2Fus-east-1&X-Amz-Signature=3f2a
0069 ```
0070
0071 Pasted into `dex=` as is, the first `&` ends the value and Firebird requests
0072 `run1.firebird.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256` without a signature.
0073 Encode the whole URL instead:
0074
0075 ```
0076 /display?dex=https%3A%2F%2Fbucket.s3.amazonaws.com%2Frun1.firebird.zip%3FX-Amz-Algorithm%3DAWS4-HMAC-SHA256%26X-Amz-Credential%3DAKIA%252F20261005%252Fus-east-1%26X-Amz-Signature%3D3f2a&event=2
0077 ```
0078
0079 Encode values with your language's URL encoder, not by hand:
0080
0081 ```js
0082 const link = `/display?dex=${encodeURIComponent(presignedUrl)}&event=2`;
0083 ```
0084
0085 ```python
0086 from urllib.parse import quote
0087 link = f"/display?dex={quote(presigned_url, safe='')}&event=2"
0088 ```
0089
0090 In code that builds links for Firebird, `buildDeepLink()` (exported by
0091 `@dexvis/firebird-ng`) encodes every value and checks the `cmd=` grammar:
0092
0093 ```ts
0094 import { buildDeepLink } from '@dexvis/firebird-ng';
0095
0096 const link = buildDeepLink('https://seeeic.org/display', {
0097 params: { dex: presignedUrl, event: 2 },
0098 config: { 'geometry.themeName': 'cad' },
0099 commands: ['camera-preset:farforward'],
0100 });
0101 ```
0102
0103 One limit cannot be encoded away: `cmd=` items are split on `;` after the
0104 browser decoded the query, so a command argument cannot contain `;`, not
0105 even as `%3B`. Pass such a value through `dex=` or `geometry=`, which take
0106 the whole value. `buildDeepLink()` rejects a `;` inside a command argument.
0107
0108 ## Session-scoped settings: `config.<key>=`
0109
0110 Any setting registered in Firebird can be set from the URL by prefixing its key
0111 with `config.`. URL values win over the server configuration and over values
0112 saved in the browser — but only for the current session. They are never written
0113 to browser storage, so opening someone's link does not change your saved
0114 preferences. Changing the same setting in the UI afterward takes effect
0115 immediately and is saved as usual.
0116
0117 The full priority order, lowest to highest:
0118
0119 ```
0120 code defaults < server config.jsonc < saved browser settings < URL config.* < changes made in the running app
0121 ```
0122
0123 Examples of useful keys:
0124
0125 ```
0126 config.geometry.themeName=cad # geometry theme: grey or off; the ePIC pack adds cool2, cool2no, cad
0127 config.geometry.FastDefaultMaterial=true # fast opaque materials (faster on weak GPUs)
0128 config.events.rootEventRange=0-5 # which entries to convert from .root event files
0129 config.events.rootCollections=tracker_hits,mc_particles # which collection groups to convert (empty = all)
0130 config.events.trajectoryExcludedCollections=DRICHHits # EDM4hep hit collections kept out of MC-truth trajectories (empty = none)
0131 config.painters.byPiece.MCParticles.visible=true # show the MC particle lines (hidden by default)
0132 config.catalog.url=https://host/catalog.json # add a remote data catalog to the data selector
0133 ```
0134
0135 ## Commands: `cmd=`
0136
0137 For actions that are not settings — moving the camera, opening several things
0138 in order — use commands. The grammar is `type:argument`, joined by `;`:
0139
0140 ```
0141 /display?dex=events.firebird.zip&cmd=show-event:3;camera-preset:farforward
0142 ```
0143
0144 The shorthands `dex=`, `geometry=` and `event=` are convenience forms of the
0145 `open-dex`, `open-geometry` and `show-event` commands: `dex=X` does what
0146 `cmd=open-dex:X` does. They run before the `cmd=` list, in the order
0147 `geometry`, `dex`, `event`. The command reference and how commands execute
0148 is described in [Command Bus](/command-bus).
0149
0150 ## Worked examples
0151
0152 Open a shared file and jump to event 2:
0153
0154 ```
0155 https://seeeic.org/display?dex=https://seeeic.org/d/py8dis-nc_10x100_minq2-1000_minp-250mev_nevt-5_s.firebird.zip&event=2
0156 ```
0157
0158 Open the bundled example data with a different geometry and a far-forward
0159 camera:
0160
0161 ```
0162 /display?dex=asset://data/example-cherenkov.firebird.json&geometry=epic://tgeo/epic_ip6.root&cmd=camera-preset:farforward
0163 ```
0164
0165 Recolor the example extension's rings for this session:
0166
0167 ```
0168 /display?dex=asset://data/example-cherenkov.firebird.json&event=2&config.painters.byPiece.ExampleRings.ringColor=%23ff4d00
0169 ```
0170
0171 ## Deep links in batch mode
0172
0173 `pyrobird screenshot --url "<deep link>"` captures any of the URLs above
0174 headlessly. The capture waits until the display reports that geometry and
0175 events finished loading and all commands ran. See
0176 [Batch Screenshots](/pyrobird#batch-screenshots).