File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
import json
9
9
import os
10
+ import shutil
10
11
import uuid
11
12
import warnings
12
13
from pkg_resources import resource_string
@@ -42,8 +43,9 @@ def download_plotlyjs(download_url):
42
43
43
44
44
45
def get_plotlyjs ():
45
- path = os .path .join ('offline' , 'plotly.min.js' )
46
- plotlyjs = resource_string ('plotly' , path ).decode ('utf-8' )
46
+ # path = os.path.join('offline', 'plotly.min.js')
47
+ # plotlyjs = resource_string('plotly', path).decode('utf-8')
48
+ plotlyjs = '</script><script src="plotly.min.js">'
47
49
return plotlyjs
48
50
49
51
@@ -315,6 +317,14 @@ def plot(figure_or_data,
315
317
).format (id = plotdivid )
316
318
317
319
if output_type == 'file' :
320
+ src_path = os .path .join (
321
+ os .path .dirname (__file__ ), 'plotly.min.js'
322
+ )
323
+ # src_path = resource_string('plotly', path)
324
+ dest_path = os .path .join ( os .path .dirname ( filename ), 'plotly.min.js' )
325
+ if os .path .exists ( dest_path ) is False :
326
+ shutil .copy ( src_path , dest_path )
327
+
318
328
with open (filename , 'w' ) as f :
319
329
if include_plotlyjs :
320
330
plotly_js_script = '' .join ([
You can’t perform that action at this time.
0 commit comments