Skip to content

Commit

Permalink
fix(vega): add v4 mime type (#821)
Browse files Browse the repository at this point in the history
* fix(vega): add v4 mime type

The v4 mime type is what is currently supported out of the box by Jupyter, v3 requires an extension to be installed

* style(vegaMime): use list comprehensions
  • Loading branch information
mcmcgrath13 authored and stevengj committed Mar 9, 2019
1 parent 85eb54a commit aca8d5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ This is necessary to embed the JSON as is in the displaydata bundle (rather than
as stringify'd JSON).
"""
const ijulia_jsonmime_types = Vector{Union{MIME, Vector{MIME}}}([
[MIME("application/vnd.vegalite.v2+json"), MIME("application/vnd.vega.v3+json")],
[[MIME("application/vnd.vegalite.v$n+json") for n in 3:-1:2]...,
[MIME("application/vnd.vega.v$n+json") for n in 5:-1:3]...],
MIME("application/vnd.dataresource+json"), MIME("application/vnd.plotly.v1+json")
])

Expand Down Expand Up @@ -164,4 +165,4 @@ function error_content(e, bt=catch_backtrace();
"traceback" => tb)
end

#######################################################################
#######################################################################
4 changes: 2 additions & 2 deletions src/inline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ struct InlineDisplay <: AbstractDisplay end
# of preference (descending "richness")
const ipy_mime = [
"application/vnd.dataresource+json",
"application/vnd.vegalite.v2+json",
"application/vnd.vega.v3+json",
["application/vnd.vegalite.v$n+json" for n in 3:-1:2]...,
["application/vnd.vega.v$n+json" for n in 5:-1:3]...,
"application/vnd.plotly.v1+json",
"text/html",
"text/latex",
Expand Down

0 comments on commit aca8d5b

Please sign in to comment.