@@ -124,8 +124,10 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
124
124
jdata = json .dumps (figure .get ('data' , []), cls = utils .PlotlyJSONEncoder )
125
125
jlayout = json .dumps (figure .get ('layout' , {}), cls = utils .PlotlyJSONEncoder )
126
126
127
- if show_link is False :
128
- link_text = ''
127
+ config = {}
128
+ config ['showLink' ] = show_link
129
+ config ['linkText' ] = link_text
130
+ jconfig = json .dumps (config )
129
131
130
132
plotly_platform_url = session .get_session_config ().get ('plotly_domain' ,
131
133
'https://plot.ly' )
@@ -141,18 +143,17 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
141
143
'<script type="text/javascript">'
142
144
'window.PLOTLYENV=window.PLOTLYENV || {};'
143
145
'window.PLOTLYENV.BASE_URL="' + plotly_platform_url + '";'
144
- 'Plotly.LINKTEXT = "' + link_text + '";'
145
146
'</script>'
146
147
))
147
148
148
149
script = '\n ' .join ([
149
- 'Plotly.plot("{id}", {data}, {layout}).then(function() {{' ,
150
+ 'Plotly.plot("{id}", {data}, {layout}, {config} ).then(function() {{' ,
150
151
' $(".{id}.loading").remove();' ,
151
152
'}})'
152
153
]).format (id = plotdivid ,
153
154
data = jdata ,
154
155
layout = jlayout ,
155
- link_text = link_text )
156
+ config = jconfig )
156
157
157
158
display (HTML (''
158
159
'<div class="{id} loading" style="color: rgb(50,50,50);">'
0 commit comments