-
Notifications
You must be signed in to change notification settings - Fork 55
/
figure.py
43 lines (35 loc) · 1.5 KB
/
figure.py
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
""" Defines the ReportTable class """
from __future__ import division, print_function, absolute_import, unicode_literals
#*****************************************************************
# pyGSTi 0.9: Copyright 2015 Sandia Corporation
# This Software is released under the GPL license detailed
# in the file "license.txt" in the top-level pyGSTi directory
#*****************************************************************
from collections import OrderedDict as _OrderedDict
from .row import Row
from .convert import convertDict as _convertDict
class ReportFigure(object):
'''
A report figure, encapsulating a plotly figure and related metadata that
can be rendered in a variety of formats.
'''
def __init__(self, plotlyfig, colormap=None, pythonValue=None, **kwargs):
'''
Create a table object
Parameters
----------
plotlyfig : plotly.Figure
The plotly figure to encapsulate
colormap : ColorMap, optional
A pygsti color map object used for this figure.
pythonValue : object, optional
A python object to be used as the Python-version of
this figure (usually the data being plotted in some
convenient format).
kwargs : dict
Additional meta-data relevant to this figure
'''
self.plotlyfig = plotlyfig
self.colormap = colormap
self.pythonvalue = pythonValue
self.metadata = dict(kwargs).copy()