|
19 | 19 | GRAPH_REFERENCE_DOWNLOAD_TIMEOUT = 5 # seconds
|
20 | 20 |
|
21 | 21 |
|
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 previously known objects. |
| 23 | +# Moving forward, we only add new trace names. |
36 | 24 | # {<ClassName>: {'object_name': <object_name>, 'base_type': <base-type>}
|
37 | 25 | _BACKWARDS_COMPAT_CLASS_NAMES = {
|
38 | 26 | 'AngularAxis': {'object_name': 'angularaxis', 'base_type': dict},
|
@@ -488,29 +476,6 @@ def _patch_arrays():
|
488 | 476 | ARRAYS['data'] = {'meta_paths': [('traces', )], 'items': list(TRACE_NAMES)}
|
489 | 477 |
|
490 | 478 |
|
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 |
| - |
514 | 479 | def _get_classes():
|
515 | 480 | """
|
516 | 481 | We eventually make classes out of the objects in GRAPH_REFERENCE.
|
@@ -550,8 +515,6 @@ def _get_classes():
|
550 | 515 | ARRAYS = _get_arrays()
|
551 | 516 | _patch_arrays()
|
552 | 517 |
|
553 |
| -CLASS_NAMES_TO_OBJECT_NAMES = _get_class_names_to_object_names() |
554 |
| - |
555 | 518 | CLASSES = _get_classes()
|
556 | 519 |
|
557 | 520 | OBJECT_NAME_TO_CLASS_NAME = {class_dict['object_name']: class_name
|
|
0 commit comments