1from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
2import copy as _copy
3
4
5class Surface(_BaseTraceHierarchyType):
6
7    # class properties
8    # --------------------
9    _parent_path_str = "volume"
10    _path_str = "volume.surface"
11    _valid_props = {"count", "fill", "pattern", "show"}
12
13    # count
14    # -----
15    @property
16    def count(self):
17        """
18        Sets the number of iso-surfaces between minimum and maximum
19        iso-values. By default this value is 2 meaning that only
20        minimum and maximum surfaces would be drawn.
21
22        The 'count' property is a integer and may be specified as:
23          - An int (or float that will be cast to an int)
24            in the interval [1, 9223372036854775807]
25
26        Returns
27        -------
28        int
29        """
30        return self["count"]
31
32    @count.setter
33    def count(self, val):
34        self["count"] = val
35
36    # fill
37    # ----
38    @property
39    def fill(self):
40        """
41        Sets the fill ratio of the iso-surface. The default fill value
42        of the surface is 1 meaning that they are entirely shaded. On
43        the other hand Applying a `fill` ratio less than one would
44        allow the creation of openings parallel to the edges.
45
46        The 'fill' property is a number and may be specified as:
47          - An int or float in the interval [0, 1]
48
49        Returns
50        -------
51        int|float
52        """
53        return self["fill"]
54
55    @fill.setter
56    def fill(self, val):
57        self["fill"] = val
58
59    # pattern
60    # -------
61    @property
62    def pattern(self):
63        """
64        Sets the surface pattern of the iso-surface 3-D sections. The
65        default pattern of the surface is `all` meaning that the rest
66        of surface elements would be shaded. The check options (either
67        1 or 2) could be used to draw half of the squares on the
68        surface. Using various combinations of capital `A`, `B`, `C`,
69        `D` and `E` may also be used to reduce the number of triangles
70        on the iso-surfaces and creating other patterns of interest.
71
72        The 'pattern' property is a flaglist and may be specified
73        as a string containing:
74          - Any combination of ['A', 'B', 'C', 'D', 'E'] joined with '+' characters
75            (e.g. 'A+B')
76            OR exactly one of ['all', 'odd', 'even'] (e.g. 'even')
77
78        Returns
79        -------
80        Any
81        """
82        return self["pattern"]
83
84    @pattern.setter
85    def pattern(self, val):
86        self["pattern"] = val
87
88    # show
89    # ----
90    @property
91    def show(self):
92        """
93        Hides/displays surfaces between minimum and maximum iso-values.
94
95        The 'show' property must be specified as a bool
96        (either True, or False)
97
98        Returns
99        -------
100        bool
101        """
102        return self["show"]
103
104    @show.setter
105    def show(self, val):
106        self["show"] = val
107
108    # Self properties description
109    # ---------------------------
110    @property
111    def _prop_descriptions(self):
112        return """\
113        count
114            Sets the number of iso-surfaces between minimum and
115            maximum iso-values. By default this value is 2 meaning
116            that only minimum and maximum surfaces would be drawn.
117        fill
118            Sets the fill ratio of the iso-surface. The default
119            fill value of the surface is 1 meaning that they are
120            entirely shaded. On the other hand Applying a `fill`
121            ratio less than one would allow the creation of
122            openings parallel to the edges.
123        pattern
124            Sets the surface pattern of the iso-surface 3-D
125            sections. The default pattern of the surface is `all`
126            meaning that the rest of surface elements would be
127            shaded. The check options (either 1 or 2) could be used
128            to draw half of the squares on the surface. Using
129            various combinations of capital `A`, `B`, `C`, `D` and
130            `E` may also be used to reduce the number of triangles
131            on the iso-surfaces and creating other patterns of
132            interest.
133        show
134            Hides/displays surfaces between minimum and maximum
135            iso-values.
136        """
137
138    def __init__(
139        self, arg=None, count=None, fill=None, pattern=None, show=None, **kwargs
140    ):
141        """
142        Construct a new Surface object
143
144        Parameters
145        ----------
146        arg
147            dict of properties compatible with this constructor or
148            an instance of
149            :class:`plotly.graph_objs.volume.Surface`
150        count
151            Sets the number of iso-surfaces between minimum and
152            maximum iso-values. By default this value is 2 meaning
153            that only minimum and maximum surfaces would be drawn.
154        fill
155            Sets the fill ratio of the iso-surface. The default
156            fill value of the surface is 1 meaning that they are
157            entirely shaded. On the other hand Applying a `fill`
158            ratio less than one would allow the creation of
159            openings parallel to the edges.
160        pattern
161            Sets the surface pattern of the iso-surface 3-D
162            sections. The default pattern of the surface is `all`
163            meaning that the rest of surface elements would be
164            shaded. The check options (either 1 or 2) could be used
165            to draw half of the squares on the surface. Using
166            various combinations of capital `A`, `B`, `C`, `D` and
167            `E` may also be used to reduce the number of triangles
168            on the iso-surfaces and creating other patterns of
169            interest.
170        show
171            Hides/displays surfaces between minimum and maximum
172            iso-values.
173
174        Returns
175        -------
176        Surface
177        """
178        super(Surface, self).__init__("surface")
179
180        if "_parent" in kwargs:
181            self._parent = kwargs["_parent"]
182            return
183
184        # Validate arg
185        # ------------
186        if arg is None:
187            arg = {}
188        elif isinstance(arg, self.__class__):
189            arg = arg.to_plotly_json()
190        elif isinstance(arg, dict):
191            arg = _copy.copy(arg)
192        else:
193            raise ValueError(
194                """\
195The first argument to the plotly.graph_objs.volume.Surface
196constructor must be a dict or
197an instance of :class:`plotly.graph_objs.volume.Surface`"""
198            )
199
200        # Handle skip_invalid
201        # -------------------
202        self._skip_invalid = kwargs.pop("skip_invalid", False)
203        self._validate = kwargs.pop("_validate", True)
204
205        # Populate data dict with properties
206        # ----------------------------------
207        _v = arg.pop("count", None)
208        _v = count if count is not None else _v
209        if _v is not None:
210            self["count"] = _v
211        _v = arg.pop("fill", None)
212        _v = fill if fill is not None else _v
213        if _v is not None:
214            self["fill"] = _v
215        _v = arg.pop("pattern", None)
216        _v = pattern if pattern is not None else _v
217        if _v is not None:
218            self["pattern"] = _v
219        _v = arg.pop("show", None)
220        _v = show if show is not None else _v
221        if _v is not None:
222            self["show"] = _v
223
224        # Process unknown kwargs
225        # ----------------------
226        self._process_kwargs(**dict(arg, **kwargs))
227
228        # Reset skip_invalid
229        # ------------------
230        self._skip_invalid = False
231