Skip to content

Commit aca8d5b

Browse files
mcmcgrath13stevengj
authored andcommitted
fix(vega): add v4 mime type (#821)
* 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
1 parent 85eb54a commit aca8d5b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/display.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ This is necessary to embed the JSON as is in the displaydata bundle (rather than
3535
as stringify'd JSON).
3636
"""
3737
const ijulia_jsonmime_types = Vector{Union{MIME, Vector{MIME}}}([
38-
[MIME("application/vnd.vegalite.v2+json"), MIME("application/vnd.vega.v3+json")],
38+
[[MIME("application/vnd.vegalite.v$n+json") for n in 3:-1:2]...,
39+
[MIME("application/vnd.vega.v$n+json") for n in 5:-1:3]...],
3940
MIME("application/vnd.dataresource+json"), MIME("application/vnd.plotly.v1+json")
4041
])
4142

@@ -164,4 +165,4 @@ function error_content(e, bt=catch_backtrace();
164165
"traceback" => tb)
165166
end
166167

167-
#######################################################################
168+
#######################################################################

src/inline.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ struct InlineDisplay <: AbstractDisplay end
66
# of preference (descending "richness")
77
const ipy_mime = [
88
"application/vnd.dataresource+json",
9-
"application/vnd.vegalite.v2+json",
10-
"application/vnd.vega.v3+json",
9+
["application/vnd.vegalite.v$n+json" for n in 3:-1:2]...,
10+
["application/vnd.vega.v$n+json" for n in 5:-1:3]...,
1111
"application/vnd.plotly.v1+json",
1212
"text/html",
1313
"text/latex",

0 commit comments

Comments
 (0)