Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
desafinadude committed Dec 3, 2024
1 parent 9d822fa commit 1b0a02b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions d3_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,17 @@ document.addEventListener('DOMContentLoaded', function () {


function drawChart(id, data, title, colors = [chart_colors.donut1, chart_colors.donut2, chart_colors.donut3]) {


const container = d3.select(`#${id}`);
const rect = container.node().getBoundingClientRect();
const width = rect.width;
const height = rect.height;
const margin = { top: 0, right: 0, bottom: 0, left: 0 };
const radius = Math.min(width, height) / 2 - Math.max(margin.top, margin.right);

console.log('drawing', rect, width, height, radius);


// Set color scale
let color = d3.scaleOrdinal()
Expand Down Expand Up @@ -960,7 +965,7 @@ document.addEventListener('DOMContentLoaded', function () {
}



drawChart('fs', inside_outside_blank, 'FS');

drawChart('lp', inside_outside_blank, 'LP');

Expand Down Expand Up @@ -1396,8 +1401,6 @@ document.addEventListener('DOMContentLoaded', function () {
if (section_label == 'outdoor-facilities') {

console.log(section_label);

drawChart('fs', inside_outside_blank, 'FS');

fadeChart('.province-chart', 1);
activeData.fs = fs_inside_outside;
Expand Down

0 comments on commit 1b0a02b

Please sign in to comment.