File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 11from __future__ import absolute_import
22from plotly import utils
33import textwrap
4+ import os
45import sys
56if sys .version [:3 ] == '2.6' :
67 from ordereddict import OrderedDict
1516
1617# Define graph reference loader
1718def _load_graph_ref ():
18- json_files = ['graph_objs_meta' , 'OBJ_MAP' ,
19- 'NAME_TO_KEY' , 'KEY_TO_NAME' ]
19+ graph_reference_dir = 'graph_reference'
20+ json_files = [
21+ 'graph_objs_meta.json' ,
22+ 'OBJ_MAP.json' ,
23+ 'NAME_TO_KEY.json' ,
24+ 'KEY_TO_NAME.json'
25+ ]
2026 out = []
2127 for json_file in json_files :
22- s = resource_string ('plotly' ,
23- 'graph_reference/' +
24- json_file + '.json' ).decode ('utf-8' )
28+ relative_path = os .path .join (graph_reference_dir , json_file )
29+ s = resource_string ('plotly' , relative_path ).decode ('utf-8' )
2530 tmp = json .loads (s , object_pairs_hook = OrderedDict )
2631 tmp = utils .decode_unicode (tmp )
2732 out += [tmp ]
You can’t perform that action at this time.
0 commit comments