Skip to content

Commit

Permalink
Merge pull request #10 from queryverse/dataresource
Browse files Browse the repository at this point in the history
Add support for vnd.dataresource+json
  • Loading branch information
davidanthoff authored Sep 17, 2018
2 parents 3d89a92 + a7832aa commit 33bbd80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# VegaDatasets.jl v0.5.0 Release Notes
* Add support for vnd.dataresource+json

# VegaDatasets.jl v0.4.1 Release Notes
* Fix remaining julia 1.0 compat issues

Expand Down
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ julia 0.7
TextParse 0.6.0
JSON 0.19.0
DataValues 0.4.4
TableShowUtils 0.1.1
TableShowUtils 0.2.0
DataStructures 0.11.0
IteratorInterfaceExtensions 0.1.1
TableTraits 0.3.1
Expand Down
8 changes: 8 additions & 0 deletions src/VegaDatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ end

Base.Multimedia.showable(::MIME"text/html", source::VegaDataset) = true

function Base.show(io::IO, ::MIME"application/vnd.dataresource+json", source::VegaDataset)
if source.data!==nothing
TableShowUtils.printdataresource(io, getiterator(source))
end
end

Base.Multimedia.showable(::MIME"application/vnd.dataresource+json", source::VegaDataset) = true

function load_json(filename)
json_data = JSON.parsefile(filename)

Expand Down

0 comments on commit 33bbd80

Please sign in to comment.