Turi Create  4.0
scatter.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 #include <core/data/sframe/gl_sarray.hpp>
7 
8 #include "groupby.hpp"
9 #include "transformation.hpp"
10 #include "plot.hpp"
11 
12 namespace turi {
13 namespace visualization {
14 
15  class scatter_result: public transformation_output {
16  private:
17  gl_sframe m_sf;
18 
19  public:
20  scatter_result(gl_sframe sf);
21  virtual std::string vega_column_data(bool) const override;
22  };
23 
24  class scatter: public transformation_base {
25  private:
26  gl_sframe m_sf;
27 
28  public:
29  void init(gl_sframe sf);
30  virtual std::shared_ptr<transformation_output> get() override;
31  virtual bool eof() const override;
32  virtual size_t get_batch_size() const override;
33  virtual flex_int get_rows_processed() const override;
34  virtual flex_int get_total_rows() const override;
35  };
36 
37  std::shared_ptr<Plot> plot_scatter(
38  const gl_sarray& x,
39  const gl_sarray& y,
40  const std::string& xlabel,
41  const std::string& ylabel,
42  const std::string& title);
43 
44 }}