Skip to content

Commit

Permalink
Precomputed slider server support (#1703)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul <paul@plutojl.org>
Co-authored-by: Paul <paul.berg@etu.utc.fr>
  • Loading branch information
3 people authored Dec 6, 2021
1 parent 2b9a5ad commit b407a7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions frontend/common/SliderServerClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const slider_server_actions = ({ setStatePromise, launch_params, actions,
notebookfile_hash.then((x) => console.log("Notebook file hash:", x))

const bond_connections = notebookfile_hash
.then((hash) => fetch(trailingslash(launch_params.slider_server_url) + "bondconnections/" + encodeURIComponent(hash) + "/"))
.then((hash) => fetch(trailingslash(launch_params.slider_server_url) + "bondconnections/" + encodeURIComponent(hash)))
.then((r) => r.arrayBuffer())
.then((b) => unpack(new Uint8Array(b)))

Expand All @@ -35,7 +35,12 @@ export const slider_server_actions = ({ setStatePromise, launch_params, actions,
console.debug("Requesting bonds", bonds_to_set.current, to_send)
bonds_to_set.current = new Set()

const mybonds_filtered = Object.fromEntries(Object.entries(mybonds).filter(([k, v]) => to_send.has(k)))
const mybonds_filtered = Object.fromEntries(
_.sortBy(
Object.entries(mybonds).filter(([k, v]) => to_send.has(k)),
([k, v]) => k
)
)

const packed = pack(mybonds_filtered)

Expand Down
2 changes: 1 addition & 1 deletion src/notebook/Notebook.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,4 +356,4 @@ function sample_notebook(name::String)
nb = load_notebook_nobackup(file)
nb.path = tempname() * ".jl"
nb
end
end

0 comments on commit b407a7c

Please sign in to comment.