macros.j2 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% macro fig(plot, embed_figure=False) %}
  2. <div class="well center-block figure-container">
  3. <div>
  4. <a href="#" title="{{ plot.name }}">
  5. {% if embed_figure %}
  6. <img src="data:img/png;base64,{{ plot.data }}" class="thumbnail img-responsive">
  7. {% else %}
  8. <img src="./figures/{{ plot.name }}.png" class="thumbnail img-responsive">
  9. {% endif %}
  10. </a>
  11. </div>
  12. <div class="caption">
  13. <p class="text-center"> {{ plot.name }} </p>
  14. <div class="panel-group" id="accordion{{ r }}{{ c }}">
  15. <div class="panel-heading">
  16. <h4 class="panel-title">
  17. <button data-toggle="collapse" data-parent="#accordion{{ plot.idx }}" class="btn btn-info btn-block" href="#collapse{{plot.idx}}">
  18. Plot Info</button>
  19. </h4>
  20. </div>
  21. <div id="collapse{{plot.idx}}" class="panel-collapse collapse">
  22. <div class="panel-body">
  23. <div class="text-left">{{ plot.docs|safe }}</div>
  24. <div class="text-left">{{ plot.ret_html|safe }}</div>
  25. <hr>
  26. <p class="text-left"><strong>Plot Arguments</strong></p>
  27. <table class="table table-hover">
  28. <tbody>
  29. {% for key, val in plot.argdict.items() %}
  30. <tr>
  31. <td>{{ key }}</td> <td>{{ val }}</td>
  32. </tr>
  33. {% endfor %}
  34. </tbody>
  35. </table>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. {% endmacro %}