Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade echarts to 4.8, update docs #87

Merged
merged 4 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.jl.mem

.DS_Store
docs/vendor/*
docs/vendor/*
.vscode
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ WebIO = "0f1e0344-ec1d-5b48-a673-e5cf874b6c29"

[compat]
Blink = "~0.12.0"
ColorBrewer = "0.4.0"
DataFrames = "~0.19.0"
Distributions = "~0.21.0"
ColorBrewer = "~0.4.0"
DataFrames = "~0.21.0"
Distributions = "~0.23.0"
HTTP = "~0.8.0"
JSExpr = "~0.5.0"
JSON = "~0.21.0"
KernelDensity = "~0.5.0"
NoveltyColors = "~0.4.0"
Parameters = "~0.12.0"
RDatasets = "~0.6.2"
StatsBase = "~0.32.0"
StatsBase = "~0.33.0"
WebIO = "~0.8.11"
julia = "^1.1.0"

Expand Down
2 changes: 1 addition & 1 deletion docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ DEPENDENCIES
github-pages

BUNDLED WITH
1.16.6
2.1.4
4 changes: 2 additions & 2 deletions docs/_site/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ GEM
jekyll-seo-tag (~> 2.1)
minitest (5.13.0)
multipart-post (2.1.1)
nokogiri (1.10.5)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
Expand Down Expand Up @@ -246,4 +246,4 @@ DEPENDENCIES
github-pages

BUNDLED WITH
1.16.6
2.1.4
2 changes: 1 addition & 1 deletion docs/_site/area.html
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ <h3 id="univariatekde">UnivariateKDE</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ <h3 id="dataframe-with-group-argument">DataFrame with <code class="language-plai
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/box.html
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ <h3 id="dataframe-with-group-argument">Dataframe with group argument</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/candlestick.html
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ <h3 id="single-series">Single Series</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/colorscheme.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ <h3 id="palette-and-reversepalette"><code class="language-plaintext highlighter-
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/flip.html
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ <h2 id="examples">Examples</h2>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/funnel.html
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ <h3 id="single-series">Single Series</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/gauge.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ <h3 id="change-colors-and-breakpoints">Change Colors and Breakpoints</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ <h2 id="workflow">Workflow</h2>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/line.html
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ <h3 id="dataframe-with-group-argument">DataFrame with <code class="language-plai
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/pie.html
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ <h3 id="rose-chart---radius">Rose Chart - Radius</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/polar.html
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ <h3 id="multiple-series">Multiple Series</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/radar.html
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ <h3 id="multiple-series---fill">Multiple Series - fill</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/sankey.html
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ <h2 id="examples">Examples</h2>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/scatter.html
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ <h3 id="dataframe-with-group-argument">DataFrame with <code class="language-plai
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/slider.html
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ <h2 id="examples">Examples</h2>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/title.html
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ <h3 id="examples">Examples</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/toolbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ <h2 id="examples">Examples</h2>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/waterfall.html
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ <h3 id="single-series">Single Series</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/_site/xaxisyaxis.html
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ <h3 id="format-axis-tick-labels">Format axis tick labels</h3>
<footer>
<div class="row">
<div class="col-lg-12 footer">
Site last generated: Nov 4, 2019 <br />
Site last generated: Jun 26, 2020 <br />
This project is maintained by <a href="https://github.com/randyzwitch/ECharts.jl">randyzwitch</a>
</div>
</div>
Expand Down
49 changes: 25 additions & 24 deletions docs/js/echarts.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions src/ECharts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module ECharts
import Base: print, show
import LinearAlgebra: triu!, triu, tril, tril!

#import JSON
# import JSON
import JSON: StructuralContext, Serializations.CommonSerialization

export print

#Create base color library
# Create base color library
const colorpalettes = merge(ColorBrewer.colorSchemes, NoveltyColors.ColorDict)
export colorpalettes

Expand All @@ -36,8 +36,8 @@ module ECharts
export yline!, xline!, lineargradient, radialgradient, text!, xarea!, yarea!, xgridlines!, ygridlines!
export radial!, jitter!, labels!, theme!, tooltip!, aria!

#This is a package local function, it is NOT overloading JSON.json
#Define custom JSON serialization rule
# This is a package local function, it is NOT overloading JSON.json
# Define custom JSON serialization rule
struct JSSerialization <: CommonSerialization end
struct JSFunction
data::String
Expand All @@ -50,14 +50,14 @@ module ECharts
end

json(x) = sprint(JSON.show_json, JSSerialization(), x)
#end custom JSON serialization rule
# end custom JSON serialization rule

#Primitives - in order of descending dependency within files
# Primitives - in order of descending dependency within files
include("theme.jl")
include("definetypes.jl")
include("render.jl")

#Visualization mutating functions
# Visualization mutating functions
include("chartopts/utilities.jl")
include("chartopts/seriesnames.jl")
include("chartopts/xyaxis.jl")
Expand All @@ -79,7 +79,7 @@ module ECharts
include("chartopts/gradients.jl")
include("chartopts/aria.jl")

#Plots
# Plots
include("plots/xy_plot.jl")
include("plots/bar.jl")
include("plots/radialbar.jl")
Expand Down Expand Up @@ -114,7 +114,7 @@ module ECharts
end
return res
end
makevalidjson(x::Missing) = "-" #this is a backstop to a value of missing getting to render step. "-" represents missing in ECharts
makevalidjson(x::Missing) = "-" # this is a backstop to a value of missing getting to render step. "-" represents missing in ECharts
makevalidjson(x::Any) = x

# By convention, using single underscore at beginning to get around reserved words
Expand Down
6 changes: 3 additions & 3 deletions src/plots/corrplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function corrplot(m::Matrix;
#convert back to df, melt to pass to arrayofarray
cor_df = DataFrame(m_)
original_names = names(cor_df)
names!(cor_df, [Symbol(x) for x in 1:length(names(cor_df))])
rename!(cor_df, [Symbol(x) for x in 1:length(names(cor_df))])
cor_df[!, :rownames] = names(cor_df)
df_melt = melt(cor_df, [:rownames])
df_melt = stack(cor_df, Not([:rownames]))

#convert to numeric, fixes weird echarts api requiring numeric series in order to rename
df_melt[!, :variable] = [parse(Int, string(x)) - 1 for x in df_melt[!, :variable]]
Expand Down Expand Up @@ -99,7 +99,7 @@ function corrplot(df::AbstractDataFrame;
kwargs...)

#get numeric columns from df, call cor from StatsBase
df_num = df[!, [x <: Union{Missing, Number} for x in eltypes(df)]]
df_num = df[!, [x <: Union{Missing, Number} for x in eltype.(eachcol(df))]]
c = cor(convert(Matrix, df_num))

ec = corrplot(c, bubblesize = bubblesize, layout = layout, labels = labels, ec_height = ec_height, ec_width = ec_width, kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion test/plots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ sgrp3 = bubble(mtcars, :MPG, :HP, :Disp, :Cyl)
cplot = corrplot(mtcars)
@test typeof(cplot) == EChart

df_num = mtcars[!, [x <: Union{Number, Missing} for x in eltypes(mtcars)]]
df_num = mtcars[!, [x <: Union{Number, Missing} for x in eltype.(eachcol(mtcars))]]
c = cor(convert(Matrix, df_num))
ccc = corrplot(c)
@test typeof(ccc) == EChart