diff --git a/Artifacts.toml b/Artifacts.toml index 1d210764..b747d32e 100644 --- a/Artifacts.toml +++ b/Artifacts.toml @@ -1,113 +1,113 @@ [[vegalite_app]] arch = "i686" -git-tree-sha1 = "f0938a68e4bf6f7269b3fddbe423bf0df8be9412" +git-tree-sha1 = "cc1b2fe24b9b19e61f02b978de6fe04bfe599fa5" libc = "glibc" os = "linux" [[vegalite_app.download]] - sha256 = "3edec93ae7d847dc8b47ff0ace2375bec352fbf5ed156ace5e0c6dab91934754" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-i686-linux-gnu.tar.gz" + sha256 = "89cb4b0893145b62ccf8ffa1b1491c9f43eb636e262a2bef450093542fde1fa7" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-i686-linux-gnu.tar.gz" [[vegalite_app]] arch = "x86_64" -git-tree-sha1 = "d4eb87e3d20fd297976fb1bc0bc3a1fe94268bb1" +git-tree-sha1 = "ead9a31a77872dcae4f9a0e110ddb2281812b6b0" libc = "glibc" os = "linux" [[vegalite_app.download]] - sha256 = "103a0e859888770770f315054f77a29c6ecc8d0a1b2f81f15f033a224d76cc75" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-x86_64-linux-gnu.tar.gz" + sha256 = "569c0a6a63132c44093386c0419ba554e1b461a564b9ec3b1867a2de07628a47" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-x86_64-linux-gnu.tar.gz" [[vegalite_app]] arch = "aarch64" -git-tree-sha1 = "5bd3bb2e82818e10e32a3dcd456539866d4245d5" +git-tree-sha1 = "748deb0d5a967ec1d6d81fd06b5da6aea6f69248" libc = "glibc" os = "linux" [[vegalite_app.download]] - sha256 = "f0f3156bde5454c1c0949b4ff24833a56c75ab840074ce1e11eb96cff7cf9850" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-aarch64-linux-gnu.tar.gz" + sha256 = "5b503762ccb2ec3111cb739dfc9e88ca3ef222bc1bd7a36a92ece0900b16291c" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-aarch64-linux-gnu.tar.gz" [[vegalite_app]] arch = "armv7l" -git-tree-sha1 = "6ed56a7b788fcd733ed1f4e7276c30c9c3d9028e" +git-tree-sha1 = "153425b21b526eb1a68ae978c4c94d8d18e34384" libc = "glibc" os = "linux" [[vegalite_app.download]] - sha256 = "59d0abd927cd288716b2bc4487ce65fc25489848c437559d4fcf463f048d1d8e" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-arm-linux-gnueabihf.tar.gz" + sha256 = "6e866644c4edd79549747d38c65f63d71bcbc5a278f23059e8c916985f38cb27" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-arm-linux-gnueabihf.tar.gz" [[vegalite_app]] arch = "powerpc64le" -git-tree-sha1 = "5cdca2f914b761c880abfa54c885e1321d26234e" +git-tree-sha1 = "6c514dd6410ab46df40ec2699f3f9a4d9d4be687" libc = "glibc" os = "linux" [[vegalite_app.download]] - sha256 = "790691d003286bab984211bc5ac33e333488deb659ae4caf113d820283c8ae55" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-powerpc64le-linux-gnu.tar.gz" + sha256 = "f1a1849fd7d5193bc5b6ade9f8cf5dcf6ec5807d748703403cb6b8f21aab693d" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-powerpc64le-linux-gnu.tar.gz" [[vegalite_app]] arch = "i686" -git-tree-sha1 = "9bc0eb9b7ebe598f8241e31342329c29ff9722dd" +git-tree-sha1 = "1eacfe9275cfe445370e9f9a5b7a23ba3714ab20" libc = "musl" os = "linux" [[vegalite_app.download]] - sha256 = "a09c7062bd1bcd2094e4f2d5f83765a57e359650bdb499527a78b3b95cfb48c2" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-i686-linux-musl.tar.gz" + sha256 = "f728524dbcb9c4609ea7353f0b59cd752d8853f21553acf4bd5115a67d3f10d8" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-i686-linux-musl.tar.gz" [[vegalite_app]] arch = "x86_64" -git-tree-sha1 = "8376a346e836172a927feaf861966a8c60314064" +git-tree-sha1 = "43d22de95c1b6f86e8ad03d59293ea23497cdade" libc = "musl" os = "linux" [[vegalite_app.download]] - sha256 = "bfd9b27c7138199c7ac594355936242506b75ed986d04c27c3c322116ecf5a9f" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-x86_64-linux-musl.tar.gz" + sha256 = "053aa2c9ae2821d5f8853a3ab6a0fff9537e3812e39ce20f16dca5b7d5993f67" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-x86_64-linux-musl.tar.gz" [[vegalite_app]] arch = "aarch64" -git-tree-sha1 = "492343be069aa550d8d29f3a378851389feb9a0e" +git-tree-sha1 = "08654a75e6f24e26a94174bc6a132faf06f2add0" libc = "musl" os = "linux" [[vegalite_app.download]] - sha256 = "ab0f2b40f045766beb4cbc1b04e94ed1e3000735989ed902dd1ee6e5a8a4144b" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-aarch64-linux-musl.tar.gz" + sha256 = "38db53311cb0c5d1e7c4067a3122ad3d3e820bea85c547c68aaa764fb56e2d4f" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-aarch64-linux-musl.tar.gz" [[vegalite_app]] arch = "armv7l" -git-tree-sha1 = "7200ac4e39a4586c95660101eb328fb33f99f4a6" +git-tree-sha1 = "48f2e0056c364c55f8097b721518115924816b36" libc = "musl" os = "linux" [[vegalite_app.download]] - sha256 = "915fc59a57f44b0992afe8d6c68ba4e70018a9714b7236ed320a2221cbbe2db7" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-arm-linux-musleabihf.tar.gz" + sha256 = "c155d1b028d26553f113147ac4edaf23061dc77564bc84c7965f0e083b353300" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-arm-linux-musleabihf.tar.gz" [[vegalite_app]] arch = "x86_64" -git-tree-sha1 = "83b94e72a3341f67247b0c45f810cd5682ec5e08" +git-tree-sha1 = "2f940e09ca056ec979279f3a2bd1f8991fc6a680" os = "macos" [[vegalite_app.download]] - sha256 = "d3fc1d2c8059144340b31bd63831f3188be1de99b72a8a730bc4f58f7a8622ef" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-x86_64-apple-darwin14.tar.gz" + sha256 = "2570eda374182396150b6760f2475eb431c738c46af7d298d157271228039a90" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-x86_64-apple-darwin14.tar.gz" [[vegalite_app]] arch = "x86_64" -git-tree-sha1 = "3a74249a6bfc181ffc52303be013e46e9f809597" +git-tree-sha1 = "54832120b3b3cc3b805751d48a6f5b8f3d5380da" os = "freebsd" [[vegalite_app.download]] - sha256 = "36d55d7f365d75124d4848068f627b4c756f9463be3bb947adedb75495cfc55c" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-x86_64-unknown-freebsd11.1.tar.gz" + sha256 = "11a487711624fb2f0cc0abd666a9f7383d027803924227e78a7ada9c47245fe3" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-x86_64-unknown-freebsd11.1.tar.gz" [[vegalite_app]] arch = "i686" -git-tree-sha1 = "05e2dd49dbb3f0bf3f492fd67f5a8fce3a04d11d" +git-tree-sha1 = "97ba8c2e3b321a3c11b5edfee4d4e8a3bcda2eee" os = "windows" [[vegalite_app.download]] - sha256 = "943d2a4745436d723ca84e57f951e90aafa3aff25985da152f34374e3e5bc6d6" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-i686-w64-mingw32.tar.gz" + sha256 = "d6c3e5c19419b13bb5a36f5bb64988ff215768437362dbf484180744748ab9cb" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-i686-w64-mingw32.tar.gz" [[vegalite_app]] arch = "x86_64" -git-tree-sha1 = "b80366d79f4eb178efd93d258a6fbf021cd0ee9f" +git-tree-sha1 = "a473943ecf51217f67b7cf30ddd3c4069e39aa7a" os = "windows" [[vegalite_app.download]] - sha256 = "07d75a1e330a51dd92859e065e86235bf110c80025ac69530f08766704d3fe51" - url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.5.1/vegaliteassets-2.5.1-x86_64-w64-mingw32.tar.gz" + sha256 = "c4385b5eb33223123fb47f25f063918596f275218dd67058be09b82a72b128d6" + url = "https://github.com/queryverse/VegaLiteBuilder/releases/download/v2.6.0/vegaliteassets-2.6.0-x86_64-w64-mingw32.tar.gz" diff --git a/Project.toml b/Project.toml index 63ba0835..c7c13e19 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "VegaLite" uuid = "112f6efa-9a02-5b7d-90c0-432ed331239a" -version = "2.3.1-DEV" +version = "2.3.2-DEV" [deps] Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" @@ -12,7 +12,6 @@ JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Vega = "239c3e63-733f-47ad-beb7-a12fde22c578" DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" -JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" NodeJS = "2bd173c7-0d6d-553b-b6af-13a54713934c" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" @@ -20,7 +19,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" TableTraitsUtils = "382cd787-c1b6-5bf2-a167-d5b971a19bda" DataValues = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5" FilePaths = "8fc22ac5-c921-52a6-82fd-178b2807b824" -Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" URIParser = "30578b45-9adc-5946-b283-645ec420af67" [extras] @@ -28,14 +26,14 @@ VegaDatasets = "0ae4a718-28b7-58ec-9efb-cded64d6d5b4" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" [compat] TableTraits = "0.3.1, 0.4, 1" IteratorInterfaceExtensions = "0.1.1, 1" JSON = "0.19, 0.20, 0.21" Vega = "0.1, 1, 2" -DataStructures = "0.17" -JSONSchema = "0.1, 0.2" +DataStructures = "0.17, 0.18" NodeJS = "0.5.1, 0.6, 1" MacroTools = "0.4.4, 0.5" FileIO = "1.0.1" @@ -43,8 +41,7 @@ TableTraitsUtils = "1" julia = "1.3" DataValues = "0.4.4" FilePaths = "0.7, 0.8" -Setfield = "0.4, 0.5, 0.6" URIParser = "0.4" [targets] -test = ["VegaDatasets", "Dates", "Test", "DataFrames"] +test = ["VegaDatasets", "Dates", "Test", "DataFrames", "Setfield"] diff --git a/README.md b/README.md index af49b225..c06b6f3e 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,7 @@ To install [VegaLite.jl](https://github.com/queryverse/VegaLite.jl), run the fol ## Documentation The current documentation can be found [here](https://queryverse.github.io/VegaLite.jl/stable). + +## Developer Notes + +Jupyterlab support depends on Juperlab's built-in renderer; before updating to a new major version of vega-lite, check the [jupyterlab project](https://github.com/jupyterlab/jupyterlab/blob/master/packages/vega5-extension/package.json#L42) for the latest supported version of vega-lite. diff --git a/docs/make.jl b/docs/make.jl index c3dc2ea1..8f274a6d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,7 @@ using Documenter, VegaLite, UUIDs function Base.show(io::IO, m::MIME"text/html", v::VegaLite.VLSpec) - divid = string("vl", replace(string(uuid4()), "-"=>"")) + divid = string("vl", replace(string(uuid4()), "-" => "")) print(io, "
") print(io, " @@ -61,13 +61,13 @@ function writehtml_full(io::IO, spec::VLSpec; title="VegaLite plot") end function writehtml_full(spec::VLSpec; title="VegaLite plot") - tmppath = string(tempname(), ".vegalite.html") + tmppath = string(tempname(), ".vegalite.html") - open(tmppath, "w") do io - writehtml_full(io, spec, title=title) - end + open(tmppath, "w") do io + writehtml_full(io, spec, title=title) + end - tmppath + tmppath end """ @@ -76,9 +76,9 @@ VegaLite js files are loaded from the web (to accommodate the security model of IJulia) using requirejs. """ function writehtml_partial(io::IO, spec::String; title="VegaLite plot") - divid = "vg" * randstring(3) + divid = "vg" * randstring(3) - println(io, + println(io, """ @@ -137,6 +137,6 @@ end function Base.display(d::REPL.REPLDisplay, plt::VLSpec) # checkplot(plt) - tmppath = writehtml_full(plt) - Vega.launch_browser(tmppath) # Open the browser + tmppath = writehtml_full(plt) + Vega.launch_browser(tmppath) # Open the browser end diff --git a/src/rendering/show.jl b/src/rendering/show.jl index 22af658d..8f9eed1c 100644 --- a/src/rendering/show.jl +++ b/src/rendering/show.jl @@ -8,7 +8,7 @@ function convert_vl_to_vg(v::VLSpec) reader = @async read(p, String) wait(p) res = fetch(reader) - if p.exitcode!=0 + if p.exitcode != 0 throw(ArgumentError("Invalid spec")) end return res @@ -25,7 +25,7 @@ function convert_vl_to_x(v::VLSpec, second_script) reader = @async read(p, String) wait(p) res = fetch(reader) - if p.processes[1].exitcode!=0 || p.processes[2].exitcode!=0 + if p.processes[1].exitcode != 0 || p.processes[2].exitcode != 0 throw(ArgumentError("Invalid spec")) end return res @@ -42,7 +42,7 @@ function convert_vl_to_svg(v::VLSpec) reader = @async read(p, String) wait(p) res = fetch(reader) - if p.processes[1].exitcode!=0 || p.processes[2].exitcode!=0 + if p.processes[1].exitcode != 0 || p.processes[2].exitcode != 0 throw(ArgumentError("Invalid spec")) end return res diff --git a/src/rendering/to_julia.jl b/src/rendering/to_julia.jl index 907535dc..57fa960f 100644 --- a/src/rendering/to_julia.jl +++ b/src/rendering/to_julia.jl @@ -1,6 +1,6 @@ function Vega.printrepr(io::IO, v::VLSpec; indent=nothing, include_data=false) - newlines = indent===nothing ? false : true - indent = indent===nothing ? 0 : indent + newlines = indent === nothing ? false : true + indent = indent === nothing ? 0 : indent print(io, "@vlplot(") newlines && println(io) diff --git a/src/vlspec.jl b/src/vlspec.jl index 649a0030..5ac76b26 100644 --- a/src/vlspec.jl +++ b/src/vlspec.jl @@ -10,20 +10,20 @@ end # data is an object in vega lite function vl_set_spec_data!(specdict, datait) - recs = [OrderedDict{String,Any}(string(c[1])=>isa(c[2], DataValues.DataValue) ? (isna(c[2]) ? nothing : get(c[2])) : c[2] for c in zip(keys(r), values(r))) for r in datait] + recs = [OrderedDict{String,Any}(string(c[1]) => isa(c[2], DataValues.DataValue) ? (isna(c[2]) ? nothing : get(c[2])) : c[2] for c in zip(keys(r), values(r))) for r in datait] specdict["data"] = OrderedDict{String,Any}("values" => recs) end function augment_encoding_type(x::AbstractDict, data::Vega.DataValuesNode) if !haskey(x, "type") && !haskey(x, "aggregate") && haskey(x, "field") && haskey(data.columns, Symbol(x["field"])) new_x = copy(x) - + jl_type = eltype(data.columns[Symbol(x["field"])]) - + if jl_type <: DataValues.DataValue jl_type = eltype(jl_type) end - + if jl_type <: Number new_x["type"] = "quantitative" elseif jl_type <: AbstractString @@ -35,17 +35,17 @@ function augment_encoding_type(x::AbstractDict, data::Vega.DataValuesNode) return new_x else return x - end +end end function add_encoding_types(specdict, parentdata=nothing) - if (haskey(specdict, "data") && haskey(specdict["data"], "values") && specdict["data"]["values"] isa Vega.DataValuesNode) || parentdata!==nothing + if (haskey(specdict, "data") && haskey(specdict["data"], "values") && specdict["data"]["values"] isa Vega.DataValuesNode) || parentdata !== nothing data = (haskey(specdict, "data") && haskey(specdict["data"], "values") && specdict["data"]["values"] isa Vega.DataValuesNode) ? specdict["data"]["values"] : parentdata newspec = OrderedDict{String,Any}( - (k=="encoding" && v isa AbstractDict) ? k=>OrderedDict{String,Any}(kk=>augment_encoding_type(vv, data) for (kk,vv) in v) : - k=="spec" ? k=>add_encoding_types(v, data) : - k in ("layer", "concat", "vconcat", "hconcat") ? k=>[add_encoding_types(i, data) for i in v] : k=>v for (k,v) in specdict + (k == "encoding" && v isa AbstractDict) ? k => OrderedDict{String,Any}(kk => augment_encoding_type(vv, data) for (kk, vv) in v) : + k == "spec" ? k => add_encoding_types(v, data) : + k in ("layer", "concat", "vconcat", "hconcat") ? k => [add_encoding_types(i, data) for i in v] : k => v for (k, v) in specdict ) return newspec @@ -60,7 +60,7 @@ end function (p::VLSpec)(data) TableTraits.isiterabletable(data) || throw(ArgumentError("'data' is not a table.")) - + it = IteratorInterfaceExtensions.getiterator(data) datavaluesnode = Vega.DataValuesNode(it) @@ -70,7 +70,7 @@ function (p::VLSpec)(data) new_dict["data"] = OrderedDict{String,Any}("values" => datavaluesnode) return VLSpec(new_dict) -end + end function (p::VLSpec)(uri::URI) new_dict = copy(Vega.getparams(p)) @@ -119,7 +119,7 @@ function Base.:+(a::VLSpec, b::VLSpec) elseif haskey(Vega.getparams(b), "hconcat") new_spec["hconcat"] = deepcopy(Vega.getparams(b)["hconcat"]) else - if !haskey(new_spec,"layer") + if !haskey(new_spec, "layer") new_spec["layer"] = [] end push!(new_spec["layer"], deepcopy(Vega.getparams(b))) diff --git a/test/scratchpad.jl b/test/scratchpad.jl index b349fbf8..d704b316 100644 --- a/test/scratchpad.jl +++ b/test/scratchpad.jl @@ -17,22 +17,22 @@ rooturl = "https://raw.githubusercontent.com/vega/new-editor/master/data/" dataurl = rooturl * "data/cars.json" plot( - rep(row = ["Horsepower","Acceleration"], - column = ["Horsepower", "Miles_per_Gallon"]), + rep(row=["Horsepower","Acceleration"], + column=["Horsepower", "Miles_per_Gallon"]), spec( data(url=durl), mk.point(), selection( brush=@NT( - typ="interval", resolve="union", - encodings=["x"], - on="[mousedown[event.shiftKey], mouseup] > mousemove", - translate="[mousedown[event.shiftKey], mouseup] > mousemove"), + typ = "interval", resolve = "union", + encodings = ["x"], + on = "[mousedown[event.shiftKey], mouseup] > mousemove", + translate = "[mousedown[event.shiftKey], mouseup] > mousemove"), grid=@NT( - typ="interval", resolve="global", bind="scales", - translate="[mousedown[!event.shiftKey], mouseup] > mousemove") ), - enc.x.quantitative(@NT(repeat=:row)), - enc.y.quantitative(@NT(repeat=:column)), - enc.color.nominal(:Origin, condition=@NT(selection="!brush", value=:grey)) + typ = "interval", resolve = "global", bind = "scales", + translate = "[mousedown[!event.shiftKey], mouseup] > mousemove") ), + enc.x.quantitative(@NT(repeat = :row)), + enc.y.quantitative(@NT(repeat = :column)), + enc.color.nominal(:Origin, condition=@NT(selection = "!brush", value = :grey)) ) ) |> display diff --git a/test/test_base.jl b/test/test_base.jl index 9fb2f9d1..32f9352c 100644 --- a/test/test_base.jl +++ b/test/test_base.jl @@ -1,12 +1,12 @@ using Test using VegaLite -using VegaLite: Vega.getparams +using VegaLite:Vega.getparams @testset "base" begin equiv(a::VegaLite.VLSpec, b::VegaLite.VLSpec) = false equiv(a::VegaLite.VLSpec, b::VegaLite.VLSpec) = - ==(Vega.getparams(a),Vega.getparams(b)) + ==(Vega.getparams(a), Vega.getparams(b)) ### @test isa(renderer(), Symbol) @@ -21,9 +21,9 @@ actionlinks(false) @test actionlinks() == false ### -ts = collect(range(0,stop=2,length=100)) -rs = Float64[ rand()*0.1 + cos(x) for x in ts] -datvals = [ Dict(:time => t, :res => r) for (t,r) in zip(ts, rs) ] +ts = collect(range(0, stop=2, length=100)) +rs = Float64[ rand() * 0.1 + cos(x) for x in ts] +datvals = [ Dict(:time => t, :res => r) for (t, r) in zip(ts, rs) ] # @test isa(vlconfig(background="green"), VegaLite.VLSpec{:config}) # @test isa(markline(), VegaLite.VLSpec{:mark}) diff --git a/test/test_inlinedata.jl b/test/test_inlinedata.jl index c0f1b60e..6693ac8a 100644 --- a/test/test_inlinedata.jl +++ b/test/test_inlinedata.jl @@ -1,9 +1,9 @@ @testset "Inline Data" begin -@test @vlplot(:point, x={[1,2,3]}, y=[4,5,6]) == - @vlplot(:point, data=DataFrame(x=[1,2,3], y=[4,5,6]), x={:x, title=nothing}, y={:y, title=nothing}) +@test @vlplot(:point, x = {[1,2,3]}, y = [4,5,6]) == + @vlplot(:point, data = DataFrame(x=[1,2,3], y=[4,5,6]), x = {:x, title = nothing}, y = {:y, title = nothing}) -@test @vlplot(:point, x={[1,2,3], title=:test}, y=[4,5,6]) == - @vlplot(:point, data=DataFrame(x=[1,2,3], y=[4,5,6]), x={:x, title=:test}, y={:y, title=nothing}) +@test @vlplot(:point, x = {[1,2,3], title = :test}, y = [4,5,6]) == + @vlplot(:point, data = DataFrame(x=[1,2,3], y=[4,5,6]), x = {:x, title = :test}, y = {:y, title = nothing}) end diff --git a/test/test_io.jl b/test/test_io.jl index 0a119e95..0efec1f1 100644 --- a/test/test_io.jl +++ b/test/test_io.jl @@ -1,13 +1,13 @@ using Test using VegaLite -using VegaLite: Vega.getparams +using VegaLite:Vega.getparams using DataFrames using Dates using FileIO @testset "io" begin -p = DataFrame(x = [1,2,3], y=[1,2,3]) |> @vlplot(:point, x="x:q", y="y:q") +p = DataFrame(x=[1,2,3], y=[1,2,3]) |> @vlplot(:point, x = "x:q", y = "y:q") vgp = getvgplot() vlp = getvlplot() @@ -17,93 +17,95 @@ vlp = getvlplot() ], indent in [nothing, 4] - let json = sprint(io -> save(Stream(fmt, io), plt, indent=indent)), + let json = sprint(io -> save(Stream{fmt}(io), plt, indent=indent)), code = "vg\"\"\"$json\"\"\"" @test Vega.getparams(include_string(@__MODULE__, code)) == Vega.getparams(plt) end let io = IOBuffer() - save(Stream(fmt, io), plt, indent=indent) + save(Stream{fmt}(io), plt, indent=indent) seek(io, 0) - @test Vega.getparams(load(Stream(fmt, io))) == Vega.getparams(plt) + @test Vega.getparams(load(Stream{fmt}(io))) == Vega.getparams(plt) end - let code = repr("text/plain", plt, context=:compact=>false) + let code = repr("text/plain", plt, context=:compact => false) @test Vega.getparams(include_string(@__MODULE__, code)) == Vega.getparams(plt) end end - + Base.Filesystem.mktempdir() do folder - VegaLite.svg(joinpath(folder,"test1.svg"), p) - @test isfile(joinpath(folder,"test1.svg")) + VegaLite.svg(joinpath(folder, "test1.svg"), p) + @test isfile(joinpath(folder, "test1.svg")) - VegaLite.pdf(joinpath(folder,"test1.pdf"), p) - @test isfile(joinpath(folder,"test1.pdf")) + VegaLite.pdf(joinpath(folder, "test1.pdf"), p) + @test isfile(joinpath(folder, "test1.pdf")) - VegaLite.png(joinpath(folder,"test1.png"), p) - @test isfile(joinpath(folder,"test1.png")) + VegaLite.png(joinpath(folder, "test1.png"), p) + @test isfile(joinpath(folder, "test1.png")) # VegaLite.eps(joinpath(folder,"test1.eps"), p) # @test isfile(joinpath(folder,"test1.eps")) - VegaLite.savefig(joinpath(folder,"test2.svg"), p) - @test isfile(joinpath(folder,"test2.svg")) + VegaLite.savefig(joinpath(folder, "test2.svg"), p) + @test isfile(joinpath(folder, "test2.svg")) - VegaLite.savefig(joinpath(folder,"test2.pdf"), p) - @test isfile(joinpath(folder,"test2.pdf")) + VegaLite.savefig(joinpath(folder, "test2.pdf"), p) + @test isfile(joinpath(folder, "test2.pdf")) - VegaLite.savefig(joinpath(folder,"test2.png"), p) - @test isfile(joinpath(folder,"test2.png")) + VegaLite.savefig(joinpath(folder, "test2.png"), p) + @test isfile(joinpath(folder, "test2.png")) # VegaLite.savefig(joinpath(folder,"test2.eps"), p) # @test isfile(joinpath(folder,"test2.eps")) - save(joinpath(folder,"test3.svg"), p) - @test isfile(joinpath(folder,"test3.svg")) + save(joinpath(folder, "test3.svg"), p) + @test isfile(joinpath(folder, "test3.svg")) - save(joinpath(folder,"test3.pdf"), p) - @test isfile(joinpath(folder,"test3.pdf")) + save(joinpath(folder, "test3.pdf"), p) + @test isfile(joinpath(folder, "test3.pdf")) - save(joinpath(folder,"test3.png"), p) - @test isfile(joinpath(folder,"test3.png")) + save(joinpath(folder, "test3.png"), p) + @test isfile(joinpath(folder, "test3.png")) # save(joinpath(folder,"test2.eps"), p) # @test isfile(joinpath(folder,"test2.eps")) - save(joinpath(folder,"test4.svg"), vgp) - @test isfile(joinpath(folder,"test4.svg")) + save(joinpath(folder, "test4.svg"), vgp) + @test isfile(joinpath(folder, "test4.svg")) - save(joinpath(folder,"test4.pdf"), vgp) - @test isfile(joinpath(folder,"test4.pdf")) + save(joinpath(folder, "test4.pdf"), vgp) + @test isfile(joinpath(folder, "test4.pdf")) - save(joinpath(folder,"test4.png"), vgp) - @test isfile(joinpath(folder,"test4.png")) + save(joinpath(folder, "test4.png"), vgp) + @test isfile(joinpath(folder, "test4.png")) # save(joinpath(folder,"test4.eps"), vgp) # @test isfile(joinpath(folder,"test4.eps")) - Vega.savespec(joinpath(folder,"test1.vegalite"), p) - @test isfile(joinpath(folder,"test1.vegalite")) + Vega.savespec(joinpath(folder, "test1.vegalite"), p) + @test isfile(joinpath(folder, "test1.vegalite")) - @test_throws ArgumentError VegaLite.savefig(joinpath(folder,"test1.foo"), p) + @test_throws ArgumentError VegaLite.savefig(joinpath(folder, "test1.foo"), p) - save(joinpath(folder,"test2.vegalite"), p) - @test isfile(joinpath(folder,"test2.vegalite")) + save(joinpath(folder, "test2.vegalite"), p) + @test isfile(joinpath(folder, "test2.vegalite")) - p2 = VegaLite.loadspec(joinpath(folder,"test1.vegalite")) + p2 = VegaLite.loadspec(joinpath(folder, "test1.vegalite")) @test isa(p2, VegaLite.VLSpec) - p2 = load(joinpath(folder,"test1.vegalite")) + p2 = load(joinpath(folder, "test1.vegalite")) @test isa(p2, VegaLite.VLSpec) vgpl1 = getvgplot() - Vega.savespec(joinpath(folder,"test1.vega"), vgpl1, include_data=true) + Vega.savespec(joinpath(folder, "test1.vega"), vgpl1, include_data=true) - vgpl2 = VegaLite.Vega.loadvgspec(joinpath(folder,"test1.vega")) + vgpl2 = VegaLite.Vega.loadvgspec(joinpath(folder, "test1.vega")) @test vgpl1 == vgpl1 + @test_broken p |> save("testfile.png") + # TODO Enable once FileIO stuff is merged # save(joinpath(folder,"test3.vega"), vgpl1) # @test isfile(joinpath(folder,"test3.vega")) diff --git a/test/test_macro.jl b/test/test_macro.jl index 1f17633d..334ae26e 100644 --- a/test/test_macro.jl +++ b/test/test_macro.jl @@ -1,5 +1,5 @@ using VegaLite -using VegaLite: Vega.getparams +using VegaLite:Vega.getparams using JSON using Test diff --git a/test/test_positional.jl b/test/test_positional.jl index 26da7254..7a9f6d33 100644 --- a/test/test_positional.jl +++ b/test/test_positional.jl @@ -2,14 +2,14 @@ df = DataFrame(a=[1,2,3], b=[4,5,6]) -@test @vlplot(:point, [1,2,3]) == @vlplot(:point, x=[1,2,3]) -@test @vlplot(:point, {[1,2,3]}) == @vlplot(:point, x=[1,2,3]) -@test @vlplot(:point, [1,2,3], [4,5,6]) == @vlplot(:point, x=[1,2,3], y=[4,5,6]) -@test @vlplot(:point, {[1,2,3]}, {[4,5,6]}) == @vlplot(:point, x=[1,2,3], y=[4,5,6]) -@test @vlplot(:point, :a, data=df) == @vlplot(:point, x=:a, data=df) -@test @vlplot(:point, :a, :b, data=df) == @vlplot(:point, x=:a, y=:b, data=df) -@test @vlplot(:point, {:a}, data=df) == @vlplot(:point, x=:a, data=df) -@test @vlplot(:point, {:a}, {:b}, data=df) == @vlplot(:point, x=:a, y=:b, data=df) -@test @vlplot(:point, {"a:q"}, {"b:q"}, data=df) == @vlplot(:point, x="a:q", y="b:q", data=df) +@test @vlplot(:point, [1,2,3]) == @vlplot(:point, x = [1,2,3]) +@test @vlplot(:point, {[1,2,3]}) == @vlplot(:point, x = [1,2,3]) +@test @vlplot(:point, [1,2,3], [4,5,6]) == @vlplot(:point, x = [1,2,3], y = [4,5,6]) +@test @vlplot(:point, {[1,2,3]}, {[4,5,6]}) == @vlplot(:point, x = [1,2,3], y = [4,5,6]) +@test @vlplot(:point, :a, data = df) == @vlplot(:point, x = :a, data = df) +@test @vlplot(:point, :a, :b, data = df) == @vlplot(:point, x = :a, y = :b, data = df) +@test @vlplot(:point, {:a}, data = df) == @vlplot(:point, x = :a, data = df) +@test @vlplot(:point, {:a}, {:b}, data = df) == @vlplot(:point, x = :a, y = :b, data = df) +@test @vlplot(:point, {"a:q"}, {"b:q"}, data = df) == @vlplot(:point, x = "a:q", y = "b:q", data = df) end diff --git a/test/test_shorthand.jl b/test/test_shorthand.jl index 9c43db2b..ee6fb495 100644 --- a/test/test_shorthand.jl +++ b/test/test_shorthand.jl @@ -3,42 +3,42 @@ using VegaLite @testset "Shorthand" begin -@test VegaLite.parse_shortcut("foo") == ["field"=>"foo"] +@test VegaLite.parse_shortcut("foo") == ["field" => "foo"] -@test VegaLite.parse_shortcut("foo:q") == ["field"=>"foo", "type"=>"quantitative"] -@test VegaLite.parse_shortcut("foo:Q") == ["field"=>"foo", "type"=>"quantitative"] -@test VegaLite.parse_shortcut("foo:quantitative") == ["field"=>"foo", "type"=>"quantitative"] -@test VegaLite.parse_shortcut("foo:quAntitAtive") == ["field"=>"foo", "type"=>"quantitative"] +@test VegaLite.parse_shortcut("foo:q") == ["field" => "foo", "type" => "quantitative"] +@test VegaLite.parse_shortcut("foo:Q") == ["field" => "foo", "type" => "quantitative"] +@test VegaLite.parse_shortcut("foo:quantitative") == ["field" => "foo", "type" => "quantitative"] +@test VegaLite.parse_shortcut("foo:quAntitAtive") == ["field" => "foo", "type" => "quantitative"] -@test VegaLite.parse_shortcut("foo:n") == ["field"=>"foo", "type"=>"nominal"] -@test VegaLite.parse_shortcut("foo:N") == ["field"=>"foo", "type"=>"nominal"] -@test VegaLite.parse_shortcut("foo:nominal") == ["field"=>"foo", "type"=>"nominal"] -@test VegaLite.parse_shortcut("foo:nOminAl") == ["field"=>"foo", "type"=>"nominal"] +@test VegaLite.parse_shortcut("foo:n") == ["field" => "foo", "type" => "nominal"] +@test VegaLite.parse_shortcut("foo:N") == ["field" => "foo", "type" => "nominal"] +@test VegaLite.parse_shortcut("foo:nominal") == ["field" => "foo", "type" => "nominal"] +@test VegaLite.parse_shortcut("foo:nOminAl") == ["field" => "foo", "type" => "nominal"] -@test VegaLite.parse_shortcut("foo:o") == ["field"=>"foo", "type"=>"ordinal"] -@test VegaLite.parse_shortcut("foo:O") == ["field"=>"foo", "type"=>"ordinal"] -@test VegaLite.parse_shortcut("foo:ordinal") == ["field"=>"foo", "type"=>"ordinal"] -@test VegaLite.parse_shortcut("foo:OrDinAl") == ["field"=>"foo", "type"=>"ordinal"] +@test VegaLite.parse_shortcut("foo:o") == ["field" => "foo", "type" => "ordinal"] +@test VegaLite.parse_shortcut("foo:O") == ["field" => "foo", "type" => "ordinal"] +@test VegaLite.parse_shortcut("foo:ordinal") == ["field" => "foo", "type" => "ordinal"] +@test VegaLite.parse_shortcut("foo:OrDinAl") == ["field" => "foo", "type" => "ordinal"] -@test VegaLite.parse_shortcut("foo:t") == ["field"=>"foo", "type"=>"temporal"] -@test VegaLite.parse_shortcut("foo:T") == ["field"=>"foo", "type"=>"temporal"] -@test VegaLite.parse_shortcut("foo:temporal") == ["field"=>"foo", "type"=>"temporal"] -@test VegaLite.parse_shortcut("foo:tEmporAl") == ["field"=>"foo", "type"=>"temporal"] +@test VegaLite.parse_shortcut("foo:t") == ["field" => "foo", "type" => "temporal"] +@test VegaLite.parse_shortcut("foo:T") == ["field" => "foo", "type" => "temporal"] +@test VegaLite.parse_shortcut("foo:temporal") == ["field" => "foo", "type" => "temporal"] +@test VegaLite.parse_shortcut("foo:tEmporAl") == ["field" => "foo", "type" => "temporal"] @test_throws ArgumentError VegaLite.parse_shortcut("foo:x") @test_throws ArgumentError VegaLite.parse_shortcut("foo:bar") -@test VegaLite.parse_shortcut("sum(foo)") == ["aggregate"=>"sum", "field"=>"foo", "type"=>"quantitative"] -@test VegaLite.parse_shortcut("sum(foo):o") == ["aggregate"=>"sum", "field"=>"foo", "type"=>"ordinal"] -@test VegaLite.parse_shortcut("sum(foo):quantitative") == ["aggregate"=>"sum", "field"=>"foo", "type"=>"quantitative"] +@test VegaLite.parse_shortcut("sum(foo)") == ["aggregate" => "sum", "field" => "foo", "type" => "quantitative"] +@test VegaLite.parse_shortcut("sum(foo):o") == ["aggregate" => "sum", "field" => "foo", "type" => "ordinal"] +@test VegaLite.parse_shortcut("sum(foo):quantitative") == ["aggregate" => "sum", "field" => "foo", "type" => "quantitative"] @test_throws ArgumentError VegaLite.parse_shortcut("sum(foo):bar") -@test VegaLite.parse_shortcut("year(foo)") == ["timeUnit"=>"year", "field"=>"foo", "type"=>"temporal"] -@test VegaLite.parse_shortcut("month(foo):o") == ["timeUnit"=>"month", "field"=>"foo", "type"=>"ordinal"] -@test VegaLite.parse_shortcut("yearmonth(foo):quantitative") == ["timeUnit"=>"yearmonth", "field"=>"foo", "type"=>"quantitative"] +@test VegaLite.parse_shortcut("year(foo)") == ["timeUnit" => "year", "field" => "foo", "type" => "temporal"] +@test VegaLite.parse_shortcut("month(foo):o") == ["timeUnit" => "month", "field" => "foo", "type" => "ordinal"] +@test VegaLite.parse_shortcut("yearmonth(foo):quantitative") == ["timeUnit" => "yearmonth", "field" => "foo", "type" => "quantitative"] -@test VegaLite.parse_shortcut("count()") == ["aggregate"=>"count", "type"=>"quantitative"] -@test VegaLite.parse_shortcut("count():o") == ["aggregate"=>"count", "type"=>"ordinal"] +@test VegaLite.parse_shortcut("count()") == ["aggregate" => "count", "type" => "quantitative"] +@test VegaLite.parse_shortcut("count():o") == ["aggregate" => "count", "type" => "ordinal"] @test_throws ArgumentError VegaLite.parse_shortcut("%lijasef9") diff --git a/test/test_spec.jl b/test/test_spec.jl index df261487..e8fd7448 100644 --- a/test/test_spec.jl +++ b/test/test_spec.jl @@ -19,7 +19,7 @@ using VegaDatasets df = DataFrame(a=[1.,2.], b=["A", "B"], c=[Date(2000), Date(2001)]) -p1 = (df |> @vlplot("line", x=:c, y=:a, color=:b)) +p1 = (df |> @vlplot("line", x = :c, y = :a, color = :b)) p2 = vl""" { "encoding": { @@ -45,7 +45,7 @@ Vega.deletedata!(p1) @test p1 == p2 -p3 = DataFrame(a=[1,2,missing], b=[3.,2.,1.]) |> @vlplot(:point, x=:a, y=:b) +p3 = DataFrame(a=[1,2,missing], b=[3.,2.,1.]) |> @vlplot(:point, x = :a, y = :b) p4 = vl""" { @@ -81,8 +81,8 @@ p4 = vl""" # @test p3 == p4 -p5 = dataset("cars").path |> @vlplot(:point, x=:Miles_per_Gallon, y=:Acceleration) +p5 = dataset("cars").path |> @vlplot(:point, x = :Miles_per_Gallon, y = :Acceleration) -@test haskey(Vega.getparams(p5)["data"],"url") +@test haskey(Vega.getparams(p5)["data"], "url") end diff --git a/test/test_vlplot_macro.jl b/test/test_vlplot_macro.jl index de40eac1..f648cfdc 100644 --- a/test/test_vlplot_macro.jl +++ b/test/test_vlplot_macro.jl @@ -6,34 +6,34 @@ using Test @testset "@vlplot macro" begin -@test @vlplot(mark={"point"}) == (vl""" +@test @vlplot(mark = {"point"}) == (vl""" {"mark": {"type": "point"}} """) -@test @vlplot("point", data={values=[{a=1}]}) == (vl""" +@test @vlplot("point", data = {values = [{a = 1}]}) == (vl""" {"mark": "point", "data": {"values":[{"a": 1}]}} """) -@test @vlplot(:point, x=:foo) == @vlplot(:point, enc={x=:foo}) +@test @vlplot(:point, x = :foo) == @vlplot(:point, enc = {x = :foo}) -@test @vlplot(mark={type=:point}) == @vlplot(mark={:point}) +@test @vlplot(mark = {type = :point}) == @vlplot(mark = {:point}) -@test (p"/foo/bar" |> @vlplot(:point)) == @vlplot(:point, data=p"/foo/bar") +@test (p"/foo/bar" |> @vlplot(:point)) == @vlplot(:point, data = p"/foo/bar") -@test (p"/foo/bar" |> @vlplot(:point)) == @vlplot(:point, data={url=p"/foo/bar"}) +@test (p"/foo/bar" |> @vlplot(:point)) == @vlplot(:point, data = {url = p"/foo/bar"}) -@test (URI("http://foo.com/bar.json") |> @vlplot(:point)) == @vlplot(:point, data=URI("http://foo.com/bar.json")) +@test (URI("http://foo.com/bar.json") |> @vlplot(:point)) == @vlplot(:point, data = URI("http://foo.com/bar.json")) -@test (URI("http://foo.com/bar.json") |> @vlplot(:point)) == @vlplot(:point, data={url=URI("http://foo.com/bar.json")}) +@test (URI("http://foo.com/bar.json") |> @vlplot(:point)) == @vlplot(:point, data = {url = URI("http://foo.com/bar.json")}) -@test (DataFrame(a=[1]) |> @vlplot(:point)) == @vlplot(:point, data=DataFrame(a=[1])) +@test (DataFrame(a=[1]) |> @vlplot(:point)) == @vlplot(:point, data = DataFrame(a=[1])) -@test Vega.getparams(@vlplot("point", transform=[{lookup="foo", from={data=p"/foo/bar", key="bar"}}]))["transform"][1]["from"]["data"]["url"] == (Sys.iswindows() ? "file://foo/bar" : "file:///foo/bar") -@test Vega.getparams(@vlplot("point", transform=[{lookup="foo", from={data={url=p"/foo/bar"}, key="bar"}}]))["transform"][1]["from"]["data"]["url"] == (Sys.iswindows() ? "file://foo/bar" : "file:///foo/bar") -@test Vega.getparams(@vlplot("point", transform=[{lookup="foo", from={data=URI("http://foo.com/bar.json"), key="bar"}}]))["transform"][1]["from"]["data"]["url"] == "http://foo.com/bar.json" -@test Vega.getparams(@vlplot("point", transform=[{lookup="foo", from={data={url=URI("http://foo.com/bar.json")}, key="bar"}}]))["transform"][1]["from"]["data"]["url"] == "http://foo.com/bar.json" +@test Vega.getparams(@vlplot("point", transform = [{lookup = "foo", from = {data = p"/foo/bar", key = "bar"}}]))["transform"][1]["from"]["data"]["url"] == (Sys.iswindows() ? "file://foo/bar" : "file:///foo/bar") +@test Vega.getparams(@vlplot("point", transform = [{lookup = "foo", from = {data = {url = p"/foo/bar"}, key = "bar"}}]))["transform"][1]["from"]["data"]["url"] == (Sys.iswindows() ? "file://foo/bar" : "file:///foo/bar") +@test Vega.getparams(@vlplot("point", transform = [{lookup = "foo", from = {data = URI("http://foo.com/bar.json"), key = "bar"}}]))["transform"][1]["from"]["data"]["url"] == "http://foo.com/bar.json" +@test Vega.getparams(@vlplot("point", transform = [{lookup = "foo", from = {data = {url = URI("http://foo.com/bar.json")}, key = "bar"}}]))["transform"][1]["from"]["data"]["url"] == "http://foo.com/bar.json" -@test JSON.parse(sprint(VegaLite.our_json_print, @vlplot("point", transform=[{lookup="foo", from={data=DataFrame(a=[1]), key="bar"}}])))["transform"][1]["from"]["data"]["values"][1]["a"] == 1 +@test JSON.parse(sprint(VegaLite.our_json_print, @vlplot("point", transform = [{lookup = "foo", from = {data = DataFrame(a = [1]), key = "bar"}}])))["transform"][1]["from"]["data"]["values"][1]["a"] == 1 @test [@vlplot("point") @vlplot("circle")] == (vl""" { @@ -61,7 +61,7 @@ using Test } """) -@test @vlplot("point", x={"foo:q"}) == (vl""" +@test @vlplot("point", x = {"foo:q"}) == (vl""" { "mark": "point", "encoding": { @@ -73,19 +73,19 @@ using Test } """) -@test (@vlplot(description="foo") + @vlplot(:point) + @vlplot(:circle)) == @vlplot(description="foo", layer=[{mark=:point},{mark=:circle}]) +@test (@vlplot(description = "foo") + @vlplot(:point) + @vlplot(:circle)) == @vlplot(description = "foo", layer = [{mark = :point},{mark = :circle}]) -@test (@vlplot(facet={row={field=:foo, type=:bar}}) + @vlplot(:point)) == @vlplot(facet={row={field=:foo, type=:bar}}, spec={mark=:point}) +@test (@vlplot(facet = {row = {field = :foo, type = :bar}}) + @vlplot(:point)) == @vlplot(facet = {row = {field = :foo, type = :bar}}, spec = {mark = :point}) -@test (@vlplot(repeat={column=[:foo, :bar]}) + @vlplot(:point)) == @vlplot(repeat={column=[:foo, :bar]}, spec={mark=:point}) +@test (@vlplot(repeat = {column = [:foo, :bar]}) + @vlplot(:point)) == @vlplot(repeat = {column = [:foo, :bar]}, spec = {mark = :point}) -@test (@vlplot(description="foo") + [@vlplot(:point) @vlplot(:circle)]) == @vlplot(description="foo", hconcat=[{mark=:point},{mark=:circle}]) +@test (@vlplot(description = "foo") + [@vlplot(:point) @vlplot(:circle)]) == @vlplot(description = "foo", hconcat = [{mark = :point},{mark = :circle}]) -@test (@vlplot(description="foo") + [@vlplot(:point); @vlplot(:circle)]) == @vlplot(description="foo", vconcat=[{mark=:point},{mark=:circle}]) +@test (@vlplot(description = "foo") + [@vlplot(:point); @vlplot(:circle)]) == @vlplot(description = "foo", vconcat = [{mark = :point},{mark = :circle}]) -@test (@vlplot(:point, x=:a)(DataFrame(a=[1])) == @vlplot(:point, data=DataFrame(a=[1]), x=:a)) +@test (@vlplot(:point, x = :a)(DataFrame(a=[1])) == @vlplot(:point, data = DataFrame(a=[1]), x = :a)) -@test @vlplot("point", wrap=:x) == vl""" +@test @vlplot("point", wrap = :x) == vl""" { "mark": "point", "encoding": { @@ -94,7 +94,7 @@ using Test } """ -@test @vlplot("point", enc={x=:foo}, wrap=:x) == vl""" +@test @vlplot("point", enc = {x = :foo}, wrap = :x) == vl""" { "mark": "point", "encoding": {