From 618adcd7f53a80bdfe17486ff1b69b3f308c9b99 Mon Sep 17 00:00:00 2001 From: Jonathan <jonathan.leon@pandorafms.com> Date: Fri, 3 May 2024 13:37:42 +0200 Subject: [PATCH] #13479 fix style sunburst --- pandora_console/include/graphs/pandora.d3.js | 22 +++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/graphs/pandora.d3.js b/pandora_console/include/graphs/pandora.d3.js index 881899a1df..b6a7c4f0ce 100644 --- a/pandora_console/include/graphs/pandora.d3.js +++ b/pandora_console/include/graphs/pandora.d3.js @@ -985,19 +985,31 @@ function sunburst(recipient, data, width, height, tooltip = true) { .attr("x", function(d) { if (typeof d.show_name != "undefined" && d.show_name) { if (calculate_angle(d) < 20) { - return (d.name.length + 15) * -1; + return (d.name.length + 10) * -1; } else { - return (d.name.length + 25) * -1; + return (d.name.length + 20) * -1; } } }) - .attr("dx", "6") // margin + // margin + .attr("dx", function(d) { + if (d.type === "central_service") { + return ""; + } + return "6"; + }) .attr("dy", function(d) { if (d.type === "central_service") { - return "-7em"; + return ""; } return ".35em"; }) // vertical-align + .attr("y", function(d) { + if (d.type === "central_service") { + return "-11.75%"; + } + return ""; + }) // vertical-align .attr("opacity", function(d) { if (typeof d.show_name != "undefined" && d.show_name) { return 1; @@ -1007,7 +1019,7 @@ function sunburst(recipient, data, width, height, tooltip = true) { }) .text(function(d) { if (d.name.length > 20) { - var resta = d.name.length - 12; + var resta = d.name.length - 17; var string = d.name.slice( d.name.length / 2 - resta / 2, d.name.length / 2 + resta / 2