Skip to content

Commit f40f35c

Browse files
authored
Format files using DocumentFormat
1 parent 3841d3d commit f40f35c

File tree

19 files changed

+259
-249
lines changed

19 files changed

+259
-249
lines changed

docs/make.jl

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,52 @@ using Documenter, VegaLite, UUIDs
33
function Base.show(io::IO, m::MIME"text/html", v::VegaLite.VLSpec)
44
divid = string("vl", replace(string(uuid4()), "-" => ""))
55
print(io, "<div id='$divid' style=\"width:100%;height:100%;\"></div>")
6-
print(io, "<script type='text/javascript'>requirejs.config({paths:{'vg-embed': 'https://cdn.jsdelivr.net/npm/vega-embed@6?noext','vega-lib': 'https://cdn.jsdelivr.net/npm/vega-lib?noext','vega-lite': 'https://cdn.jsdelivr.net/npm/vega-lite@4?noext','vega': 'https://cdn.jsdelivr.net/npm/vega@5?noext'}}); require(['vg-embed'],function(vegaEmbed){vegaEmbed('#$divid',")
6+
print(io, "<script type='text/javascript'>requirejs.config({paths:{'vg-embed': 'https://cdn.jsdelivr.net/npm/vega-embed@6?noext','vega-lib': 'https://cdn.jsdelivr.net/npm/vega-lib?noext','vega-lite': 'https://cdn.jsdelivr.net/npm/vega-lite@4?noext','vega': 'https://cdn.jsdelivr.net/npm/vega@5?noext'}}); require(['vg-embed'],function(vegaEmbed){vegaEmbed('#$divid',")
77
VegaLite.our_json_print(io, v)
88
print(io, ",{mode:'vega-lite'}).catch(console.warn);})</script>")
99
end
1010

1111
makedocs(
12-
modules=[VegaLite],
13-
sitename="VegaLite.jl",
14-
pages=[
15-
"Home" => "index.md",
16-
"Getting Started" => Any[
17-
"Installation" => "gettingstarted/installation.md",
18-
"Tutorial" => "gettingstarted/tutorial.md"
19-
],
20-
"User Guide" => Any[
21-
"Vega-lite specifications" => "userguide/vlspec.md",
22-
"The @vlplot command" => "userguide/vlplotmacro.md",
23-
"Data sources" => "userguide/data.md"
24-
],
25-
"Examples" => Any[
26-
"Single-View Plots" => Any[
27-
"Bar Charts" => "examples/examples_barcharts.md",
28-
"Histograms, Density Plots, and Dot Plots" => "examples/examples_histograms.md",
29-
"Scatter & Strip Plots" => "examples/examples_scatter_strip_plots.md",
30-
"Line Charts" => "examples/examples_line_charts.md",
31-
"Area Charts & Streamgraphs" => "examples/examples_area_Charts_streamgraphs.md",
32-
"Table-based Plots" => "examples/examples_table_based_plots.md",
33-
"Circular Plots" => "examples/examples_circular_plots.md",
34-
"Advanced Calculations" => "examples/examples_advancedcalculations.md"
12+
modules=[VegaLite],
13+
sitename="VegaLite.jl",
14+
pages=[
15+
"Home" => "index.md",
16+
"Getting Started" => Any[
17+
"Installation"=>"gettingstarted/installation.md",
18+
"Tutorial"=>"gettingstarted/tutorial.md"
3519
],
36-
"Composite Mark" => Any[
37-
"Error Bars & Error Bands" => "examples/examples_error_bars_bands.md",
38-
"Box Plots" => "examples/examples_box_plots.md"
20+
"User Guide" => Any[
21+
"Vega-lite specifications"=>"userguide/vlspec.md",
22+
"The @vlplot command"=>"userguide/vlplotmacro.md",
23+
"Data sources"=>"userguide/data.md"
3924
],
40-
"Multi-View Displays" => Any[
41-
"Faceting (Trellis Plot / Small Multiples)" => "examples/examples_faceting.md",
42-
"Repeat & Concatenation" => "examples/examples_repeat_concatenation.md"
25+
"Examples" => Any[
26+
"Single-View Plots"=>Any[
27+
"Bar Charts"=>"examples/examples_barcharts.md",
28+
"Histograms, Density Plots, and Dot Plots"=>"examples/examples_histograms.md",
29+
"Scatter & Strip Plots"=>"examples/examples_scatter_strip_plots.md",
30+
"Line Charts"=>"examples/examples_line_charts.md",
31+
"Area Charts & Streamgraphs"=>"examples/examples_area_Charts_streamgraphs.md",
32+
"Table-based Plots"=>"examples/examples_table_based_plots.md",
33+
"Circular Plots"=>"examples/examples_circular_plots.md",
34+
"Advanced Calculations"=>"examples/examples_advancedcalculations.md"
35+
],
36+
"Composite Mark"=>Any[
37+
"Error Bars & Error Bands"=>"examples/examples_error_bars_bands.md",
38+
"Box Plots"=>"examples/examples_box_plots.md"
39+
],
40+
"Multi-View Displays"=>Any[
41+
"Faceting (Trellis Plot / Small Multiples)"=>"examples/examples_faceting.md",
42+
"Repeat & Concatenation"=>"examples/examples_repeat_concatenation.md"
43+
],
44+
"Maps (Geographic Displays)"=>"examples/examples_maps.md"
4345
],
44-
"Maps (Geographic Displays)" => "examples/examples_maps.md"
45-
],
46-
"Reference Manual" => [
47-
"Global settings" => "referencemanual/global.md",
48-
"Outputs" => "referencemanual/output.md",
49-
"Performance tips" => "referencemanual/performance.md",
46+
"Reference Manual" => [
47+
"Global settings" => "referencemanual/global.md",
48+
"Outputs" => "referencemanual/output.md",
49+
"Performance tips" => "referencemanual/performance.md",
5050
]
51-
]
51+
]
5252
)
5353

5454
deploydocs(

src/VegaLite.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export deletedata, deletedata!
3232
vegalite_app_path(args...) = joinpath(artifact"vegalite_app", args...)
3333
const vegaliate_app_includes_canvas = Ref{Bool}()
3434

35-
const vlschema = Ref{Dict{String, Any}}()
35+
const vlschema = Ref{Dict{String,Any}}()
3636

3737
function __init__()
3838
vegaliate_app_includes_canvas[] = ispath(vegalite_app_path("node_modules", "canvas"))

src/dsl_vlplot_function/dsl_vlplot_function.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function fix_shortcut_level_data(spec_frag)
9696
if TableTraits.isiterabletable(spec_frag)
9797
it = IteratorInterfaceExtensions.getiterator(spec_frag)
9898
return VLFrag([], OrderedDict{String,Any}("values" => Vega.DataValuesNode(it)))
99-
else
99+
else
100100
return spec_frag
101101
end
102102
end
@@ -105,7 +105,7 @@ function fix_shortcut_level_spec(spec_frag::VLFrag)
105105
spec = copy(spec_frag.named)
106106

107107
if length(spec_frag.positional) > 0
108-
spec["mark"] = spec_frag.positional[1]
108+
spec["mark"] = spec_frag.positional[1]
109109
elseif length(spec_frag.positional) > 3
110110
error("More than three positional element specified at the spec level.")
111111
end
@@ -119,7 +119,7 @@ function fix_shortcut_level_spec(spec_frag::VLFrag)
119119
encodings_to_be_moved = filter(
120120
i -> i != "facet",
121121
collect(keys(vlschema[]["definitions"]["FacetedEncoding"]["properties"])),
122-
)
122+
)
123123
for k in collect(keys(spec))
124124
if string(k) in encodings_to_be_moved
125125
if !haskey(spec, "encoding")
@@ -163,7 +163,7 @@ function fix_shortcut_level_spec(spec_frag::VLFrag)
163163
inline_unnamed_data = Pair{Symbol,AbstractVector}[]
164164

165165
if haskey(spec, "encoding")
166-
if spec["encoding"] isa VLFrag
166+
if spec["encoding"] isa VLFrag
167167
if !isempty(spec["encoding"].positional)
168168
error("Can't have positional arguments inside the encoding element.")
169169
else
@@ -226,12 +226,12 @@ function convert_frag_tree_to_dict(spec::VLFrag)
226226
return "type" => p[2]
227227
else
228228
return p
229-
end
229+
end
230230
end
231231

232232
return spec_as_dict2
233233
end
234234

235-
function vlplot(args...;kwargs...)
236-
return VLSpec(convert_frag_tree_to_dict(fix_shortcut_level_spec(vlfrag(args...;kwargs...))))
235+
function vlplot(args...; kwargs...)
236+
return VLSpec(convert_frag_tree_to_dict(fix_shortcut_level_spec(vlfrag(args...; kwargs...))))
237237
end

src/dsl_vlplot_function/shorthandparser.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,26 @@ function parse_shortcut(s::AbstractString)
6969
if length(tokens) > 2 && tokens[3] == ")"
7070
if length(tokens) == 3
7171
decoded_func = decode_func(tokens[1])
72-
return [decoded_func,"type" => decoded_func[1] == "timeUnit" ? "temporal" : "quantitative"]
72+
return [decoded_func, "type" => decoded_func[1] == "timeUnit" ? "temporal" : "quantitative"]
7373
elseif length(tokens) == 5 && tokens[4] == ":"
74-
return [decode_func(tokens[1]),decode_typ(tokens[5])]
74+
return [decode_func(tokens[1]), decode_typ(tokens[5])]
7575
else
7676
throw(ArgumentError("invalid shortcut string"))
7777
end
7878
elseif length(tokens) > 3 && tokens[4] == ")"
7979
if length(tokens) == 4
8080
decoded_func = decode_func(tokens[1])
81-
return [decoded_func,"field" => tokens[3],"type" => decoded_func[1] == "timeUnit" ? "temporal" : "quantitative"]
81+
return [decoded_func, "field" => tokens[3], "type" => decoded_func[1] == "timeUnit" ? "temporal" : "quantitative"]
8282
elseif length(tokens) == 6 && tokens[5] == ":"
83-
return [decode_func(tokens[1]),"field" => tokens[3],decode_typ(tokens[6])]
83+
return [decode_func(tokens[1]), "field" => tokens[3], decode_typ(tokens[6])]
8484
else
8585
throw(ArgumentError("invalid shortcut string"))
8686
end
8787
else
8888
throw(ArgumentError("Invalid shortcut string"))
8989
end
9090
elseif length(tokens) == 3 && tokens[2] == ":"
91-
return ["field" => tokens[1],decode_typ(tokens[3])]
91+
return ["field" => tokens[1], decode_typ(tokens[3])]
9292
else
9393
throw(ArgumentError("Invalid shortcut string"))
9494
end

src/dsl_vlplot_macro/dsl_vlplot_macro.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
macro vlplot(ex...)
22
new_ex = Vega.convert_curly_style(ex, VLFrag)
33

4-
return :( VegaLite.VLSpec(convert_frag_tree_to_dict(fix_shortcut_level_spec($new_ex))) )
4+
return :(VegaLite.VLSpec(convert_frag_tree_to_dict(fix_shortcut_level_spec($new_ex))))
55
end
66

77
macro vlfrag(ex...)

src/rendering/fileio.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ function fileio_save(stream::FileIO.Stream{FileIO.format"vega"}, data::VLSpec; i
2626
parsed = JSON.parse(s)
2727
vgspec = Vega.VGSpec(parsed)
2828
Vega.savespec(stream.io, vgspec; include_data=include_data, kwargs...)
29-
end
29+
end

src/rendering/io.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ function savefig(filename::AbstractString, v::VLSpec)
2020
mime = "image/png"
2121
elseif file_ext == ".eps"
2222
mime = "application/eps"
23-
# elseif file_ext == ".ps"
24-
# mime = "application/postscript"
23+
# elseif file_ext == ".ps"
24+
# mime = "application/postscript"
2525
else
2626
throw(ArgumentError("Unknown file type."))
2727
end

0 commit comments

Comments
 (0)