#328 Faster startup

Open Pseudo commit used to compare (6b89f19...f3daf2e)

Flags

Flags have been temporarily removed from this view while the flagging feature is refactored for better performance and user experience.

You can still use flags when viewing individual files. Flag-level thresholds will also remain on pull and merge requests in your repository provider.

More information can be found in our documentation.


@@ -1,5 +1,9 @@
Loading
1 1
module VegaLite
2 2
3 +
if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@optlevel"))
4 +
    @eval Base.Experimental.@optlevel 0
5 +
end
6 +
3 7
using JSON, NodeJS # 6s
4 8
import IteratorInterfaceExtensions # 1s
5 9
import TableTraits # 0
@@ -17,6 +21,7 @@
Loading
17 21
using DataStructures
18 22
import TableTraitsUtils
19 23
using Vega
24 +
import Base64
20 25
21 26
export renderer, actionlinks
22 27
export @vl_str, @vlplot, vlplot, @vlfrag, vlfrag

@@ -13,3 +13,17 @@
Loading
13 13
function fileio_save(stream::FileIO.Stream{FileIO.format"vegalite"}, data::VLSpec; include_data=true, kwargs...)
14 14
    Vega.savespec(stream.io, data; include_data=include_data, kwargs...)
15 15
end
16 +
17 +
function fileio_save(file::FileIO.File{FileIO.format"vega"}, data::VLSpec; include_data=true, kwargs...)
18 +
    s = Base64.stringmime(MIME("application/vnd.vega.v5+json"), data)
19 +
    parsed = JSON.parse(s)
20 +
    vgspec = Vega.VGSpec(parsed)
21 +
    Vega.savespec(file.filename, vgspec; include_data=include_data, kwargs...)
22 +
end
23 +
24 +
function fileio_save(stream::FileIO.Stream{FileIO.format"vega"}, data::VLSpec; include_data=true, kwargs...)
25 +
    s = Base64.stringmime(MIME("application/vnd.vega.v5+json"), data)
26 +
    parsed = JSON.parse(s)
27 +
    vgspec = Vega.VGSpec(parsed)
28 +
    Vega.savespec(stream.io, vgspec; include_data=include_data, kwargs...)
29 +
end

@@ -70,3 +70,15 @@
Loading
70 70
function eps(filename::AbstractString, v::VLSpec)
71 71
    savefig(filename, "application/eps", v)
72 72
end
73 +
74 +
function Vega.savespec(io::IO, v::VLSpec; include_data=false, indent=nothing)
75 +
    output_dict = copy(Vega.getparams(v))
76 +
    if !include_data
77 +
        delete!(output_dict, "data")
78 +
    end
79 +
    if indent === nothing
80 +
        JSON.print(io, output_dict)
81 +
    else
82 +
        JSON.print(io, output_dict, indent)
83 +
    end
84 +
end

Learn more Showing 7 files with coverage changes found.

Changes in src/rendering/show.jl
+6
Loading file...
Changes in src/dsl_vlplot_function/dsl_vlplot_function.jl
+3
Loading file...
Changes in src/vlspec.jl
+1
Loading file...
Changes in src/rendering/render.jl
+4
Loading file...
Changes in src/dsl_vlplot_function/shorthandparser.jl
+3
Loading file...
Changes in src/rendering/to_julia.jl
+1
Loading file...
Changes in src/experimental.jl
+1
Loading file...
Files Coverage
src -4.34% 72.87%
Project Totals (12 files) 72.87%
Loading