8000 Remove old graph_reference compat framework. · ii0/plotly.py@19be9ab · GitHub
[go: up one dir, main page]

Skip to content

Commit 19be9ab

Browse files
committed
Remove old graph_reference compat framework.
1 parent fa3e928 commit 19be9ab

File tree

1 file changed

+2
-39
lines changed

1 file changed

+2
-39
lines changed

plotly/graph_reference.py

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,8 @@
1919
GRAPH_REFERENCE_DOWNLOAD_TIMEOUT = 5 # seconds
2020

2121

22-
# for backwards compat, we need to add a few class names
23-
_BACKWARDS_COMPAT_CLASS_NAME_TO_OBJECT_NAME = {
24-
'AngularAxis': 'angularaxis',
25-
'ColorBar': 'colorbar',
26-
'Area': 'scatter',
27-
'Histogram2dContour': 'histogram2dcontour',
28-
'RadialAxis': 'radialaxis',
29-
'XAxis': 'xaxis',
30-
'XBins': 'xbins',
31-
'YAxis': 'yaxis',
32-
'YBins': 'ybins',
33-
'ZAxis': 'zaxis'
34-
}
35-
22+
# For backwards compat, we keep this list of previousl 10000 y known objects.
23+
# Moving forward, we only add new trace names.
3624
# {<ClassName>: {'object_name': <object_name>, 'base_type': <base-type>}
3725
_BACKWARDS_COMPAT_CLASS_NAMES = {
3826
'AngularAxis': {'object_name': 'angularaxis', 'base_type': dict},
@@ -488,29 +476,6 @@ def _patch_arrays():
488476
ARRAYS['data'] = {'meta_paths': [('traces', )], 'items': list(TRACE_NAMES)}
489477

490478

491-
def _get_class_names_to_object_names():
492-
"""
493-
We eventually make classes out of the objects in GRAPH_REFERENCE.
494-
495-
:return: (dict) A mapping of class names to object names.
496-
497-
"""
498-
class_names_to_object_names = {}
499-
for object_name in OBJECTS:
500-
class_name = string_to_class_name(object_name)
501-
class_names_to_object_names[class_name] = object_name
502-
503-
for array_name in ARRAYS:
504-
class_name = string_to_class_name(array_name)
505-
class_names_to_object_names[class_name] = array_name
506-
507-
for class_name in _BACKWARDS_COMPAT_CLASS_NAME_TO_OBJECT_NAME:
508-
object_name = _BACKWARDS_COMPAT_CLASS_NAME_TO_OBJECT_NAME[class_name]
509-
class_names_to_object_names[class_name] = object_name
510-
511-
return class_names_to_object_names
512-
513-
514479
def _get_classes():
515480
"""
516481
We eventually make classes out of the objects in GRAPH_REFERENCE.
@@ -550,8 +515,6 @@ def _get_classes():
550515
ARRAYS = _get_arrays()
551516
_patch_arrays()
552517

553-
CLASS_NAMES_TO_OBJECT_NAMES = _get_class_names_to_object_names()
554-
555518
CLASSES = _get_classes()
556519

557520
OBJECT_NAME_TO_CLASS_NAME = {class_dict['object_name']: class_name

0 commit comments

Comments
 (0)
0