Skip to content

Commit

Permalink
make Gadfly "relocatable" by not loading files at runtime (#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Apr 1, 2021
1 parent 6123752 commit ac19807
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
9 changes: 2 additions & 7 deletions src/Gadfly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ export Plot, Layer, Theme, Col, Row, Scale, Coord, Geom, Guide, Stat, Shape, ren
export SVGJS, SVG, PGF, PNG, PS, PDF, draw, inch, mm, cm, px, pt, color, @colorant_str, vstack, hstack, title, gridstack


function link_terminalextensions()
@debug "Loading TerminalExtensions support into Gadfly"
include("terminalextensions.jl")
end

function __init__()
# Define an XML namespace for custom attributes
Compose.xmlns["gadfly"] = "http://www.gadflyjl.org/ns"
Expand All @@ -63,8 +58,8 @@ function __init__()

insert!(Base.Multimedia.displays, findlast(x->(x isa TextDisplay || x isa REPL.REPLDisplay), Base.Multimedia.displays)+1, GadflyDisplay())

@require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" link_dataframes()
@require TerminalExtensions="d3a6a179-465e-5219-bd3e-0137f7fd17c7" link_terminalextensions()
@require DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" include("dataframes.jl")
@require TerminalExtensions="d3a6a179-465e-5219-bd3e-0137f7fd17c7" include("terminalextensions.jl")
end


Expand Down
2 changes: 2 additions & 0 deletions src/dataframes.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@debug "Loading DataFrames support into Gadfly"

using .DataFrames

function meltdata(U::AbstractDataFrame, colgroups::Vector{Col.GroupedColumn})
Expand Down
4 changes: 0 additions & 4 deletions src/mapping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,3 @@ function evalmapping!(mapping::Dict, data_source, data::Data)
return _evalmapping!(mapping, transformed_data_source, data)
end

function link_dataframes()
@debug "Loading DataFrames support into Gadfly"
include("dataframes.jl")
end
2 changes: 2 additions & 0 deletions src/terminalextensions.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@debug "Loading TerminalExtensions support into Gadfly"

using .TerminalExtensions

function putatend(idisplay, display::iTerm2.InlineDisplay)
Expand Down

0 comments on commit ac19807

Please sign in to comment.