Skip to content

Commit

Permalink
Merge pull request #168 from sglyon/violins
Browse files Browse the repository at this point in the history
Violins
  • Loading branch information
sglyon authored Jan 20, 2018
2 parents bcb59b7 + 2ed343f commit f14134e
Show file tree
Hide file tree
Showing 24 changed files with 785 additions and 232 deletions.
9 changes: 6 additions & 3 deletions deps/make_schema_docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
function SchemaAttribute(d::Associative)
role = pop!(d, :role, "")

if role == "object" || any(_->isa(_, Associative), values(d))
if role == "object" || any(_x->isa(_x, Associative), values(d))
# description and valtype ire empty, but children is not
_desc = pop!(d, :description, "")
desc = isempty(_desc) ? Nullable{MD}() : Nullable{MD}(MD(_desc))
Expand Down Expand Up @@ -190,8 +190,11 @@ function doc_html!(buf::IO, s::Schema)
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script>
window.jQuery = window.\$;
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
<body>""")

Expand Down
13 changes: 4 additions & 9 deletions docs/build_example_docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ This file takes the code from each file in the examples folder and
creates a markdown file of the same name as the julia file then
puts each example from the julia file into a code block and adds
a short html div below with the interactive output.
Notes:
* Assumes that the plot to be placed in html file is named `p`
*
=#
using PlotlyJS
using Distributions, Quandl, RDatasets # used in examples

doc_style = Style(Style(layout=Layout(margin=attr(t=60, b=60, l=50, r=50))))
doc_style = Style(layout=Layout(margin=attr(t=60, b=60, l=50, r=50)))

# Read all file names in
this_dir = dirname(@__FILE__)
Expand All @@ -38,7 +33,7 @@ use_style!(doc_style)
# Walk through each example in a file and get the markdown from `single_example`
function single_file(filename::String)
# Open a file to write to
outfile = open(joinpath(this_dir, "examples", filename[1:end-3]*".md"), "w")
open(joinpath(this_dir, "examples", filename[1:end-3]*".md"), "w") do outfile

# Read lines from a files
fulltext = open(readstring, joinpath(this_dir, "..", "examples", filename), "r")
Expand Down Expand Up @@ -70,9 +65,9 @@ function single_file(filename::String)
println(outfile, "```julia\n$func_block\n$(fun_name)()\n```\n\n\n$html_block\n\n")
l = end_l
end
close(outfile)
end # do outfile

return nothing
end

map(single_file, all_julia_files)
main() = map(single_file, all_julia_files)
28 changes: 14 additions & 14 deletions docs/examples/3d.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/examples/area.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ area1()
```


<div id="04571644-da2d-41e5-b2b5-c8dad0ed1cf6" class="plotly-graph-div"></div>
<div id="a122cf77-d769-43c6-853c-25629ec164f9" class="plotly-graph-div"></div>

<script>
window.PLOTLYENV=window.PLOTLYENV || {};
window.PLOTLYENV.BASE_URL="https://plot.ly";
Plotly.newPlot('04571644-da2d-41e5-b2b5-c8dad0ed1cf6', [{"y":[0,2,3,5],"type":"scatter","fill":"tozeroy","x":[1,2,3,4]},{"y":[3,5,1,7],"type":"scatter","fill":"tonexty","x":[1,2,3,4]}],
Plotly.newPlot('a122cf77-d769-43c6-853c-25629ec164f9', [{"y":[0,2,3,5],"type":"scatter","fill":"tozeroy","x":[1,2,3,4]},{"y":[3,5,1,7],"type":"scatter","fill":"tonexty","x":[1,2,3,4]}],
{"margin":{"l":50,"b":60,"r":50,"t":60}}, {showLink: false});

</script>
Expand Down Expand Up @@ -42,12 +42,12 @@ area2()
```


<div id="894e0454-cad0-4732-a909-252eaf8ba257" class="plotly-graph-div"></div>
<div id="35b225a5-4700-4cae-a0f4-96869cfc0c3e" class="plotly-graph-div"></div>

<script>
window.PLOTLYENV=window.PLOTLYENV || {};
window.PLOTLYENV.BASE_URL="https://plot.ly";
Plotly.newPlot('894e0454-cad0-4732-a909-252eaf8ba257', [{"y":[2,1,4],"type":"scatter","fill":"tozeroy","x":[1,2,3]},{"y":[3,2,6],"type":"scatter","fill":"tonexty","x":[1,2,3]},{"y":[6,2,8],"type":"scatter","fill":"tonexty","x":[1,2,3]}],
Plotly.newPlot('35b225a5-4700-4cae-a0f4-96869cfc0c3e', [{"y":[2,1,4],"type":"scatter","fill":"tozeroy","x":[1,2,3]},{"y":[3,2,6],"type":"scatter","fill":"tonexty","x":[1,2,3]},{"y":[6,2,8],"type":"scatter","fill":"tonexty","x":[1,2,3]}],
{"margin":{"l":50,"b":60,"r":50,"t":60},"title":"stacked and filled line chart"}, {showLink: false});

</script>
Expand All @@ -65,12 +65,12 @@ area3()
```


<div id="95d6a35a-97c5-4657-8e19-6f551e14f0d0" class="plotly-graph-div"></div>
<div id="c858afa7-b75b-44c9-9726-538af270b2c1" class="plotly-graph-div"></div>

<script>
window.PLOTLYENV=window.PLOTLYENV || {};
window.PLOTLYENV.BASE_URL="https://plot.ly";
Plotly.newPlot('95d6a35a-97c5-4657-8e19-6f551e14f0d0', [{"mode":"none","y":[0,2,3,5],"type":"scatter","fill":"tozeroy","x":[1,2,3,4]},{"mode":"none","y":[3,5,1,7],"type":"scatter","fill":"tonexty","x":[1,2,3,4]}],
Plotly.newPlot('c858afa7-b75b-44c9-9726-538af270b2c1', [{"mode":"none","y":[0,2,3,5],"type":"scatter","fill":"tozeroy","x":[1,2,3,4]},{"mode":"none","y":[3,5,1,7],"type":"scatter","fill":"tonexty","x":[1,2,3,4]}],
{"margin":{"l":50,"b":60,"r":50,"t":60},"title":"Overlaid Chart Without Boundary Lines"}, {showLink: false});

</script>
Expand Down
Loading

0 comments on commit f14134e

Please sign in to comment.