-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't define/require under nbextension prefix (#382)
- Loading branch information
Showing
13 changed files
with
1,792 additions
and
334 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,20 @@ | ||
// This file contains the javascript that is run when the notebook is loaded. | ||
// It contains some requirejs configuration and the `load_ipython_extension` | ||
// which is required for any notebook extension. | ||
// | ||
// Some static assets may be required by the custom widget javascript. The base | ||
// url for the notebook is not known at build time and is therefore computed | ||
// dynamically. | ||
__webpack_public_path__ = document.querySelector('body').getAttribute('data-base-url') + 'nbextensions/jupyter-vega'; | ||
|
||
|
||
// Configure requirejs | ||
if (window.require) { | ||
window.require.config({ | ||
map: { | ||
"*": { | ||
"jupyter-vega": "nbextensions/jupyter-vega/index", | ||
} | ||
} | ||
}); | ||
} |
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 |
---|---|---|
|
@@ -91,3 +91,5 @@ export function render( | |
}) | ||
.catch((error) => showError(el, error)); | ||
} | ||
|
||
export * from "./widget"; |
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,32 @@ | ||
const spec = {spec}; | ||
const opt = {opt}; | ||
const type = "{type}"; | ||
const id = "{id}"; | ||
|
||
const output_area = this; | ||
|
||
require(["jupyter-vega"], function(vega) {{ | ||
const target = document.createElement("div"); | ||
target.id = id; | ||
target.className = "vega-embed"; | ||
|
||
const style = document.createElement("style"); | ||
style.textContent = [ | ||
".vega-embed .error p {{", | ||
" color: firebrick;", | ||
" font-size: 14px;", | ||
"}}", | ||
].join("\\n"); | ||
|
||
// element is a jQuery wrapped DOM element inside the output area | ||
// see http://ipython.readthedocs.io/en/stable/api/generated/\ | ||
// IPython.display.html#IPython.display.Javascript.__init__ | ||
element[0].appendChild(target); | ||
element[0].appendChild(style); | ||
|
||
vega.render("#" + id, spec, type, opt, output_area); | ||
}}, function (err) {{ | ||
if (err.requireType !== "scripterror") {{ | ||
throw(err); | ||
}} | ||
}}); |
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,20 @@ | ||
// This file contains the javascript that is run when the notebook is loaded. | ||
// It contains some requirejs configuration and the `load_ipython_extension` | ||
// which is required for any notebook extension. | ||
// | ||
// Some static assets may be required by the custom widget javascript. The base | ||
// url for the notebook is not known at build time and is therefore computed | ||
// dynamically. | ||
__webpack_public_path__ = document.querySelector('body').getAttribute('data-base-url') + 'nbextensions/jupyter-vega'; | ||
|
||
|
||
// Configure requirejs | ||
if (window.require) { | ||
window.require.config({ | ||
map: { | ||
"*": { | ||
"jupyter-vega": "nbextensions/jupyter-vega/index", | ||
} | ||
} | ||
}); | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.