Skip to content

Commit 01c25e4

Browse files
author
Mark Gibbs
committed
Added generic html properties function to dash wrapper class and template that uses it
1 parent 243c886 commit 01c25e4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

django_plotly_dash/dash_wrapper.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def flask_app(self):
302302
return self._flask_app
303303

304304
def base_url(self):
305-
'Base url of this omponent'
305+
'Base url of this component'
306306
return self._base_pathname
307307

308308
def app_context(self, *args, **kwargs):
@@ -412,3 +412,12 @@ def dispatch_with_args(self, body, argMap):
412412
da.update_current_state(output['id'], output['property'], value)
413413

414414
return res
415+
416+
def extra_html_properties(self):
417+
'''
418+
Return extra html properties to allow individual apps to be styled separately.
419+
420+
The content returned from this function is injected unescaped into templates.
421+
'''
422+
423+
return 'class="django-plotly-dash django-plotly-dash-iframe"'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<div style="{{dstyle}}">
1+
<div style="{{dstyle}}" {%autoescape off%}{{app.extra_html_properties}}{%endautoescape%}>
22
<iframe src="{{app.base_url}}" style="{{istyle}}"frameborder="{{fbs}}"></iframe>
33
</div>

0 commit comments

Comments
 (0)