Skip to content

Commit

Permalink
Use local versions of d3 and vega.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanz committed Oct 13, 2013
1 parent f9ac547 commit 574d000
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
13 changes: 3 additions & 10 deletions vincent/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@

from ._compat import str_types

#TODO: Keep local?
d3_js_url = "http://d3js.org/d3.v3.min.js"
vega_js_url = 'http://trifacta.github.com/vega/vega.js'


def initialize_notebook():
"""Initialize the IPython notebook display elements"""
try:
from IPython.core.display import display, Javascript
except ImportError:
print('IPython Notebook could not be loaded.')

display(Javascript('''$.getScript("%s", function() {
$.getScript("%s", function() {
$([IPython.events]).trigger("vega_loaded.vincent");
})
});''' % (d3_js_url, vega_js_url)))
display(JavaScript(filename="js/d3.min.js"))
display(JavaScript(filename="js/vega.min.js"))
display(JavaScript('$([IPython.events]).trigger("vega_loaded.vincent")'))


def _assert_is_type(name, value, value_type):
Expand Down
Loading

0 comments on commit 574d000

Please sign in to comment.