django-plotly-dash div size too small and wont change

Viewed 1643

Using Django-plotly-dash module and dash app is rendering in a very small window. is there something specific other than typical css that i can do to render this full page?

I have tried updating style of the specific div as well as updating the style in the entire page.

...

{% extends 'base_page.html' %}
{% block content %}
<head>

</head>
<body>
{%load plotly_dash%}

    <div class={% plotly_class name="SimpleExample"%}>

        {% plotly_app name="SimpleExample" %}
      </div>
</body>
{% endblock %}
...

Expecting div to be full page however it is only rendering a very small window

1 Answers

I ran into the same problem, couldn't find where the template tag gets its style. One thing you cant try is adding a ratio argument

{% plotly_app name="SimpleExample" ratio=1 %}

EDIT: I didn't see your comment there before.

You could also try using

{% plotly_direct name="SimpleExample" %} 

This template tag allows the direct insertion of html into a template, instead of embedding it in an iframe. You will need the {% plotly_header %} and {% plotly_footer %} tags too, and not to forget the middleware should be added in settings.py

MIDDLEWARE = [

               'django_plotly_dash.middleware.BaseMiddleware',

             ]

This link is helpful: https://django-plotly-dash.readthedocs.io/en/latest/template_tags.html

Related