{% if data is not none and 'plotly' in data %}
  {% set plot_id = (id_prefix ~ '_plot') | get_hash  %}
  {% set plotly_chart_title = data.plotly | plotly_chart_get_title | striptags %}
  <div>
  {% if plotly_chart_title %}
    {{ plotly_chart_title }}
  {% else %}
    {{ schema.title | get_translated_text }}# {{ loop.index }}
  {% endif %}

  {% if data.plotly %}
    <a id="plotly_info_link_{{ plot_id }}" data-hide-text="[{{ _('hide plot')}}]" data-show-text="[{{ _('show plot') }}]">[{{ _('show plot') }}]</a>
    <div id="plotly_plot_div_{{ plot_id }}" style="display: none"></div>

    <script type="application/json" data-sampledb-plotly-chart="plotly_plot_div_{{ plot_id }}" data-sampledb-plotly-chart-toggle="plotly_info_link_{{ plot_id }}">
      {{ data.plotly | tojson | safe }}
    </script>
  {% endif %}
  </div>
{% else %}
  &mdash;
{% endif %}
