From 127b024b558a9b3e5ec0921e9fb8f52916a4c66f Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Thu, 7 Jun 2018 13:41:42 -0700 Subject: [PATCH] Add VegaLite.jl integration --- NEWS.md | 3 +++ REQUIRE | 1 + src/DataVoyager.jl | 16 +++++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) 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