diff --git a/docs/radar.js b/docs/radar.js index 42fcbc9a..65f40a80 100644 --- a/docs/radar.js +++ b/docs/radar.js @@ -35,6 +35,13 @@ function radar_visualization(config) { config.links_in_new_tabs = ("links_in_new_tabs" in config) ? config.links_in_new_tabs : true; config.repo_url = config.repo_url || '#'; config.print_ring_descriptions_table = ("print_ring_descriptions_table" in config) ? config.print_ring_descriptions_table : false; + config.legend_offset = config.legend_offset || [ + { x: 450, y: 90 }, + { x: -675, y: 90 }, + { x: -675, y: -310 }, + { x: 450, y: -310 } + ] + config.title_offset = config.title_offset || { x: -675, y: -420 }; config.footer_offset = config.footer_offset || { x: -155, y: 450 }; config.legend_column_width = config.legend_column_width || 140 @@ -69,16 +76,6 @@ function radar_visualization(config) { { radius: 400 } ]; - const title_offset = - { x: -675, y: -420 }; - - const legend_offset = [ - { x: 450, y: 90 }, - { x: -675, y: 90 }, - { x: -675, y: -310 }, - { x: 450, y: -310 } - ]; - function polar(cartesian) { var x = cartesian.x; var y = cartesian.y; @@ -282,8 +279,8 @@ function radar_visualization(config) { dy = dy + 36 + segmented[quadrant][ring-1].length * 12; } return translate( - legend_offset[quadrant].x + dx, - legend_offset[quadrant].y + dy + config.legend_offset[quadrant].x + dx, + config.legend_offset[quadrant].y + dy ); } @@ -293,7 +290,7 @@ function radar_visualization(config) { // title radar.append("a") .attr("href", config.repo_url) - .attr("transform", translate(title_offset.x, title_offset.y)) + .attr("transform", translate(config.title_offset.x, config.title_offset.y)) .append("text") .attr("class", "hover-underline") // add class for hover effect .text(config.title) @@ -304,7 +301,7 @@ function radar_visualization(config) { // date radar .append("text") - .attr("transform", translate(title_offset.x, title_offset.y + 20)) + .attr("transform", translate(config.title_offset.x, config.title_offset.y + 20)) .text(config.date || "") .style("font-family", config.font_family) .style("font-size", "14") @@ -323,8 +320,8 @@ function radar_visualization(config) { for (var quadrant = 0; quadrant < 4; quadrant++) { legend.append("text") .attr("transform", translate( - legend_offset[quadrant].x, - legend_offset[quadrant].y - 45 + config.legend_offset[quadrant].x, + config.legend_offset[quadrant].y - 45 )) .text(config.quadrants[quadrant].name) .style("font-family", config.font_family)