-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display in Juno #902
Merged
Merged
Display in Juno #902
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ KernelDensity | |
Loess | ||
Showoff 0.0.3 | ||
StatsBase | ||
Juno |
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 |
---|---|---|
|
@@ -134,7 +134,7 @@ Creates layers based on elements | |
|
||
### Args | ||
* data_source: The data source as a dataframe | ||
* elements: The elements | ||
* elements: The elements | ||
* mapping: mapping | ||
|
||
### Returns | ||
|
@@ -1105,6 +1105,22 @@ function display(d::REPLDisplay, ::MIME"application/pdf", p::Plot) | |
open_file(filename) | ||
end | ||
|
||
# Display in Juno | ||
|
||
import Juno: Juno, @render, media, Media, Hiccup | ||
|
||
media(Plot, Media.Plot) | ||
|
||
@render Juno.PlotPane p::Plot begin | ||
x, y = Juno.plotsize() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like much of the rest of gadfly uses 4 space indent |
||
set_default_plot_size(x*Gadfly.px, y*Gadfly.px) | ||
Hiccup.div(Dict(:style=>"background: white"), | ||
HTML(stringmime("text/html", p))) | ||
end | ||
|
||
@render Juno.Editor p::Gadfly.Plot begin | ||
Juno.icon("graph") | ||
end | ||
|
||
include("scale.jl") | ||
include("coord.jl") | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are Media and Hiccup going to be dependencies of every version of Juno that will ever be released? if not, better to depend on then explicitly instead of importing them indirectly like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indirect dependency on Media adds a dependency on Requires which is one of the known-to-be-unreliable conditional dependency workarounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the idea is that the Media and Hiccup submodules form part of Juno.jl's public API. If that changes it can be handled in the standard way.
The whole point of this PR is to enable Requires.jl to be removed from Media.jl, and from the rest of Atom.jl's dependency tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that would be great
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @pfitzseb, something like in the Juno stack may have been the cause of the v0.5 upgrade precompilation error seen last night. Not this specifically, but if you used the same conditional dependency workaround somewhere else, it would lead to t and be fixed by the fix in the fix found in the issue:
JunoLab/uber-juno#15