Skip to content

Commit

Permalink
Fixed the settings logic so chemiscope.save behaves well also without…
Browse files Browse the repository at this point in the history
… displaying first
  • Loading branch information
ceriottm committed Aug 28, 2023
1 parent 2da1c1a commit 6059ae2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion python/chemiscope/jupyter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ class ChemiscopeWidgetBase(ipywidgets.DOMWidget, ipywidgets.ValueWidget):

def __init__(self, data, has_metadata):
super().__init__()

self.value = json.dumps(data)
self.has_metadata = has_metadata
self.settings = {}
self.settings = data["settings"]
self._settings_sync = True

def save(self, path):
Expand Down
2 changes: 1 addition & 1 deletion python/jupyter/src/widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ html {

/* hide the slider when showing the map only (no need for navigation)
uses part() to access styling within the shadow DOM */
.chemiscope-meta-and-map .chemiscope-info *::part(chsp-slider) {
.chemiscope-meta-and-map .chemiscope-info *::part(chsp-slider) {
display: none;
}
1 change: 0 additions & 1 deletion python/jupyter/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class ChemiscopeBaseView extends DOMWidgetView {
},
this
);
this._updatePythonSettings();
}

protected _updatePythonSettings(): void {
Expand Down

0 comments on commit 6059ae2

Please sign in to comment.