-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate to weakdeps * Update ext/DataFramesExt.jl Co-authored-by: Thomas Christensen <[email protected]> * fix loading issues * add weakdeps to extras also --------- Co-authored-by: Thomas Christensen <[email protected]> Co-authored-by: Simon Christ <[email protected]>
- Loading branch information
1 parent
c68b3b9
commit 457befe
Showing
6 changed files
with
85 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module CSVExt | ||
|
||
using PlotlyJS | ||
isdefined(Base, :get_extension) ? (using CSV) : (using ..CSV) | ||
|
||
function PlotlyJS.dataset(::Type{CSV.File}, name::String) | ||
ds_path = PlotlyJS.check_dataset_exists(name) | ||
if !endswith(ds_path, "csv") | ||
error("Can only construct CSV.File from a csv data source") | ||
end | ||
CSV.File(ds_path) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module DataFramesExt | ||
|
||
using PlotlyJS | ||
isdefined(Base, :get_extension) ? (using DataFrames) : (using ..DataFrames) | ||
isdefined(Base, :get_extension) ? (using CSV) : (using ..CSV) | ||
|
||
|
||
PlotlyJS.dataset(::Type{DataFrames.DataFrame}, name::String) = DataFrames.DataFrame(PlotlyJS.dataset(CSV.File, name)) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module IJuliaExt | ||
|
||
using PlotlyJS | ||
isdefined(Base, :get_extension) ? (using IJulia) : (using ..IJulia) | ||
isdefined(Base, :get_extension) ? (using JSON) : (using ..JSON) | ||
isdefined(Base, :get_extension) ? (using PlotlyBase) : (using ..PlotlyBase) | ||
|
||
|
||
function IJulia.display_dict(p::PlotlyJS.SyncPlot) | ||
Dict( | ||
"application/vnd.plotly.v1+json" => JSON.lower(p), | ||
"text/plain" => sprint(show, "text/plain", p), | ||
"text/html" => let | ||
buf = IOBuffer() | ||
show(buf, MIME("text/html"), p) | ||
String(resize!(buf.data, buf.size)) | ||
end | ||
) | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module JSON3Ext | ||
|
||
using PlotlyJS | ||
isdefined(Base, :get_extension) ? (using JSON3) : (using ..JSON3) | ||
|
||
JSON3.write(io::IO, p::PlotlyJS.SyncPlot) = JSON3.write(io, p.plot) | ||
JSON3.write(p::PlotlyJS.SyncPlot) = JSON3.write(p.plot) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters