plotlyjs supported_scales; violin check

This commit is contained in:
Thomas Breloff 2016-06-17 15:31:01 -04:00
parent b232410d25
commit e9eca577aa
2 changed files with 4 additions and 11 deletions

View File

@ -5,6 +5,7 @@ supported_args(::PlotlyJSBackend) = supported_args(PlotlyBackend())
supported_types(::PlotlyJSBackend) = supported_types(PlotlyBackend())
supported_styles(::PlotlyJSBackend) = supported_styles(PlotlyBackend())
supported_markers(::PlotlyJSBackend) = supported_markers(PlotlyBackend())
supported_scales(::PlotlyJSBackend) = supported_scales(PlotlyBackend())
is_subplot_supported(::PlotlyJSBackend) = true
is_string_supported(::PlotlyJSBackend) = true

View File

@ -714,18 +714,17 @@ end
# function apply_series_recipe(d::KW, ::Type{Val{:violin}})
@recipe function f(::Type{Val{:violin}}, x, y, z; trim=true)
# dumpdict(d, "box before", true)
# TODO: add scatter series with outliers
delete!(d, :trim)
# create a list of shapes, where each shape is a single boxplot
shapes = Shape[]
groupby = extractGroupArgs(d[:x])
groupby = extractGroupArgs(x)
for (i, glabel) in enumerate(groupby.groupLabels)
# get the edges and widths
y = d[:y][groupby.groupIds[i]]
widths, centers = violin_coords(y, trim=trim)
isempty(widths) && continue
# normalize
widths = _box_halfwidth * widths / maximum(widths)
@ -737,14 +736,7 @@ end
push!(shapes, Shape(xcoords, ycoords))
end
# d[:plotarg_overrides] = KW(:xticks => (1:length(shapes), groupby.groupLabels))
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)
()
end