This repository has been archived by the owner on Sep 4, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93509d8
commit 6d2f0a6
Showing
12 changed files
with
429 additions
and
85 deletions.
There are no files selected for viewing
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
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
function openhtmldoc(filepath::String) | ||
os = Sys.OS_NAME | ||
open = os == :Linux ? "xdg-open" : | ||
os == :Darwin ? "open" : | ||
warn("Not Implemented: No idea how to open a browser in Windows, perhaps you could work it out and submit a pull request?") | ||
open == nothing && return | ||
run(`$open $filepath`) | ||
end | ||
|
||
_basic(p::Plot) = "Plot(\"$(p.title)\" with $(length(p.datacolumns)) datacolumns)" | ||
|
||
function Base.writemime(io::IO, ::MIME"text/html", p::Plot) | ||
print(io, renderplot(p, true)) | ||
print(io, "<p>", _basic(p), "</p>") | ||
end | ||
|
||
function Base.writemime(io::IO, ::MIME"text/plain", p::Plot) | ||
print(io, _basic(p)) | ||
end | ||
|
||
if !isdefined(Main, :IJulia) | ||
type BokehDisplay <: Display | ||
end | ||
|
||
function Base.display(d::BokehDisplay, p::Plot) | ||
display("text/plain", p) | ||
html = renderplot(p, false) | ||
if ispath(p.filename) | ||
println() | ||
warn("$(p.filename) already exists, overwriting") | ||
end | ||
open(p.filename, "w") do f | ||
print(f, html) | ||
end | ||
openhtmldoc(p.filename) | ||
end | ||
pushdisplay(BokehDisplay()) | ||
end | ||
|
||
function setupnotebook() | ||
jspath, csspath = _bokehjs_paths(!DEBUG) | ||
jscss = _render_jscss(jspath, csspath, true) | ||
display("text/html", jscss) | ||
display("text/html", "<p>BokehJS successfully loaded.</p>") | ||
end |
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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<div class="plotdiv" id="{{ div_id }}"></div> |
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,2 @@ | ||
{{{ main }}} | ||
{{{ body }}} |
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,14 @@ | ||
<script type="text/javascript"> | ||
$(function() { | ||
var modelid = "{{ model_id }}"; | ||
var modeltype = "PlotContext"; | ||
var elementid = "{{ div_id }}"; | ||
console.log(" modeltype:", modeltype); | ||
console.log(" modelid:", modelid); | ||
console.log(" elementid:", elementid); | ||
var all_models = {{{ all_models }}}; | ||
Bokeh.load_models(all_models); | ||
var model = Bokeh.Collections(modeltype).get(modelid); | ||
var view = new model.default_view({model: model, el: "#{{ div_id }}"}); | ||
}); | ||
</script> |
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,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
{{{ jscss }}} | ||
{{{ main }}} | ||
</head> | ||
<body> | ||
{{{ body }}} | ||
</body> | ||
</html> |