From 2ed343fbda9dfa25c921c01d322241133f2a4df9 Mon Sep 17 00:00:00 2001 From: Spencer Lyon Date: Fri, 19 Jan 2018 20:30:38 -0500 Subject: [PATCH] DOC: update all docs --- deps/make_schema_docs.jl | 7 +- docs/build_example_docs.jl | 13 +- docs/examples/3d.md | 28 ++-- docs/examples/area.md | 12 +- docs/examples/bar.md | 44 +++---- docs/examples/box_plots.md | 40 +++--- docs/examples/contour.md | 56 ++++---- docs/examples/finance.md | 38 +++--- docs/examples/heatmaps.md | 8 +- docs/examples/histograms.md | 4 +- docs/examples/line_scatter.md | 40 +++--- docs/examples/maps.md | 8 +- docs/examples/shapes.md | 56 ++++---- docs/examples/subplots.md | 12 +- docs/examples/tables.md | 164 ++++++++++++++++++++++++ docs/examples/ternary.md | 8 +- docs/examples/time_series.md | 4 +- docs/examples/violin.md | 234 ++++++++++++++++++++++++++++++++++ examples/finance.jl | 18 ++- examples/tables.jl | 17 ++- mkdocs.yml | 10 +- 21 files changed, 609 insertions(+), 212 deletions(-) create mode 100644 docs/examples/tables.md create mode 100644 docs/examples/violin.md diff --git a/deps/make_schema_docs.jl b/deps/make_schema_docs.jl index 0a54a836..498e444f 100644 --- a/deps/make_schema_docs.jl +++ b/deps/make_schema_docs.jl @@ -190,8 +190,11 @@ function doc_html!(buf::IO, s::Schema) - - + + + """) diff --git a/docs/build_example_docs.jl b/docs/build_example_docs.jl index c07b978f..21b06289 100644 --- a/docs/build_example_docs.jl +++ b/docs/build_example_docs.jl @@ -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__) @@ -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") @@ -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) diff --git a/docs/examples/3d.md b/docs/examples/3d.md index a3525f80..d7eba3d0 100644 --- a/docs/examples/3d.md +++ b/docs/examples/3d.md @@ -22,12 +22,12 @@ random_line() ``` -
+
@@ -132,12 +132,12 @@ topo_surface() ``` -
+
@@ -172,12 +172,12 @@ multiple_surface() ``` -
+
@@ -231,12 +231,12 @@ clustering_alpha_shapes() ``` -
+
@@ -269,12 +269,12 @@ scatter_3d() ``` -
+
@@ -307,12 +307,12 @@ trisurf() ``` -
+
@@ -341,12 +341,12 @@ meshcube() ``` -
+
diff --git a/docs/examples/area.md b/docs/examples/area.md index 2e278637..02a21f5f 100644 --- a/docs/examples/area.md +++ b/docs/examples/area.md @@ -8,12 +8,12 @@ area1() ``` -
+
@@ -42,12 +42,12 @@ area2() ``` -
+
@@ -65,12 +65,12 @@ area3() ``` -
+
diff --git a/docs/examples/bar.md b/docs/examples/bar.md index e8a79ab8..fc0577fb 100644 --- a/docs/examples/bar.md +++ b/docs/examples/bar.md @@ -8,12 +8,12 @@ bar1() ``` -
+
@@ -36,12 +36,12 @@ bar2() ``` -
+
@@ -64,12 +64,12 @@ bar3() ``` -
+
@@ -92,12 +92,12 @@ bar4() ``` -
+
@@ -135,12 +135,12 @@ bar5() ``` -
+
@@ -170,12 +170,12 @@ bar6() ``` -
+
@@ -198,12 +198,12 @@ bar7() ``` -
+
@@ -230,12 +230,12 @@ bar8() ``` -
+
@@ -276,12 +276,12 @@ bar9() ``` -
+
@@ -348,12 +348,12 @@ bar10() ``` -
+
@@ -385,12 +385,12 @@ bar11() ``` -
+
diff --git a/docs/examples/box_plots.md b/docs/examples/box_plots.md index 62448408..bdedb936 100644 --- a/docs/examples/box_plots.md +++ b/docs/examples/box_plots.md @@ -11,12 +11,12 @@ box1() ``` -
+
@@ -35,12 +35,12 @@ box2() ``` -
+
@@ -62,12 +62,12 @@ box3() ``` -
+
@@ -99,12 +99,12 @@ box4() ``` -
+
@@ -150,12 +150,12 @@ box5() ``` -
+
@@ -184,12 +184,12 @@ box6() ``` -
+
@@ -228,12 +228,12 @@ box7() ``` -
+
@@ -256,12 +256,12 @@ box8() ``` -
+
@@ -323,12 +323,12 @@ box9() ``` -
+
@@ -361,12 +361,12 @@ box10() ``` -
+
diff --git a/docs/examples/contour.md b/docs/examples/contour.md index ad465bf4..00b17a33 100644 --- a/docs/examples/contour.md +++ b/docs/examples/contour.md @@ -13,12 +13,12 @@ contour1() ``` -
+
@@ -41,12 +41,12 @@ contour2() ``` -
+
@@ -71,12 +71,12 @@ contour3() ``` -
+
@@ -99,12 +99,12 @@ contour4() ``` -
+
@@ -130,12 +130,12 @@ contour5() ``` -
+
@@ -159,12 +159,12 @@ contour6() ``` -
+
@@ -196,12 +196,12 @@ contour7() ``` -
+
@@ -231,12 +231,12 @@ contour8() ``` -
+
@@ -259,12 +259,12 @@ contour9() ``` -
+
@@ -287,12 +287,12 @@ contour10() ``` -
+
@@ -322,12 +322,12 @@ contour11() ``` -
+
@@ -353,12 +353,12 @@ contour12() ``` -
+
@@ -384,12 +384,12 @@ contour13() ``` -
+
@@ -416,12 +416,12 @@ contour14() ``` -
+
diff --git a/docs/examples/finance.md b/docs/examples/finance.md index bc6dc518..5b87800f 100644 --- a/docs/examples/finance.md +++ b/docs/examples/finance.md @@ -10,12 +10,12 @@ ohlc1() ``` -
+
@@ -24,16 +24,15 @@ ohlc1() ```julia function ohlc2() - @eval using Quandl + # uses Quandl.jl function get_ohlc(ticker; kwargs...) df = quandlget("WIKI/$(ticker)", format="DataFrame") - ohlc(open=df[:Open], high=df[:High], low=df[:Low], close=df[:Close]; kwargs...) + ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end - p1 = plot(get_ohlc("AAPL", name="Apple")) - p2 = plot(get_ohlc("GOOG", name="Google")) - + p1 = plot(get_ohlc("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_ohlc("GOOG", name="Google"), Layout(title="Google")) [p1 p2] end @@ -41,13 +40,13 @@ ohlc2() ``` -
+
@@ -65,12 +64,12 @@ candlestick1() ``` -
+
@@ -79,16 +78,15 @@ candlestick1() ```julia function candlestick2() - @eval using Quandl + # uses Quandl.jl function get_candlestick(ticker; kwargs...) df = quandlget("WIKI/$(ticker)", format="DataFrame") - candlestick(open=df[:Open], high=df[:High], low=df[:Low], close=df[:Close]; kwargs...) + candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end - p1 = plot(get_candlestick("AAPL", name="Apple")) - p2 = plot(get_candlestick("GOOG", name="Google")) - + p1 = plot(get_candlestick("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_candlestick("GOOG", name="Google"), Layout(title="Google")) [p1 p2] end @@ -96,13 +94,13 @@ candlestick2() ``` -
+
diff --git a/docs/examples/heatmaps.md b/docs/examples/heatmaps.md index c7c3bd7c..bed52b7f 100644 --- a/docs/examples/heatmaps.md +++ b/docs/examples/heatmaps.md @@ -6,12 +6,12 @@ heatmap1() ``` -
+
@@ -31,12 +31,12 @@ heatmap2() ``` -
+
diff --git a/docs/examples/histograms.md b/docs/examples/histograms.md index cf607e4e..40816f9d 100644 --- a/docs/examples/histograms.md +++ b/docs/examples/histograms.md @@ -13,12 +13,12 @@ two_hists() ``` -
+
diff --git a/docs/examples/line_scatter.md b/docs/examples/line_scatter.md index 9621da10..d0eb750a 100644 --- a/docs/examples/line_scatter.md +++ b/docs/examples/line_scatter.md @@ -9,12 +9,12 @@ linescatter1() ``` -
+
@@ -43,12 +43,12 @@ linescatter2() ``` -
+
@@ -81,12 +81,12 @@ linescatter3() ``` -
+
@@ -104,12 +104,12 @@ linescatter4() ``` -
+
@@ -164,12 +164,12 @@ linescatter5() ``` -
+
@@ -220,12 +220,12 @@ linescatter6() ``` -
+
@@ -256,12 +256,12 @@ batman() ``` -
+
@@ -304,12 +304,12 @@ dumbell() ``` -
+
@@ -386,12 +386,12 @@ errorbars1() ``` -
+
@@ -451,12 +451,12 @@ errorbars2() ``` -
+
diff --git a/docs/examples/maps.md b/docs/examples/maps.md index 093ecd77..f0db4728 100644 --- a/docs/examples/maps.md +++ b/docs/examples/maps.md @@ -19,12 +19,12 @@ maps1() ``` -
+
@@ -65,12 +65,12 @@ maps2() ``` -
+
diff --git a/docs/examples/shapes.md b/docs/examples/shapes.md index c8f873f6..c8947250 100644 --- a/docs/examples/shapes.md +++ b/docs/examples/shapes.md @@ -13,12 +13,12 @@ house() ``` -
+
@@ -38,12 +38,12 @@ house2() ``` -
+
@@ -77,12 +77,12 @@ clusters() ``` -
+
@@ -109,12 +109,12 @@ temperature() ``` -
+
@@ -133,12 +133,12 @@ vlines1() ``` -
+
@@ -156,12 +156,12 @@ vlines2() ``` -
+
@@ -180,12 +180,12 @@ vlines3() ``` -
+
@@ -203,12 +203,12 @@ vlines4() ``` -
+
@@ -227,12 +227,12 @@ vlines5() ``` -
+
@@ -251,12 +251,12 @@ hlines1() ``` -
+
@@ -274,12 +274,12 @@ hlines2() ``` -
+
@@ -298,12 +298,12 @@ hlines3() ``` -
+
@@ -321,12 +321,12 @@ hlines4() ``` -
+
@@ -345,12 +345,12 @@ hlines5() ``` -
+
diff --git a/docs/examples/subplots.md b/docs/examples/subplots.md index e4d917c1..15642c04 100644 --- a/docs/examples/subplots.md +++ b/docs/examples/subplots.md @@ -9,12 +9,12 @@ subplots1() ``` -
+
@@ -32,12 +32,12 @@ subplots2() ``` -
+
@@ -60,12 +60,12 @@ subplots3() ``` -
+
diff --git a/docs/examples/tables.md b/docs/examples/tables.md new file mode 100644 index 00000000..cbc50277 --- /dev/null +++ b/docs/examples/tables.md @@ -0,0 +1,164 @@ +```julia +function table1() + values = [ + "Salaries" 1200000 1300000 1300000 1400000 + "Office" 20000 20000 20000 20000 + "Merchandise" 80000 70000 120000 90000 + "Legal" 2000 2000 2000 2000 + "TOTAL" 12120000 130902000 131222000 14102000 + ] + + trace = table( + header=attr( + values=["Expenses", "Q1", "Q2", "Q3", "Q4"], + align="center", line=attr(width=1, color="black"), + fill_color="grey", font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=values, align="center", line=attr(color="black", width=1), + font=attr(family="Arial", size=11, color="black") + ) + ) + plot(trace) + +end +table1() +``` + + +
+ + + + + +```julia +function table2() + values = [ + "Salaries" 1200000 1300000 1300000 1400000 + "Office" 20000 20000 20000 20000 + "Merchandise" 80000 70000 120000 90000 + "Legal" 2000 2000 2000 2000 + "TOTAL" 12120000 130902000 131222000 14102000 + ] + + trace = table( + header=attr( + values=["EXPENSES", "Q1", "Q2", "Q3", "Q4"], + align=["left", "center"], line=attr(width=1, color="#506784"), + fill_color="#119DFF", + font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=values, align=["left", "center"], + line=attr(color="#506784", width=1), + font=attr(family="Arial", size=11, color="#506784"), + fill_color=["#25FEFD", "white"] + ) + ) + plot(trace) + +end +table2() +``` + + +
+ + + + + +```julia +function table2a() + p1 = table1() + restyle!(p1, + header=attr( + align=["left", "center"], line_color="#506784", fill_color="#119DFF" + ), + cells=attr( + align=["left", "center"], line_color="#506784", + fill_color=["#25FEFD", "white"], font_color="#506784" + ) + ) + p1 +end +table2a() +``` + + +
+ + + + + +```julia +function table3() + nm = tempname() + url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" + download(url, nm) + df = readtable(nm) + rm(nm) + + data = Array(df) + + trace = table( + columnwidth=[200, 500, 600, 600, 400, 400, 600, 600, 600], + # columnorder=0:9, + header=attr( + values=map(x-> replace(string(x), '_', '-'), names(df)), + align="center", + line=attr(width=1, color="rgb(50, 50, 50)"), + fill_color=["rgb(235, 100, 230)"], + font=attr(family="Arial", size=12, color="white") + ), + cells=attr( + values=Array(df), + align=["center", "center"], + line=attr(width=1, color="black"), + fill_color=["rgba(228, 222, 249, 0.65)", "rgb(235, 193, 238)", "rgba(228, 222, 249, 0.65)"], + font=attr(family="Arial", size=10, color="black") + ) + ) + + layout = Layout( + title="Bitcoin mining stats for 180 days", + width=1200 + ) + plot(trace, layout) +end +table3() +``` + + +
+ + + + + diff --git a/docs/examples/ternary.md b/docs/examples/ternary.md index 25b8660c..d8cfb9a1 100644 --- a/docs/examples/ternary.md +++ b/docs/examples/ternary.md @@ -48,12 +48,12 @@ ternary_markers() ``` -
+
@@ -124,12 +124,12 @@ filled_ternary() ``` -
+
diff --git a/docs/examples/time_series.md b/docs/examples/time_series.md index 23318bce..b48df110 100644 --- a/docs/examples/time_series.md +++ b/docs/examples/time_series.md @@ -7,12 +7,12 @@ datetimestrings() ``` -
+
diff --git a/docs/examples/violin.md b/docs/examples/violin.md new file mode 100644 index 00000000..00e71cc9 --- /dev/null +++ b/docs/examples/violin.md @@ -0,0 +1,234 @@ +```julia +function violin_box_overlay() + y = abs.(100 .* randn(300)) + data = [ + violin(x0="sample 1", name="violin", y=y, points="all"), + box(x0="sample 1", name="box", y=y, boxpoints=false) + ] + plot(data, Layout(legend=attr(x=0.95, xanchor="right"))) +end +violin_box_overlay() +``` + + +
+ + + + + +```julia +function violin_grouped() + days = repeat(["day 1", "day 2"], inner=5) + y_kale = [0.2, 0.2, 0.6, 1, 0.5, 0.4, 0.2, 0.7, 0.9, 0.1, 0.5, 0.3] + y_radish = [0.6, 0.7, 0.3, 0.6, 0, 0.5, 0.7, 0.9, 0.5, 0.8, 0.7, 0.2] + y_carrot = [0.1, 0.3, 0.1, 0.9, 0.6, 0.6, 0.9, 1, 0.3, 0.6, 0.8, 0.5] + colors = ["#3D9970", "#FF4136", "#FF851B"] + names = ["kale", "radishes", "carrots"] + ys = (y_kale, y_radish, y_carrot) + + data = [ + violin( + y=y, name=name, x=days, span=[0, nothing], jitter=0, points="all", + marker=attr(symbol="line-ew", color=color, line=attr(color=color, width=2)) + ) for (y, name, color) in zip(ys, names, colors) + ] + layout = Layout( + yaxis=attr(zeroline=false, title="normalized moisture"), + violinmode="group" + ) + plot(data, layout) +end +violin_grouped() +``` + + +
+ + + + + +```julia +function violin_nonlinear() + p1 = plot( + violin( + x=["1798-01-01", "1798-04-04", "1798-05-05", + "1798-05-05", "1798-07-05", "1798-07-22", "1799-01-01"], + orientation="h", box_visible=true, xcalendar="discworld", + name="discworld dates" + ) + ) + p2 = plot( + violin( + x=["A", "B", "C", "C", "C", "D", "G"], + orientation="h", box_visible=true, xcalendar="discworld", + name="categories" + ), Layout(xaxis_categoryarray='A':'G') + ) + p = [p1; p2] + relayout!(p, showlegend=false, margin_l=100) + p +end +violin_nonlinear() +``` + + +
+ + + + + +```julia +function violin_old_faithful() + y = [79, 54, 74, 62, 85, 55, 88, 85, 51, 85, 54, 84, 78, 47, 83, 52, 62, + 84, 52, 79, 51, 47, 78, 69, 74, 83, 55, 76, 78, 79, 73, 77, 66, 80, 74, 52, + 48, 80, 59, 90, 80, 58, 84, 58, 73, 83, 64, 53, 82, 59, 75, 90, 54, 80, 54, + 83, 71, 64, 77, 81, 59, 84, 48, 82, 60, 92, 78, 78, 65, 73, 82, 56, 79, 71, + 62, 76, 60, 78, 76, 83, 75, 82, 70, 65, 73, 88, 76, 80, 48, 86, 60, 90, 50, + 78, 63, 72, 84, 75, 51, 82, 62, 88, 49, 83, 81, 47, 84, 52, 86, 81, 75, 59, + 89, 79, 59, 81, 50, 85, 59, 87, 53, 69, 77, 56, 88, 81, 45, 82, 55, 90, 45, + 83, 56, 89, 46, 82, 51, 86, 53, 79, 81, 60, 82, 77, 76, 59, 80, 49, 96, 53, + 77, 77, 65, 81, 71, 70, 81, 93, 53, 89, 45, 86, 58, 78, 66, 76, 63, 88, 52, + 93, 49, 57, 77, 68, 81, 81, 73, 50, 85, 74, 55, 77, 83, 83, 51, 78, 84, 46, + 83, 55, 81, 57, 76, 84, 77, 81, 87, 77, 51, 78, 60, 82, 91, 53, 78, 46, 77, + 84, 49, 83, 71, 80, 49, 75, 64, 76, 53, 94, 55, 76, 50, 82, 54, 75, 78, 79, + 78, 78, 70, 79, 70, 54, 86, 50, 90, 54, 54, 77, 79, 64, 75, 47, 86, 63, 85, + 82, 57, 82, 67, 74, 54, 83, 73, 73, 88, 80, 71, 83, 56, 79, 78, 84, 58, 83, + 43, 60, 75, 81, 46, 90, 46, 74] + plot(violin(y=y, points="all", name="Old Faithful", meanline_visible=true)) +end +violin_old_faithful() +``` + + +
+ + + + + +```julia +function violin_side_by_side() + # requires RDatasets and DataFrames + tips = dataset("reshape2", "tips") + parts = zip( + ("Female", "Male"), + ("positive", "negative"), + ("#bebada", "#8dd3c7"), + (1.0, -0.6) + ) + traces = GenericTrace[] + for (sex, side, color, pointpos) in parts + sub_tips = tips[tips[:Sex] .== sex, :] + sub_traces = violin(sub_tips, + group=:Day, + x=:TotalBill, y0=(df) -> df[1, :Day], + side=side, orientation="h", + marker=attr(line=attr(width=2, color=color), symbol="line-ns"), + line_color=color, + hoveron="points+kde", text=(df) -> "Sample length $(size(df, 1))", + scalemode="count", scalegroup=sex, legendgroup=sex, name=sex, + points="all", jitter=0, pointpos=pointpos, + span=[0], + box_visible=true, meanline_visible=true, + showlegend=false, + ) + sub_traces[1][:showlegend] = true + append!(traces, sub_traces) + end + # TODO: make the layout + layout = Layout( + hovermode="closest", violinmode="overlay", + title="Total bill distribution
scaled by number of bills per gender", + legend_tracegroupgap=0, violingap=0, violingroupgap=0, + yaxis=attr(showgrid=true, categoryarray=["Thur", "Fri", "Sat", "Sun"]), + ) + plot(traces, layout) +end +violin_side_by_side() +``` + + +
+ + + + + +```julia +function violin_style() + y1 = vcat(abs.(20 .* rand(100)), rand(UInt16, 300) .* 500 ./ typemax(UInt16)) + y2 = [25.261999999999997, 66.5419, 98.2114, 0.09070629 ] + box = attr(fillcolor="black", line_color="black", width=0.01) + span = [0, nothing] + trace1 = violin( + bandwidth=5, points=false, y=y1, name="Radial Velocity", + span=span, line_color="#67353E", box=box + ) + trace2 = violin( + bandwidth=5, points=false, y=y2, name="Pulsar Timing", + span=span, line_color="#34ABA2", box=box + ) + + layout = Layout( + paper_bgcolor="#d3d3d3", plot_bgcolor="#d3d3d3", + showlegend=false, violingap=0, xaxis_side="top", + yaxis=attr( + showline=false, showticklabels=false, range=(-5, 550), + zeroline=false, visible=false, showgrid=false, + ), + annotations=[attr( + text="Orbital Period Estimations", font_size=20, + xref="paper", yref="paper", showarrow=false, + )] + ) + plot([trace1, trace2], layout) +end +violin_style() +``` + + +
+ + + + + diff --git a/examples/finance.jl b/examples/finance.jl index f59d107a..1053a2f0 100644 --- a/examples/finance.jl +++ b/examples/finance.jl @@ -9,16 +9,15 @@ function ohlc1() end function ohlc2() - @eval using Quandl + # uses Quandl.jl function get_ohlc(ticker; kwargs...) df = quandlget("WIKI/$(ticker)", format="DataFrame") - ohlc(open=df[:Open], high=df[:High], low=df[:Low], close=df[:Close]; kwargs...) + ohlc(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end - p1 = plot(get_ohlc("AAPL", name="Apple")) - p2 = plot(get_ohlc("GOOG", name="Google")) - + p1 = plot(get_ohlc("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_ohlc("GOOG", name="Google"), Layout(title="Google")) [p1 p2] end @@ -32,16 +31,15 @@ function candlestick1() end function candlestick2() - @eval using Quandl + # uses Quandl.jl function get_candlestick(ticker; kwargs...) df = quandlget("WIKI/$(ticker)", format="DataFrame") - candlestick(open=df[:Open], high=df[:High], low=df[:Low], close=df[:Close]; kwargs...) + candlestick(df, x=:Date, open=:Open, high=:High, low=:Low, close=:Close; kwargs...) end - p1 = plot(get_candlestick("AAPL", name="Apple")) - p2 = plot(get_candlestick("GOOG", name="Google")) - + p1 = plot(get_candlestick("AAPL", name="Apple"), Layout(title="Apple")) + p2 = plot(get_candlestick("GOOG", name="Google"), Layout(title="Google")) [p1 p2] end diff --git a/examples/tables.jl b/examples/tables.jl index 96238ed5..2006a86a 100644 --- a/examples/tables.jl +++ b/examples/tables.jl @@ -69,12 +69,11 @@ end function table3() - # TODO: this is broken... - # nm = tempname() - # url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" - # download(url, nm) - # df = readtable(nm) - # rm(nm) + nm = tempname() + url = "https://raw.githubusercontent.com/plotly/datasets/master/Mining-BTC-180.csv" + download(url, nm) + df = readtable(nm) + rm(nm) data = Array(df) @@ -97,5 +96,9 @@ function table3() ) ) - plot(trace, Layout(title="Bitcoin mining stats for 180 days")) + layout = Layout( + title="Bitcoin mining stats for 180 days", + width=1200 + ) + plot(trace, layout) end diff --git a/mkdocs.yml b/mkdocs.yml index 36b43bc3..c98b2efc 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,18 +17,20 @@ pages: - Examples: - examples/3d.md - examples/area.md - - examples/box_plots.md - examples/bar.md + - examples/box_plots.md - examples/contour.md - examples/finance.md - examples/heatmaps.md - examples/histograms.md - examples/line_scatter.md - - examples/time_series.md - examples/maps.md - - examples/ternary.md - - examples/subplots.md - examples/shapes.md + - examples/subplots.md + - examples/tables.md + - examples/ternary.md + - examples/time_series.md + - examples/violin.md markdown_extensions: - codehilite