Skip to content

Commit

Permalink
API fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian committed Aug 5, 2021
1 parent 55de267 commit dafee23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Charts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Base.@kwdef mutable struct PlotOptions
tooltip_enable::Bool = true

xaxis_type::Union{String,Symbol} = :category
xaxis_categories::Vector{String} = String[]
xaxis_categories::Union{Vector{String},Vector{Float64}} = String[]
xaxis_tick_amount::Union{Int,Float64,String,Undefined} = UNDEFINED
xaxis_tick_placement::Union{String,Symbol} = :between # :on
xaxis_max::Union{Int,Float64,String,Undefined} = UNDEFINED
Expand All @@ -116,6 +116,9 @@ Base.@kwdef mutable struct PlotOptions
yaxis_min::Union{Int,Float64,String,Undefined} = UNDEFINED
yaxis_show::Bool = true
yaxis_tick_amount::Union{Int,Float64,String,Undefined} = UNDEFINED

extra_properties::Dict = Dict()
extra_options::Dict = Dict()
end

Base.@kwdef mutable struct PlotData{T<:Vector}
Expand Down Expand Up @@ -321,6 +324,8 @@ function Stipple.render(po::PlotOptions, fieldname::Union{Symbol,Nothing} = noth
)
)

isempty(po.extra_properties) || (val = merge(po.extra_properties, val))

plot_options = if po.chart_type == :area
Dict(
:area => Dict(
Expand Down Expand Up @@ -378,6 +383,7 @@ function Stipple.render(po::PlotOptions, fieldname::Union{Symbol,Nothing} = noth
Dict()
end

isempty(po.extra_options) || (plot_options = merge(po.extra_options, plot_options))
isempty(plot_options) || (val[:plotOptions] = plot_options)

val
Expand Down

2 comments on commit dafee23

@essenciary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/42647

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.0 -m "<description of version>" dafee23024b5e97762e312bb6728249090378ecf
git push origin v0.9.0

Please sign in to comment.