From e9eca577aad1bf8c2cc387ffbeea1a1f2da83950 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Fri, 17 Jun 2016 15:31:01 -0400 Subject: [PATCH] plotlyjs supported_scales; violin check --- src/backends/plotlyjs.jl | 1 + src/recipes.jl | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/backends/plotlyjs.jl b/src/backends/plotlyjs.jl index 5bafb62d..5730551e 100644 --- a/src/backends/plotlyjs.jl +++ b/src/backends/plotlyjs.jl @@ -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 diff --git a/src/recipes.jl b/src/recipes.jl index 9ef03785..a182e002 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -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