Blame view

app/main/templates/agent.html 587 Bytes
d9f5cfc9   hitier   New agent page dy...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{% extends "base_page.html" %}
{% block content %}
{{agent.firstname}}
<div id="charge_div"></div>
<svg id="charge"></svg>
{% endblock %}
{% block more_scripts %}
{% include 'd3js-includes.html' %}
<script>
  // Update…
  d3.json("{{url_for('main.charge_agent', agent_id=agent.id)}}").then( data => {
    var charge = d3.select("#charge_div")
        .selectAll("p")
        .data(data)
        .text(function (d) {
          return d;
        });
    // Enter…
    charge.enter().append("p")
        .text(function (d) {
          return d;
        });
})

</script>
{% endblock %}