Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pydeck and @deck.gl/jupyter-widget: Add render test for custom layer …
…loading (#4267)
- Loading branch information
1 parent
89090a5
commit 4c98bd0
Showing
7 changed files
with
86 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* global document */ | ||
|
||
function alreadyLoaded(url) { | ||
// Save time by not reloading the same URL | ||
for (const scriptTag of document.querySelectorAll('script')) { | ||
if (scriptTag.src === url) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
function loadScript(url) { | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = url; | ||
const head = document.querySelector('head'); | ||
head.appendChild(script); | ||
return new Promise(resolve => { | ||
script.onload = resolve; | ||
}); | ||
} | ||
|
||
export {loadScript, alreadyLoaded}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters