|
1 | 1 | import sys
|
2 | 2 | from typing import TYPE_CHECKING
|
| 3 | + |
3 | 4 | if TYPE_CHECKING:
|
4 | 5 | from ._bar import Bar
|
5 | 6 | from ._barpolar import Barpolar
|
|
130 | 131 | from . import waterfall
|
131 | 132 | else:
|
132 | 133 | from _plotly_utils.importers import relative_import
|
| 134 | + |
133 | 135 | __all__, __getattr__, __dir__ = relative_import(
|
134 | 136 | __name__,
|
135 |
| - ['.bar', '.barpolar', '.box', '.candlestick', '.carpet', '.choropleth', '.choroplethmap', '.choroplethmapbox', '.cone', '.contour', '.contourcarpet', '.densitymap', '.densitymapbox', '.funnel', '.funnelarea', '.heatmap', '.histogram', '.histogram2d', '.histogram2dcontour', '.icicle', '.image', '.indicator', '.isosurface', '.layout', '.mesh3d', '.ohlc', '.parcats', '.parcoords', '.pie', '.sankey', '.scatter', '.scatter3d', '.scattercarpet', '.scattergeo', '.scattergl', '.scattermap', '.scattermapbox', '.scatterpolar', '.scatterpolargl', '.scattersmith', '.scatterternary', '.splom', '.streamtube', '.sunburst', '.surface', '.table', '.treemap', '.violin', '.volume', '.waterfall'], |
136 |
| - ['._bar.Bar', '._barpolar.Barpolar', '._box.Box', '._candlestick.Candlestick', '._carpet.Carpet', '._choropleth.Choropleth', '._choroplethmap.Choroplethmap', '._choroplethmapbox.Choroplethmapbox', '._cone.Cone', '._contour.Contour', '._contourcarpet.Contourcarpet', '._densitymap.Densitymap', '._densitymapbox.Densitymapbox', '._deprecations.AngularAxis', '._deprecations.Annotation', '._deprecations.Annotations', '._deprecations.ColorBar', '._deprecations.Contours', '._deprecations.Data', '._deprecations.ErrorX', '._deprecations.ErrorY', '._deprecations.ErrorZ', '._deprecations.Font', '._deprecations.Frames', '._deprecations.Histogram2dcontour', '._deprecations.Legend', '._deprecations.Line', '._deprecations.Margin', '._deprecations.Marker', '._deprecations.RadialAxis', '._deprecations.Scene', '._deprecations.Stream', '._deprecations.Trace', '._deprecations.XAxis', '._deprecations.XBins', '._deprecations.YAxis', '._deprecations.YBins', '._deprecations.ZAxis', '._figure.Figure', '._frame.Frame', '._funnel.Funnel', '._funnelarea.Funnelarea', '._heatmap.Heatmap', '._histogram.Histogram', '._histogram2d.Histogram2d', '._histogram2dcontour.Histogram2dContour', '._icicle.Icicle', '._image.Image', '._indicator.Indicator', '._isosurface.Isosurface', '._layout.Layout', '._mesh3d.Mesh3d', '._ohlc.Ohlc', '._parcats.Parcats', '._parcoords.Parcoords', '._pie.Pie', '._sankey.Sankey', '._scatter.Scatter', '._scatter3d.Scatter3d', '._scattercarpet.Scattercarpet', '._scattergeo.Scattergeo', '._scattergl.Scattergl', '._scattermap.Scattermap', '._scattermapbox.Scattermapbox', '._scatterpolar.Scatterpolar', '._scatterpolargl.Scatterpolargl', '._scattersmith.Scattersmith', '._scatterternary.Scatterternary', '._splom.Splom', '._streamtube.Streamtube', '._sunburst.Sunburst', '._surface.Surface', '._table.Table', '._treemap.Treemap', '._violin.Violin', '._volume.Volume', '._waterfall.Waterfall'] |
| 137 | + [ |
| 138 | + ".bar", |
| 139 | + ".barpolar", |
| 140 | + ".box", |
| 141 | + ".candlestick", |
| 142 | + ".carpet", |
| 143 | + ".choropleth", |
| 144 | + ".choroplethmap", |
| 145 | + ".choroplethmapbox", |
| 146 | + ".cone", |
| 147 | + ".contour", |
| 148 | + ".contourcarpet", |
| 149 | + ".densitymap", |
| 150 | + ".densitymapbox", |
| 151 | + ".funnel", |
| 152 | + ".funnelarea", |
| 153 | + ".heatmap", |
| 154 | + ".histogram", |
| 155 | + ".histogram2d", |
| 156 | + ".histogram2dcontour", |
| 157 | + ".icicle", |
| 158 | + ".image", |
| 159 | + ".indicator", |
| 160 | + ".isosurface", |
| 161 | + ".layout", |
| 162 | + ".mesh3d", |
| 163 | + ".ohlc", |
| 164 | + ".parcats", |
| 165 | + ".parcoords", |
| 166 | + ".pie", |
| 167 | + ".sankey", |
| 168 | + ".scatter", |
| 169 | + ".scatter3d", |
| 170 | + ".scattercarpet", |
| 171 | + ".scattergeo", |
| 172 | + ".scattergl", |
| 173 | + ".scattermap", |
| 174 | + ".scattermapbox", |
| 175 | + ".scatterpolar", |
| 176 | + ".scatterpolargl", |
| 177 | + ".scattersmith", |
| 178 | + ".scatterternary", |
| 179 | + ".splom", |
| 180 | + ".streamtube", |
| 181 | + ".sunburst", |
| 182 | + ".surface", |
| 183 | + ".table", |
| 184 | + ".treemap", |
| 185 | + ".violin", |
| 186 | + ".volume", |
| 187 | + ".waterfall", |
| 188 | + ], |
| 189 | + [ |
| 190 | + "._bar.Bar", |
| 191 | + "._barpolar.Barpolar", |
| 192 | + "._box.Box", |
| 193 | + "._candlestick.Candlestick", |
| 194 | + "._carpet.Carpet", |
| 195 | + "._choropleth.Choropleth", |
| 196 | + "._choroplethmap.Choroplethmap", |
| 197 | + "._choroplethmapbox.Choroplethmapbox", |
| 198 | + "._cone.Cone", |
| 199 | + "._contour.Contour", |
| 200 | + "._contourcarpet.Contourcarpet", |
| 201 | + "._densitymap.Densitymap", |
| 202 | + "._densitymapbox.Densitymapbox", |
| 203 | + "._deprecations.AngularAxis", |
| 204 | + "._deprecations.Annotation", |
| 205 | + "._deprecations.Annotations", |
| 206 | + "._deprecations.ColorBar", |
| 207 | + "._deprecations.Contours", |
| 208 | + "._deprecations.Data", |
| 209 | + "._deprecations.ErrorX", |
| 210 | + "._deprecations.ErrorY", |
| 211 | + "._deprecations.ErrorZ", |
| 212 | + "._deprecations.Font", |
| 213 | + "._deprecations.Frames", |
| 214 | + "._deprecations.Histogram2dcontour", |
| 215 | + "._deprecations.Legend", |
| 216 | + "._deprecations.Line", |
| 217 | + "._deprecations.Margin", |
| 218 | + "._deprecations.Marker", |
| 219 | + "._deprecations.RadialAxis", |
| 220 | + "._deprecations.Scene", |
| 221 | + "._deprecations.Stream", |
| 222 | + "._deprecations.Trace", |
| 223 | + "._deprecations.XAxis", |
| 224 | + "._deprecations.XBins", |
| 225 | + "._deprecations.YAxis", |
| 226 | + "._deprecations.YBins", |
| 227 | + "._deprecations.ZAxis", |
| 228 | + "._figure.Figure", |
| 229 | + "._frame.Frame", |
| 230 | + "._funnel.Funnel", |
| 231 | + "._funnelarea.Funnelarea", |
| 232 | + "._heatmap.Heatmap", |
| 233 | + "._histogram.Histogram", |
| 234 | + "._histogram2d.Histogram2d", |
| 235 | + "._histogram2dcontour.Histogram2dContour", |
| 236 | + "._icicle.Icicle", |
| 237 | + "._image.Image", |
| 238 | + "._indicator.Indicator", |
| 239 | + "._isosurface.Isosurface", |
| 240 | + "._layout.Layout", |
| 241 | + "._mesh3d.Mesh3d", |
| 242 | + "._ohlc.Ohlc", |
| 243 | + "._parcats.Parcats", |
| 244 | + "._parcoords.Parcoords", |
| 245 | + "._pie.Pie", |
| 246 | + "._sankey.Sankey", |
| 247 | + "._scatter.Scatter", |
| 248 | + "._scatter3d.Scatter3d", |
| 249 | + "._scattercarpet.Scattercarpet", |
| 250 | + "._scattergeo.Scattergeo", |
| 251 | + "._scattergl.Scattergl", |
| 252 | + "._scattermap.Scattermap", |
| 253 | + "._scattermapbox.Scattermapbox", |
| 254 | + "._scatterpolar.Scatterpolar", |
| 255 | + "._scatterpolargl.Scatterpolargl", |
| 256 | + "._scattersmith.Scattersmith", |
| 257 | + "._scatterternary.Scatterternary", |
| 258 | + "._splom.Splom", |
| 259 | + "._streamtube.Streamtube", |
| 260 | + "._sunburst.Sunburst", |
| 261 | + "._surface.Surface", |
| 262 | + "._table.Table", |
| 263 | + "._treemap.Treemap", |
| 264 | + "._violin.Violin", |
| 265 | + "._volume.Volume", |
| 266 | + "._waterfall.Waterfall", |
| 267 | + ], |
137 | 268 | )
|
138 | 269 |
|
139 | 270 |
|
140 | 271 | if sys.version_info < (3, 7) or TYPE_CHECKING:
|
141 | 272 | try:
|
142 | 273 | import ipywidgets as _ipywidgets
|
143 | 274 | from packaging.version import Version as _Version
|
| 275 | + |
144 | 276 | if _Version(_ipywidgets.__version__) >= _Version("7.0.0"):
|
145 | 277 | from ..graph_objs._figurewidget import FigureWidget
|
146 | 278 | else:
|
|
150 | 282 | else:
|
151 | 283 | __all__.append("FigureWidget")
|
152 | 284 | orig_getattr = __getattr__
|
| 285 | + |
153 | 286 | def __getattr__(import_name):
|
154 | 287 | if import_name == "FigureWidget":
|
155 | 288 | try:
|
156 | 289 | import ipywidgets
|
157 | 290 | from packaging.version import Version
|
| 291 | + |
158 | 292 | if Version(ipywidgets.__version__) >= Version("7.0.0"):
|
159 | 293 | from ..graph_objs._figurewidget import FigureWidget
|
| 294 | + |
160 | 295 | return FigureWidget
|
161 | 296 | else:
|
162 | 297 | raise ImportError()
|
163 | 298 | except Exception:
|
164 | 299 | from ..missing_anywidget import FigureWidget
|
| 300 | + |
165 | 301 | return FigureWidget
|
166 | 302 | else:
|
167 | 303 | raise ImportError()
|
168 | 304 |
|
169 | 305 | return orig_getattr(import_name)
|
170 |
| - |
|
0 commit comments