Skip to content

Commit

Permalink
Merge pull request #14 from queryverse/change-data-delete
Browse files Browse the repository at this point in the history
Rework how data is not included in savespec
  • Loading branch information
davidanthoff authored Aug 3, 2020
2 parents 52e0737 + d624d96 commit c15a7cd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/rendering/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@ An `IO` object can also be passed.
- `indent::Union{Nothing,Integer}`: Pretty-print JSON output with given
indentation if `indent` is an integer.
"""
function savespec(io::IO, v::AbstractVegaSpec; include_data=false, indent=nothing)
function savespec(io::IO, v::VGSpec; include_data=false, indent=nothing)
output_dict = copy(getparams(v))
if !include_data
delete!(output_dict, "data")
if haskey(output_dict, "data")
for def in output_dict["data"]
if haskey(def, "values")
delete!(def, "values")
end
end
end
end
if indent === nothing
JSON.print(io, output_dict)
Expand Down

0 comments on commit c15a7cd

Please sign in to comment.