Skip to content

Commit

Permalink
closes #967
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed Jul 11, 2022
1 parent be1f73e commit 29d9a6d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.10.75"
version = "0.10.76"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
25 changes: 17 additions & 8 deletions src/manager/extras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,20 @@ end
Convenience function to plot a Plotly. User need to add a Javascript function `PlotlyJS_json`.
"""
html_plotly(src::AbstractString ; id="fdp"*Random.randstring('a':'z', 3),
style="") = """
<div id="$id" style="$style"></div>
<script>
graphDiv = document.getElementById("$id");
plotlyPromise = PlotlyJS_json(graphDiv, '$src');
</script>
"""
function html_plotly(
src::AbstractString;
id::String = "fdp"*Random.randstring('a':'z', 3),
style::String = "")

pp = globvar(:prepath)::String
pp = ifelse(isempty(pp), pp, "/$pp")
pp = ifelse(FD_ENV[:FINAL_PASS]::Bool, pp, "")

return """
<div id="$id" style="$style"></div>
<script>
graphDiv = document.getElementById("$id");
plotlyPromise = PlotlyJS_json(graphDiv, '$pp$src');
</script>
"""
end

0 comments on commit 29d9a6d

Please sign in to comment.