-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
started IJulia integration, corrected Escher replotting issue
- Loading branch information
1 parent
ba627dd
commit b42de82
Showing
7 changed files
with
213 additions
and
45 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
julia 0.4 | ||
Compat | ||
JSON |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
module VegaLite | ||
|
||
using JSON | ||
using JSON, Compat | ||
|
||
import Base: +, *, scale, show | ||
|
||
|
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 |
---|---|---|
@@ -1,12 +1,33 @@ | ||
import Escher: Elem, Tile, render | ||
import Base: convert | ||
|
||
ESCHER_SVG = true | ||
ESCHER_BUTTONS = true | ||
|
||
export svg, buttons | ||
|
||
svg() = ESCHER_SVG | ||
svg(b::Bool) = (global ESCHER_SVG ; ESCHER_SVG = b) | ||
buttons() = ESCHER_BUTTONS | ||
buttons(b::Bool) = (global ESCHER_BUTTONS ; ESCHER_BUTTONS = b) | ||
|
||
|
||
type VegaLiteTile <: Tile | ||
json::AbstractString | ||
json::AbstractString | ||
svg::Bool | ||
actions::Bool | ||
end | ||
|
||
function VegaLiteTile(vis::AbstractString) | ||
VegaLiteTile(vis, ESCHER_SVG, ESCHER_BUTTONS) | ||
end | ||
|
||
# convert(::Type{Tile}, v::VegaLiteVis) = VegaLiteTile(JSON.json(tojs(v))) | ||
convert(::Type{Tile}, v::VegaLiteVis) = VegaLiteTile(JSON.json(v.vis)) | ||
|
||
render(plot::VegaLiteTile, state) = | ||
Elem(:"vega-lite-plot", attributes = Dict(:json=>plot.json)) | ||
function render(plot::VegaLiteTile, state) | ||
attr = Dict(:json=>plot.json) | ||
plot.svg && ( attr[:svg] = "" ) | ||
plot.actions && ( attr[:actions] = "" ) | ||
|
||
Elem(:"vega-lite-plot", attributes = attr) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
julia 0.4 | ||
JSON | ||
RDatasets | ||
Compat |