plotlyjs supported_scales; violin check
This commit is contained in:
parent
b232410d25
commit
e9eca577aa
@ -5,6 +5,7 @@ supported_args(::PlotlyJSBackend) = supported_args(PlotlyBackend())
|
|||||||
supported_types(::PlotlyJSBackend) = supported_types(PlotlyBackend())
|
supported_types(::PlotlyJSBackend) = supported_types(PlotlyBackend())
|
||||||
supported_styles(::PlotlyJSBackend) = supported_styles(PlotlyBackend())
|
supported_styles(::PlotlyJSBackend) = supported_styles(PlotlyBackend())
|
||||||
supported_markers(::PlotlyJSBackend) = supported_markers(PlotlyBackend())
|
supported_markers(::PlotlyJSBackend) = supported_markers(PlotlyBackend())
|
||||||
|
supported_scales(::PlotlyJSBackend) = supported_scales(PlotlyBackend())
|
||||||
is_subplot_supported(::PlotlyJSBackend) = true
|
is_subplot_supported(::PlotlyJSBackend) = true
|
||||||
is_string_supported(::PlotlyJSBackend) = true
|
is_string_supported(::PlotlyJSBackend) = true
|
||||||
|
|
||||||
|
|||||||
@ -714,18 +714,17 @@ end
|
|||||||
|
|
||||||
# function apply_series_recipe(d::KW, ::Type{Val{:violin}})
|
# function apply_series_recipe(d::KW, ::Type{Val{:violin}})
|
||||||
@recipe function f(::Type{Val{:violin}}, x, y, z; trim=true)
|
@recipe function f(::Type{Val{:violin}}, x, y, z; trim=true)
|
||||||
# dumpdict(d, "box before", true)
|
delete!(d, :trim)
|
||||||
# TODO: add scatter series with outliers
|
|
||||||
|
|
||||||
# create a list of shapes, where each shape is a single boxplot
|
# create a list of shapes, where each shape is a single boxplot
|
||||||
shapes = Shape[]
|
shapes = Shape[]
|
||||||
groupby = extractGroupArgs(d[:x])
|
groupby = extractGroupArgs(x)
|
||||||
|
|
||||||
for (i, glabel) in enumerate(groupby.groupLabels)
|
for (i, glabel) in enumerate(groupby.groupLabels)
|
||||||
|
|
||||||
# get the edges and widths
|
# get the edges and widths
|
||||||
y = d[:y][groupby.groupIds[i]]
|
y = d[:y][groupby.groupIds[i]]
|
||||||
widths, centers = violin_coords(y, trim=trim)
|
widths, centers = violin_coords(y, trim=trim)
|
||||||
|
isempty(widths) && continue
|
||||||
|
|
||||||
# normalize
|
# normalize
|
||||||
widths = _box_halfwidth * widths / maximum(widths)
|
widths = _box_halfwidth * widths / maximum(widths)
|
||||||
@ -737,14 +736,7 @@ end
|
|||||||
push!(shapes, Shape(xcoords, ycoords))
|
push!(shapes, Shape(xcoords, ycoords))
|
||||||
end
|
end
|
||||||
|
|
||||||
# d[:plotarg_overrides] = KW(:xticks => (1:length(shapes), groupby.groupLabels))
|
|
||||||
seriestype := :shape
|
seriestype := :shape
|
||||||
# n = length(groupby.groupLabels)
|
|
||||||
# xticks --> (linspace(0.5,n-0.5,n), groupby.groupLabels)
|
|
||||||
|
|
||||||
# clean up d
|
|
||||||
pop!(d, :trim)
|
|
||||||
|
|
||||||
d[:x], d[:y] = shape_coords(shapes)
|
d[:x], d[:y] = shape_coords(shapes)
|
||||||
()
|
()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user