Turi Create  4.0
boxes_and_whiskers.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef __TC_BOXES_AND_WHISKERS
7 #define __TC_BOXES_AND_WHISKERS
8 
9 #include <core/data/sframe/gl_sframe.hpp>
10 #include <core/storage/sframe_data/groupby_aggregate_operators.hpp>
11 #include <visualization/server/plot.hpp>
12 #include "groupby.hpp"
13 #include "transformation.hpp"
14 
15 namespace turi {
16 namespace visualization {
17 
18 class boxes_and_whiskers_result: public transformation_output,
19  public groupby_quantile_result {
20  public:
21  virtual std::string vega_column_data(bool sframe) const override;
22 };
23 
24 // expects a gl_sframe of:
25 // "x": str,
26 // "y": int/float
27 class boxes_and_whiskers : public groupby<boxes_and_whiskers_result> {
28 };
29 
30 // expects x to be str, y to be int/float
31 std::shared_ptr<Plot> plot_boxes_and_whiskers(
32  const gl_sarray& x,
33  const gl_sarray& y,
34  const flexible_type& xlabel,
35  const flexible_type& ylabel,
36  const flexible_type& title);
37 
38 }} // turi::visualization
39 
40 #endif // __TC_BOXES_AND_WHISKERS