FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
xplot/include/xplot/xplot.hpp at master · QuantStack/xplot · GitHub
QuantStack
xplot
Repository navigation
Code
Issues
9
(9)
Pull requests
1
(1)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
xplot
/
include
/
xplot
/
xplot.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
88 lines (66 loc) · 2.2 KB
Breadcrumbs
xplot
/
include
/
xplot
/
xplot.hpp
Copy path
File metadata and controls
88 lines (66 loc) · 2.2 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
**************************************************************************
* Copyright (c) 2017, Sylvain Corlay and Johan Mabille *
* *
* Distributed under the terms of the BSD 3-Clause License. *
* *
* The full license is in the file LICENSE, distributed with this software. *
***************************************************************************
*/
#
ifndef
XPLOT_PLOT_HPP
#
define
XPLOT_PLOT_HPP
#
include
<
string
>
#
include
"
nlohmann/json.hpp
"
#
include
"
xwidgets/xmaterialize.hpp
"
#
include
"
xwidgets/xobject.hpp
"
#
include
"
xplot_config.hpp
"
namespace
nl
=
nlohmann;
namespace
xpl
{
using
color_type = std::string;
/*
********************
* xplot declaration *
********************
*/
template
<
class
D
>
class
xplot
:
public
xw
::xobject<D>
{
public:
using
base_type = xw::xobject<D>;
using
derived_type = D;
void
serialize_state
(nl::json&, xeus::buffer_sequence&)
const
;
void
apply_patch
(
const
nl::json&,
const
xeus::buffer_sequence&);
protected:
xplot
();
using
base_type::base_type;
private:
void
set_defaults
();
};
/*
***********************
* xplot implementation *
***********************
*/
template
<
class
D
>
inline
void
xplot<D>::apply_patch(
const
nl::json& patch,
const
xeus::buffer_sequence& buffers)
{
using
xw::set_property_from_patch;
base_type::apply_patch
(patch, buffers);
}
template
<
class
D
>
inline
void
xplot<D>::serialize_state(nl::json& state, xeus::buffer_sequence& buffers)
const
{
using
xw::xwidgets_serialize;
base_type::serialize_state
(state, buffers);
}
template
<
class
D
>
inline
xplot<D>::xplot()
: base_type()
{
set_defaults
();
}
template
<
class
D
>
inline
void
xplot<D>::set_defaults()
{
this
->
_model_module
() =
"
bqplot
"
;
this
->
_model_module_version
() =
bqplot_semver
();
this
->
_view_module
() =
"
bqplot
"
;
this
->
_view_module_version
() =
bqplot_semver
();
}
}
#
endif
Back
|
FazBrowse Home
|
New Git URL