diff --git a/NEWS.md b/NEWS.md index 908586c..3b5b6e6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# DataVoyager.jl v0.2.0 Release Notes +* Add VegaLite.jl integration + # DataVoyager.jl v0.1.1 Release Notes * Use newer voyager version diff --git a/REQUIRE b/REQUIRE index e9d284c..79102b4 100644 --- a/REQUIRE +++ b/REQUIRE @@ -6,3 +6,4 @@ IterableTables 0.6.1 DataValues 0.3.0 JSON 0.9.1 URIParser +VegaLite 0.3.0 diff --git a/src/DataVoyager.jl b/src/DataVoyager.jl index 7a593ff..4b78648 100644 --- a/src/DataVoyager.jl +++ b/src/DataVoyager.jl @@ -3,7 +3,7 @@ module DataVoyager using Electron, DataValues -import IteratorInterfaceExtensions, TableTraits, IterableTables, JSON +import IteratorInterfaceExtensions, TableTraits, IterableTables, JSON, VegaLite export Voyager @@ -42,22 +42,24 @@ function (v::Voyager)(source) run(v.w, code) - return nothing + return v end -# function Base.getindex(v::Voyager) -# code = "voyagerInstance.getSpec(true)" +function Base.getindex(v::Voyager) + code = "voyagerInstance.getSpec(true)" -# content = run(v.w, code) + content = run(v.w, code) -# return VegaLite.VLSpec{:plot}(content) -# end + return VegaLite.VLSpec{:plot}(content) +end # function Base.getindex(v::Voyager, index::Int) # code = "voyagerInstance.getBookmarkedSpecs()" # content = run(v.w, code) +# info(content) + # return VegaLite.VLSpec{:plot}(JSON.parse(content[index])) # end