Compare commits

...

2 Commits

Author SHA1 Message Date
Gregory Trullemans ae2239d11b Update JavaScript font-size computing for DAG
continuous-integration/drone/push Build is passing Details
2022-01-13 19:56:21 +01:00
Gregory Trullemans af50437ab9 Update dashboard 2022-01-13 18:51:07 +01:00
2 changed files with 17 additions and 2 deletions

View File

@ -27,6 +27,20 @@
<script src="{% static "js/plugins/D3-dag/d3.min.js" %}"></script>
<script src="{% static "js/plugins/D3-dag/d3-dag.0.8.2.min.js" %}"></script>
<script>
function compute_font_size(string)
{
number_of_spaces = string.split(/ /g).length - 1;
number_of_small_char = (string.split(/f/g).length - 1)
+ (string.split(/i/g).length - 1)
+ (string.split(/j/g).length - 1)
+ (string.split(/l/g).length - 1)
+ (string.split(/t/g).length - 1)
+ (string.split(/\//g).length - 1);
number_of_big_char = (string.split(/½/g).length - 1)
+ (string.split(/¾/g).length - 1)
return string.length + number_of_big_char - (number_of_spaces + (number_of_small_char / 2));
}
(async () => {
const data = [
{% for key, value in node_dict.items %}
@ -148,7 +162,8 @@
// .attr("font-size", "8")
// .attr("font-size", function(d) { return Math.min(2 * d.r, (2 * d.r - 8) / this.getComputedTextLength() * 24) + "px"; })
// .attr("font-size", function(d) {return (1 / d.data.id.length) * 60;})
.attr("font-size", function(d) {return (1 / d.data.id.replace(/ /g,'').length) * 60;})
// .attr("font-size", set_font_size(d.data.id))
.attr("font-size", function(d) {return (1 / compute_font_size(d.data.id)) * 60;})
.attr("font-weight", "bold")
.attr("font-family", "sans-serif")
.attr("text-anchor", "middle")

View File

@ -11,7 +11,7 @@
<h4 class=""><i class="icon-primary fal fa-laugh-wink"></i> Hi {{ user.username }} !</h4>
</div>
<div class="card-body">
Welcome to Ultron v0.42 <span class="text-muted">(last update : 9-1-2022)</span><br />
Welcome to Ultron v0.43 <span class="text-muted">(last update : 13-1-2022)</span><br />
This application is there to help us manage the gymnasts (evolution, evaluation, routine, scores, ...). It is not perfect so feel free to make improvement proposals, bug reports, … by sending me an <a href="mailto:gregory@flyingacrobaticstrampoline.be">email</a>.<br/>
<br/>
<span class="text-danger"><b>Gelukkig nieuwjaar 2022 en mijn beste wensen!</b></span>