Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a5f2aff
feat: reimplement bidirectional selection sync
ceriottm Jan 7, 2026
c0a4bfa
Remove stray flag
ceriottm Jan 7, 2026
b090d81
feat: reimplement bidirectional selection sync and active viewer sync
ceriottm Jan 7, 2026
ad49dcb
fix: ensure selection is synced after settings application
ceriottm Jan 7, 2026
d7ef855
fix: solve settings conflict and ensure selection update on settings …
ceriottm Jan 7, 2026
03ac5fb
fix: allow concurrent structure requests
ceriottm Jan 7, 2026
3623ecc
fix: add active_viewer listener and fix structure skipping
ceriottm Jan 7, 2026
242fd0c
fix: relax structure request concurrency check to support grid
ceriottm Jan 7, 2026
f43f6bd
fix: explicitly sync map activation when active viewer changes
ceriottm Jan 7, 2026
5c17c2f
fix: robustness against setting conflicts and race conditions
ceriottm Jan 8, 2026
c04317b
fix: add missing closing brace in DefaultVisualizer.applySettings
ceriottm Jan 8, 2026
7ce8c9c
Lint
ceriottm Jan 8, 2026
605aa6f
fix: propagate settings application errors to UI warnings
ceriottm Jan 8, 2026
ecb7df9
fix: improve error message for viewer settings count mismatch
ceriottm Jan 8, 2026
1a95c88
style: refactor initialization logic into _initializeVisualizer
ceriottm Jan 8, 2026
57f13ee
fix: sync active viewer when removing viewers
ceriottm Jan 8, 2026
9101878
fix: hook into removeViewer to correctly sync active viewer index
ceriottm Jan 8, 2026
3b633a3
Corrected small bug when removing viewers
ceriottm Jan 8, 2026
7dfb3b5
fix: preserve atom selection when changing structure in UI
ceriottm Jan 8, 2026
4ad16b3
fix: support partial selection updates and preserve atom selection
ceriottm Jan 8, 2026
3ec9d52
Lint
ceriottm Jan 8, 2026
c837ce2
Also preserve atom index during fast forward
ceriottm Jan 8, 2026
b73a5c7
fix: prevent TypeError when switching target and preserve atom index …
ceriottm Jan 8, 2026
d725c98
fix: validate structure index in selection and warn on invalid requests
ceriottm Jan 8, 2026
99505c3
fix: show invalid selection warning in UI
ceriottm Jan 8, 2026
6ca9254
fix: prevent crash when setting invalid structure index by checking a…
ceriottm Jan 8, 2026
9575774
Lint
ceriottm Jan 8, 2026
3796b11
fix: prevent loading viewer with invalid structure index in _refreshCell
ceriottm Jan 8, 2026
2b9ae69
Lower a bit the limit for dropping frames
ceriottm Jan 9, 2026
71a9080
fix: smart rate limiting for structure requests based on playback status
ceriottm Jan 9, 2026
5edc03c
Lint
ceriottm Jan 9, 2026
57da463
style: refactor initialization logic into _initializeVisualizer
ceriottm Jan 9, 2026
372c04f
fix: prevent duplicate requests by locking model updates in _updatePy…
ceriottm Jan 9, 2026
a22a961
fix: ensure playback delay updates persist after settings refresh by …
ceriottm Jan 9, 2026
1669152
style: remove debug console logs
ceriottm Jan 9, 2026
5f3bc7f
fix: persist setting observers across option refreshes to ensure play…
ceriottm Jan 9, 2026
52c0f00
fix: stop playback when switching targets or removing visualizer to p…
ceriottm Jan 9, 2026
3b7432a
Added a brief documentation of the traitlets
ceriottm Jan 9, 2026
c62595b
Link to traitlets docs
ceriottm Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/chemiscope/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class ChemiscopeWidgetBase(ipywidgets.DOMWidget, ipywidgets.ValueWidget):
settings = Dict().tag(sync=True)
# timeout for warning messages
warning_timeout = Int(10000).tag(sync=True)
# currently selected environment/structure/atom
selected_ids = Dict().tag(sync=True)
# index of the currently active viewer in the grid
active_viewer = Int(0).tag(sync=True)

def __init__(
self, data, has_metadata, warning_timeout=10000, cache_structures=True
Expand Down
2 changes: 1 addition & 1 deletion python/chemiscope/sphinx/static/chemiscope-sphinx.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
.visualizer-map-mode {
display: block;
}
}
}
7 changes: 4 additions & 3 deletions python/chemiscope/sphinx/static/chemiscope-sphinx.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ async function loadChemiscopeSphinx(
structure: `${divId}-structure`,
};

const has_external_structures = dataset.structures && dataset.structures.length > 0 && dataset.structures[0].data;
const has_external_structures =
dataset.structures && dataset.structures.length > 0 && dataset.structures[0].data;
if (visualizerMode !== VISUALISER_MODE.MAP && has_external_structures) {
// base href for external structures
const baseHref = filePath + "-ext/";
const baseHref = filePath + '-ext/';

config.loadStructure = async (_, structure) => {
const url = baseHref + String(structure.data).replace(/^\/+/, "");
const url = baseHref + String(structure.data).replace(/^\/+/, '');

return await fetchDataset(url);
};
Expand Down
Loading