# Lock dock

One original LAS across Log Viewer, Crossplot, Histogram and Python in this browser.

Danila Karnaukh | v22 | 2026-10-08

## Everyday use

1. Open any of the four tools and load your LAS, or try its sample.
2. Turn **Lock dock → On**. The status shows the shared filename.
3. Use the tool links or open the other tools in tabs. They load the same original curves, units, nulls and row order automatically.
4. Choosing or dropping another valid LAS in any locked tool makes it the shared source. Sample buttons, worked-example links and `Petrophysics.import_las(...)` also participate.
5. **Remove file** clears the shared source and every locked tool; Lock dock remains on, ready for another file.
6. Turn **Lock dock → Off** in any tool to stop sharing everywhere. The shared LAS is removed from browser storage. Already open pages keep their current datasets and can then load different files independently.

Lock dock starts **off** in a fresh browser profile. Turning it on publishes the LAS in the tool where you enabled it. If that tool is empty and there is no shared LAS, the other locked tools become empty too; load a file to begin. Re-enabling an already active lock from an empty tool adopts the existing shared file.

## What synchronizes

- The **original loaded LAS** and its filename. Its data is kept locally in the browser while locked, so it can be restored after navigation, reload or a later visit.
- The global on/off setting and removal of the shared source.
- Open tabs are notified after a file is successfully stored. If files are loaded concurrently, the last committed successful share becomes the active source. Background tabs also reconcile when resumed or focused.

## What remains specific to a tool

Scripts, Python variables/kernels, calculated curves, plot tracks, axes, filters, selections, regressions and view settings belong to the page using them. Sharing a source is not a shared live Python session or a saved multi-tool project.

A different shared source follows normal new-file behavior: plot settings reset, old result curves are removed and any Python run against the previous LAS is stopped. Editor text is kept. Scripts never execute automatically. An unchanged filename and source text received again does not reset the current page's calculations or view. Manually reopening a file still follows that tool's normal import behavior.

Use **Save project** and **Save .py** before leaving a page if you need its work later. Lock dock restores the original LAS, not these settings/results. To share a calculated curve, use **Export LAS**, then load that downloaded LAS while locked; its result columns become ordinary source curves in all four tools. Exporting alone does not change the shared file.

## Browser scope, privacy and limits

- Sharing is limited to the **same browser profile and website origin**: scheme, hostname and port. `petrophysics.io`, `www.petrophysics.io`, an `onrender.com` address and localhost each have separate storage. Different devices/browsers do not synchronize.
- LAS text is stored in **IndexedDB on the device**, not uploaded by Lock dock. Notifications carry no well data; a local-storage fallback stores only a change marker. It is not an encrypted vault or a backup. Use a trusted browser profile, and turn Lock dock off after using a shared computer.
- Turning off or removing the shared file deletes the stored active LAS. Turning off keeps the off preference. Clearing this site's browser data also removes it. Browser eviction and private-session cleanup can remove stored state. Scripts/results still require explicit project saves.
- Existing import limits apply: **25 MiB of decoded UTF-8 LAS text**, **250,000 rows** and **5 million values**. Browser storage quota is an additional limit. Use HTTPS after deployment or an HTTP server on localhost for local testing; double-clicked `file://` pages are unsupported.
- A storage error shows **Not synchronized** or a storage explanation and **Retry sync**. The locally opened file remains available; other tools retain the last successfully shared file. Retry after resolving the issue or turn Lock dock off. Do not assume an error-state tool is using the new well.
- A tool may reject a source it cannot display, such as a LAS without a usable depth range in Log Viewer. Its previous dataset remains open with an explicit error. Load a compatible LAS or switch Lock dock off to work independently.

## JavaScript API

Available in all four tools:

```javascript
await Petrophysics.set_dock_lock({enabled: true});
await Petrophysics.import_las({text: lasText, filename: "well.las"});
const dock = Petrophysics.get_dock_lock();
console.log(dock.enabled, dock.filename, dock.synchronized, dock.error);
await Petrophysics.set_dock_lock({enabled: false});
```

`get_dock_lock()` returns `enabled`, `ready`, `pending`, `revision`, `filename`, `synchronized` and `error`. It never exposes the stored LAS text. Sharing after a local import and receiving updates in other tabs are asynchronous. Check `ready && !pending && synchronized && !error` and inspect the dataset before using it; there is no acknowledgement that every other tab has finished updating. `set_dock_lock` resolves after the local toggle/storage operation, or rejects on failure. It is safe to use all other tool features with the lock off.


See the [Python reference](../python/index.html) for code, results and project saves.


## LAS datasets in v22

All four tools share the reader for LAS versions through 3.0. Use the LAS dataset selector for files with several tables. Project saves include the selected dataset ID; old projects without it refer to the file's preferred default table. Lock dock shares the selected dataset and source file, while tool settings/calculated curves remain local. Numeric plots need numeric columns; Log Viewer needs a depth channel. Text/date/array metadata and all tables are available in Python through `well.datasets` and `well.dataset(id)`. Download original LAS keeps all decoded source text. Legacy numeric export remains LAS 2.0; LAS 3.0 export retains extra tables and typed fields. [LAS formats, syntax and limits](../las-formats/index.html).
