From 209b9813357b09ba09b870ef3103dfa044e9234a Mon Sep 17 00:00:00 2001 From: Pascal van der Horst Date: Thu, 19 Dec 2024 21:22:12 +0100 Subject: [PATCH] radar.js aangepast voor application insight click traicking --- radar.js | 90 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/radar.js b/radar.js index f845c85..42f8e74 100644 --- a/radar.js +++ b/radar.js @@ -142,19 +142,19 @@ function radar_visualization(config) { y: rings[3].radius * quadrants[quadrant].factor_y }; return { - clipx: function(d) { + clipx: function (d) { var c = bounded_box(d, cartesian_min, cartesian_max); var p = bounded_ring(polar(c), polar_min.r + 15, polar_max.r - 15); d.x = cartesian(p).x; // adjust data too! return d.x; }, - clipy: function(d) { + clipy: function (d) { var c = bounded_box(d, cartesian_min, cartesian_max); var p = bounded_ring(polar(c), polar_min.r + 15, polar_max.r - 15); d.y = cartesian(p).y; // adjust data too! return d.y; }, - random: function() { + random: function () { return cartesian({ t: random_between(polar_min.t, polar_max.t), r: normal_between(polar_min.r, polar_max.r) @@ -183,17 +183,17 @@ function radar_visualization(config) { segmented[quadrant][ring] = []; } } - for (var i=0; i 2 ? "8px" : "9px"; }) + .style("font-size", function (d) { return blip_text.length > 2 ? "8px" : "9px"; }) .style("pointer-events", "none") .style("user-select", "none"); } @@ -462,7 +472,7 @@ function radar_visualization(config) { // make sure that blips stay inside their segment function ticked() { - blips.attr("transform", function(d) { + blips.attr("transform", function (d) { return translate(d.segment.clipx(d), d.segment.clipy(d)); }) }