File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import absolute_import
2
2
from plotly import utils
3
3
import textwrap
4
+ import os
4
5
import sys
5
6
if sys .version [:3 ] == '2.6' :
6
7
from ordereddict import OrderedDict
15
16
16
17
# Define graph reference loader
17
18
def _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
+ ]
20
26
out = []
21
27
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' )
25
30
tmp = json .loads (s , object_pairs_hook = OrderedDict )
26
31
tmp = utils .decode_unicode (tmp )
27
32
out += [tmp ]
You can’t perform that action at this time.
0 commit comments