Blame view

flaskr/templates/estimation.html 15.3 KB
d01e2cc2   Antoine Goutenoir   Add the template ...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{% extends "base.html" %}


{% block title %}Estimation {{ estimation.public_id }} of your ✈ travel footprint{% endblock %}


{% block hero %}
<div class="jumbotron">
{% if estimation.has_failed() %}
    <h1>{{ content.estimation.failure.hero.title | safe }}</h1>
    <p>{{ content.estimation.failure.hero.description | markdown | safe }}</p>
{% else %}
    <h1>{{ content.estimation.hero.title | safe }}</h1>
    <p>{{ content.estimation.hero.description | markdown | safe }}</p>
{% endif %}
</div>
{% endblock %}



39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{% macro render_cities(cities) %}
<ul class="numbered-list">
{% for city in cities %}
    <li>
        <span class="city-name" title="{{ city.address }}">
    {% if loop.first %}
        <strong>
        {{ city.city }}
        </strong>
    {% else %}
        {{ city.city }}
    {% endif %}
        </span>
        –
13c292f1   Antoine Goutenoir   Fix the display o...
35
        {{ "%.1f" | format((city.footprint/1000.0) | round(1)) }} tons CO<sub>2</sub><small>EQ</small>
eb5f7e79   Antoine Goutenoir   Display the CO2 i...
36
13c292f1   Antoine Goutenoir   Fix the display o...
37
        {{ "%d" | format(city.distance | round() | int) }} km
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
38
39
40
41
42
43
    </li>
{% endfor %}
</ul>
{% endmacro %}


eb5f7e79   Antoine Goutenoir   Display the CO2 i...
44

d01e2cc2   Antoine Goutenoir   Add the template ...
45
46
47
48
{% block body %}
<h2>
    {{ estimation.public_id }} ({{ estimation.status.name }})
</h2>
62d3db14   Antoine Goutenoir   Show warnings bel...
49

d01e2cc2   Antoine Goutenoir   Add the template ...
50
{% if estimation.errors %}
62d3db14   Antoine Goutenoir   Show warnings bel...
51
52
<div class="row">
    <div class="col-md-12 alert-danger card">
d01e2cc2   Antoine Goutenoir   Add the template ...
53
54
55
56
57
58
59
        <div class="card-body">
            <h3 class="card-title">Errors</h3>
            <pre>
{{ estimation.errors }}
            </pre>
        </div>
    </div>
d01e2cc2   Antoine Goutenoir   Add the template ...
60
61
</div>
{% endif %}
f3694728   Antoine Goutenoir   Display a summary.
62

39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
63
<div class="row">
a3e9d0fc   Antoine Goutenoir   Fix home plot leg...
64
65
66
67
    Using
    {% for model in estimation.get_models() %}
        {{ model.name }}{{ ',' if not loop.last }}
    {% endfor %}
eb5f7e79   Antoine Goutenoir   Display the CO2 i...
68
69
{#    <h4>Total CO<sub>2</sub> footprint (in kilograms-equivalent) of each city</h4>#}
{#    <div id="cities_footprints_d3viz" class="plot-container"></div>#}
30f014d5   Antoine Goutenoir   Add a lollipop pl...
70
    <hr>
b7411dd3   Antoine Goutenoir   Improve the plots...
71
    <div id="cities_footprints_d3viz_lollipop" class="plot-container"></div>
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
72
73
74
75
76
77
78
79
80
{#    <br>#}
{#    <p>A Legend here</p>#}
</div>

<hr>

<div class="row">

{% if not estimation.has_failed() %}
30f014d5   Antoine Goutenoir   Add a lollipop pl...
81
{#{% set estimation_output = estimation.get_output_dict() %}#}
a1f12452   Antoine Goutenoir   Add the new conte...
82
83
84
<div class="col-md-6">
{% if estimation.is_one_to_one() %}
    {{ content.estimation.lolliplot.one_to_one | markdown | safe }}
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
85
    {{ render_cities(estimation_output.cities) }}
a1f12452   Antoine Goutenoir   Add the new conte...
86
87
{% elif estimation.is_many_to_one() %}
    {{ content.estimation.lolliplot.many_to_one | markdown | safe }}
a1f12452   Antoine Goutenoir   Add the new conte...
88
89
90
    {{ render_cities(estimation_output.cities) }}
{% elif estimation.is_one_to_many() %}
    {{ content.estimation.lolliplot.one_to_many | markdown | safe }}
a1f12452   Antoine Goutenoir   Add the new conte...
91
92
93
    {{ render_cities(estimation_output.cities) }}
{% elif estimation.is_many_to_many() %}
    {{ content.estimation.lolliplot.many_to_many | markdown | safe }}
30f014d5   Antoine Goutenoir   Add a lollipop pl...
94
    {{ render_cities(estimation_output.cities) }}
f3694728   Antoine Goutenoir   Display a summary.
95
{% endif %}
a1f12452   Antoine Goutenoir   Add the new conte...
96
</div>
f3694728   Antoine Goutenoir   Display a summary.
97

d01e2cc2   Antoine Goutenoir   Add the template ...
98
    <div class="col-md-6">
490282b4   Antoine Goutenoir   Fix the download ...
99
100
101
102
103
104
105
        <ul class="nav">
            <li class="nav-item m-4">
                <a href="/estimation/{{ estimation.public_id }}.csv" class="btn btn-lg btn-primary">
                    Download CSV
                </a>
            </li>
            <li class="nav-item m-4">
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
106
107
                <a href="/estimation/{{ estimation.public_id }}.yml" class="btn btn-lg btn-warning">
                    Download Raw YAML
490282b4   Antoine Goutenoir   Fix the download ...
108
109
                </a>
            </li>
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
110
111
112
113
114
115
116
117
            <li class="nav-item m-4">
                <a id="cities_footprints_d3viz_lollipop_download"
                   href="#"
                   title="This may not work on IE nor Edge.  Please use a decent browser like Firefox."
                   class="btn btn-lg btn-secondary">
                    Download Plot SVG
                </a>
            </li>
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
118
119
120
121
122
123
124
125
126
127
{#            <li class="nav-item m-4">#}
{#                <a href="/estimation/{{ estimation.public_id }}.xls" class="btn btn-lg btn-secondary disabled">#}
{#                    Download XLS#}
{#                </a>#}
{#            </li>#}
{#            <li class="nav-item m-4">#}
{#                <a href="/estimation/{{ estimation.public_id }}.ods" class="btn btn-lg btn-secondary disabled">#}
{#                    Download ODS#}
{#                </a>#}
{#            </li>#}
490282b4   Antoine Goutenoir   Fix the download ...
128
        </ul>
d01e2cc2   Antoine Goutenoir   Add the template ...
129
    </div>
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
130

d01e2cc2   Antoine Goutenoir   Add the template ...
131
</div>
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
132
133
134

<hr>

62d3db14   Antoine Goutenoir   Show warnings bel...
135
136
137
138
139
140
141
142
143
144
145
146
147
{% if estimation.warnings %}
<div class="row">
    <div class="col-md-12 alert-warning card">
        <div class="card-body">
            <h3 class="card-title">Warnings</h3>
            <pre>
{{ estimation.warnings }}
            </pre>
        </div>
    </div>
</div>
{% endif %}

39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
148
149
150
151
152
153
154
155
{#<div class="row">#}
{#    <div class="col-md-6">#}
{#        <h3>Raw Output <small>(YAML)</small></h3>#}
{#        <pre>#}
{#{{ estimation.output_yaml }}#}
{#        </pre>#}
{#    </div>#}
{#</div>#}
a1f12452   Antoine Goutenoir   Add the new conte...
156
157

{% endif %}{# estimation.has_failed() #}
d01e2cc2   Antoine Goutenoir   Add the template ...
158
{% endblock %}
a1f12452   Antoine Goutenoir   Add the new conte...
159
160
161
162

{#############################################################################}
{#############################################################################}

39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
163
{% block js %}
b7411dd3   Antoine Goutenoir   Improve the plots...
164
165
166
167
168
<script src="/static/js/vendor/d3.v4.js"></script>
<script src="/static/js/vendor/d3-legend.js"></script>
{#<script src="https://d3js.org/d3.v4.js"></script>#}
{#<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.25.6/d3-legend.js"></script>#}

39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
169
170
171
<script type="text/javascript">

/** POLYFILLS **/
d9d606b4   Antoine Goutenoir   Clean up.
172
Math.log10 = Math.log10 || function(x) { return Math.log(x) * Math.LOG10E; };
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
173
174

/**
c890bcbc   Antoine Goutenoir   Review.
175
 * Useful for axes' domains on plots.
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
 * @param value
 * @returns {number}
 */
var ceil_value_to_magnitude = function(value) {
    var sign = 1;
    if (value < 0) {
        value = Math.abs(value);
        sign = -1;
    }
    if (value < 1) {
        return sign;
    }

    var low = Math.pow(10, Math.floor(Math.log10(value)));

    var cursor = low;
b7411dd3   Antoine Goutenoir   Improve the plots...
192
193
    var noloop = 0;
    while ((cursor < value) && (noloop <= 100)) {
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
194
        cursor += 0.1 * low;
b7411dd3   Antoine Goutenoir   Improve the plots...
195
        noloop += 1;
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
196
197
198
199
200
    }

    return sign * cursor;
};

b7411dd3   Antoine Goutenoir   Improve the plots...
201
202
203
204
205
/** CONFIG **/

var plots_config = {
    'cities_count': {{ estimation_output.cities | length }}
};
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
206
207

/** PLOTS **/
30f014d5   Antoine Goutenoir   Add a lollipop pl...
208

eb5f7e79   Antoine Goutenoir   Display the CO2 i...
209
{#
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
210
211
212
jQuery(document).ready(function($){

    var vizid = "#cities_footprints_d3viz";
c890bcbc   Antoine Goutenoir   Review.
213
214
    var csvUrl = "/estimation/{{ estimation.public_id }}.csv";
    var x_key = 'city';
5634c975   Antoine Goutenoir   Expose travel dis...
215
    var y_key = 'co2 (kg)';
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
216
217

    // Set the dimensions and margins of the graph
b7411dd3   Antoine Goutenoir   Improve the plots...
218
    var margin = {top: 10, right: 30, bottom: 150, left: 150},
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
219
220
221
222
223
224
225
226
227
228
229
230
231
232
        height = 666 - margin.top - margin.bottom;
    var width = Math.max(880, $(vizid).parent().width());
    width = width - margin.left - margin.right;

    // Append the svg object to the body of the page
    var svg = d3.select(vizid)
      .append("svg")
        .attr("width", width + margin.left + margin.right)
        .attr("height", height + margin.top + margin.bottom)
      .append("g")
        .attr("transform",
              "translate(" + margin.left + "," + margin.top + ")");

    // Parse the Data
c890bcbc   Antoine Goutenoir   Review.
233
    d3.csv(csvUrl, function(data) {
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
234
235

        // Extrema
5634c975   Antoine Goutenoir   Expose travel dis...
236
        var data_y_max = d3.max(data, function(d) { return parseFloat(d[y_key]); });
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
237
238
239
240
241
        var axis_y_max = ceil_value_to_magnitude(data_y_max);

        // X axis
        var x = d3.scaleBand()
          .range([ 0, width ])
c890bcbc   Antoine Goutenoir   Review.
242
          .domain(data.map(function(d) { return d[x_key]; }))
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
          .padding(0.2);
        svg.append("g")
          .attr("transform", "translate(0," + height + ")")
          .call(d3.axisBottom(x))
          .selectAll("text")
            .attr("transform", "translate(-10,0)rotate(-45)")
            .style("text-anchor", "end");

        // Add Y axis
        var y = d3.scaleLinear()
          .range([ height, 0 ])
          .domain([ 0, axis_y_max ]);
        svg.append("g")
          .call(d3.axisLeft(y));

        // Bars
        svg.selectAll("mybar")
          .data(data)
          .enter()
          .append("rect")
c890bcbc   Antoine Goutenoir   Review.
263
            .attr("x", function(d) { return x(d[x_key]); })
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
264
265
            .attr("width", x.bandwidth())
            .attr("fill", "#d0808b")
c890bcbc   Antoine Goutenoir   Review.
266
            // Hide bars at the beginning
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
267
268
269
270
271
272
273
            .attr("height", function(d) { return height - y(0); }) // always equal to 0
            .attr("y", function(d) { return y(0); });

        // Animation
        svg.selectAll("rect")
          .transition()
          .duration(800)
c890bcbc   Antoine Goutenoir   Review.
274
275
          .attr("y", function(d) { return y(d[y_key]); })
          .attr("height", function(d) { return height - y(d[y_key]); })
39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
276
277
278
279
280
281
          .delay(function(d, i) { return(i*100); });

        // …
    });

});
eb5f7e79   Antoine Goutenoir   Display the CO2 i...
282
#}
30f014d5   Antoine Goutenoir   Add a lollipop pl...
283
284
285
286
287
288


jQuery(document).ready(function($){
    var vizid = "#cities_footprints_d3viz_lollipop";
    var csvUrl = "/estimation/{{ estimation.public_id }}.csv";
    var y_key = 'city';
5634c975   Antoine Goutenoir   Expose travel dis...
289
    var x_key = 'co2 (kg)';
30f014d5   Antoine Goutenoir   Add a lollipop pl...
290

b7411dd3   Antoine Goutenoir   Improve the plots...
291
292
    var margin = {top: 10, right: 30, bottom: 150, left: 150},
        height = Math.max(300, 100+16*plots_config['cities_count']) - margin.top - margin.bottom;
30f014d5   Antoine Goutenoir   Add a lollipop pl...
293
294
295
    var width = Math.max(880, $(vizid).parent().width());
    width = width - margin.left - margin.right;

1f7df547   Antoine Goutenoir   Hack SVG plot dow...
296
    var svg_tag = d3.select(vizid)
30f014d5   Antoine Goutenoir   Add a lollipop pl...
297
298
      .append("svg")
        .attr("width", width + margin.left + margin.right)
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
299
300
301
302
303
304
305
306
307
        .attr("height", height + margin.top + margin.bottom);

    // Add a background
    svg_tag.append("rect")
        .attr("width", "100%")
        .attr("height", "100%")
        .attr("fill", "#ffffff");

    var svg = svg_tag
30f014d5   Antoine Goutenoir   Add a lollipop pl...
308
309
310
311
312
313
314
      .append("g")
        .attr("transform",
              "translate(" + margin.left + "," + margin.top + ")");

    d3.csv(csvUrl, function (data) {

        // Extrema
bd847bc9   Antoine Goutenoir   Add some interact...
315
        var data_x_max = d3.max(data, function (d) { return parseFloat(d[x_key]); });
30f014d5   Antoine Goutenoir   Add a lollipop pl...
316
317
        var axis_x_max = ceil_value_to_magnitude(data_x_max);

bd847bc9   Antoine Goutenoir   Add some interact...
318
        // X axis
30f014d5   Antoine Goutenoir   Add a lollipop pl...
319
320
321
        var x = d3.scaleLinear()
            .domain([0, axis_x_max])
            .range([0, width]);
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
322
            {#.nice();#}
30f014d5   Antoine Goutenoir   Add a lollipop pl...
323
        svg.append("g")
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
324
            .attr("class", "axis-bottom")
30f014d5   Antoine Goutenoir   Add a lollipop pl...
325
326
327
328
329
330
331
332
333
334
335
336
337
338
            .attr("transform", "translate(0," + height + ")")
            .call(d3.axisBottom(x))
            .selectAll("text")
            .attr("transform", "translate(-10,0)rotate(-45)")
            .style("text-anchor", "end");

        // Y axis
        var y = d3.scaleBand()
            .range([0, height])
            .domain(data.map(function (d) {
                return d[y_key];
            }))
            .padding(1);
        svg.append("g")
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
339
            .attr("class", "axis-left")
30f014d5   Antoine Goutenoir   Add a lollipop pl...
340
341
            .call(d3.axisLeft(y));

b7411dd3   Antoine Goutenoir   Improve the plots...
342
343
344
345
346
347
348
349
350
351
352
353
354
355
        {#svg.append("g")#}
        {#    .attr("class", "legendQuant")#}
        {#    .attr("transform", "translate(20,20)");#}
        {##}
        {#var legend = d3.legendColor()#}
        {#    .labelFormat(d3.format(".2f"))#}
        {#    .useClass(true)#}
        {#    .title("Legend")#}
        {#    .titleWidth(100)#}
        {#    .scale(y);#}
        {##}
        {#svg.select(".legendQuant")#}
        {#    .call(legend);#}

30f014d5   Antoine Goutenoir   Add a lollipop pl...
356
357
358
359
360
361
362
363
        // Lines
        svg.selectAll("myline")
            .data(data)
            .enter()
            .append("line")
//            .attr("x1", function (d) {
//                return x(d[x_key]);
//            })
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
364
            .attr("class", "stick")
30f014d5   Antoine Goutenoir   Add a lollipop pl...
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
            .attr("x1", x(0))
            .attr("x2", x(0))
            .attr("y1", function (d) {
                return y(d[y_key]);
            })
            .attr("y2", function (d) {
                return y(d[y_key]);
            })
            .attr("stroke", "grey");

        // Circles
        svg.selectAll("mycircle")
            .data(data)
            .enter()
            .append("circle")
            .attr("cx", function (d) {
                return x(d[x_key]);
            })
            .attr("cy", function (d) {
                return y(d[y_key]);
            })
bd847bc9   Antoine Goutenoir   Add some interact...
386
            .attr("r", "0")  // animated below
30f014d5   Antoine Goutenoir   Add a lollipop pl...
387
388
389
            .style("fill", "#69b3a2")
            .attr("stroke", "black");

bd847bc9   Antoine Goutenoir   Add some interact...
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
        // Value text on mouse hover
        svg.selectAll("hoverrects")
            .data(data)
            .enter()
            .append("rect")
            .style("opacity", 0)
            .attr("class", "hover_trigger")
            .attr("data-target", function (d, i) {
                return "hover_value_" + i.toString();
            })
            .attr("x", function (d) {
                return 0;
            })
            .attr("y", function (d) {
                return y(d[y_key])-6;
            })
            .attr("width", width)
            .attr("height", 13)
            .on("mouseenter", function (d) {
                var target_id = d3.select(this).attr("data-target");
                d3.select("#"+target_id).style("opacity", 1);
                d3.select("#shadow_"+target_id).style("opacity", 1);
            })
            .on("mouseleave", function (d) {
                var target_id = d3.select(this).attr("data-target");
                d3.select("#"+target_id).style("opacity", 0);
                d3.select("#shadow_"+target_id).style("opacity", 0);
            });

        var compute_text_anchor = function (d) {
            if (x(d[x_key]) < width / 2.0) {
                return 'start';
            } else {
                return 'end';
            }
        };
        var compute_text_text = function (d) {
            return Math.round(d[x_key]).toLocaleString() + " kg CO\u2082";
        };
        var compute_text_transform = function (d) {
            var x_pos = x(d[x_key]);
            if (x_pos < width / 2.0) {
                return "translate("+(x(d[x_key])+7)+","+(y(d[y_key])+4)+")";
            } else {
                return "translate("+(x(d[x_key])-9)+","+(y(d[y_key])+4)+")";
            }
        };

        svg.selectAll("hovertextsshadows")
            .data(data)
            .enter()
            .append("text")
            .style("opacity", 0)
            .style("pointer-events", "none")
            .style("stroke", "white")
            .style("stroke-width", "0.618em")
            .attr("id", function (d, i) {
                return "shadow_hover_value_" + i.toString();
            })
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
449
            .attr("class", "value-text")
bd847bc9   Antoine Goutenoir   Add some interact...
450
451
452
453
454
455
456
457
458
459
460
461
462
463
            .attr("font-size", 10)
            .attr("text-anchor", compute_text_anchor)
            .attr("transform", compute_text_transform)
            .text(compute_text_text);

        svg.selectAll("hovertexts")
            .data(data)
            .enter()
            .append("text")
            .style("opacity", 0)
            .style("pointer-events", "none")
            .attr("id", function (d, i) {
                return "hover_value_" + i.toString();
            })
1f7df547   Antoine Goutenoir   Hack SVG plot dow...
464
            .attr("class", "value-text")
bd847bc9   Antoine Goutenoir   Add some interact...
465
466
467
468
469
470
471
            .attr("font-size", 10)
            .attr("text-anchor", compute_text_anchor)
            .attr("transform", compute_text_transform)
            .text(compute_text_text);


        // Animations
30f014d5   Antoine Goutenoir   Add a lollipop pl...
472
473
474
475
476
477
478
        var animation_duration = 300;
        var animation_delay = 100;

        svg.selectAll("circle")
            .transition()
            .duration(animation_duration)
            .attr("r", "4")
bd847bc9   Antoine Goutenoir   Add some interact...
479
            .delay(function (d, i) { return(i*animation_delay); });
30f014d5   Antoine Goutenoir   Add a lollipop pl...
480

1f7df547   Antoine Goutenoir   Hack SVG plot dow...
481
        svg.selectAll("line.stick")
30f014d5   Antoine Goutenoir   Add a lollipop pl...
482
            .transition()
b7411dd3   Antoine Goutenoir   Improve the plots...
483
            .duration(animation_duration*0.618)
30f014d5   Antoine Goutenoir   Add a lollipop pl...
484
            .attr("x1", function (d) { return x(d[x_key]); })
bd847bc9   Antoine Goutenoir   Add some interact...
485
486
487
488
489
490
491
492
            .delay(function (d, i) { return(i*animation_delay); });

        // Title
        svg.append("g")
            .append('text')
            .attr("transform", "translate("+(-180+width/2.0)+","+(height+111)+")")
            .text("CO\u2082 emissions equivalent (kg) per target city.");

1f7df547   Antoine Goutenoir   Hack SVG plot dow...
493
494
495
496
497
498
499
500
501
502
503
504
        // Download
        $(vizid+"_download").click(function(e){
            e.stopPropagation();
            // Show the values
            $(vizid+" svg .value-text").css("opacity", 1);
            // This possibly won't work on IE and Edge
            saveSvg($(vizid + " svg")[0], "travel_carbon_footprint_{{ estimation.public_id }}.svg");
            // Hide the values
            $(vizid+" svg .value-text").css("opacity", 0);
            return false;
        });

30f014d5   Antoine Goutenoir   Add a lollipop pl...
505
506
507
508
    });

});

39d46569   Antoine Goutenoir   Surpriiiiise ! :p...
509
510
</script>
{% endblock %}