Leire Aguirre commited on
Commit
b57bdb9
·
1 Parent(s): 3b8a2f3

use viewBox instead width and height

Browse files
Files changed (1) hide show
  1. src/memory.js +1 -4
src/memory.js CHANGED
@@ -195,8 +195,7 @@ export function updateGraph() {
195
 
196
  const svg = d3.select("#graph").select("svg");
197
  svg.selectAll("*").remove();
198
- svg.attr("width", width)
199
- .attr("height", height + legendHeight);
200
 
201
  const treemap = d3.treemap()
202
  .size([width, height])
@@ -456,8 +455,6 @@ export const init_memory_plot = function () {
456
  if (graphContainer) {
457
  const svg = d3.select("#graph")
458
  .append("svg")
459
- .attr("width", 960)
460
- .attr("height", 500);
461
  } else {
462
  console.warn('Graph container not found');
463
  }
 
195
 
196
  const svg = d3.select("#graph").select("svg");
197
  svg.selectAll("*").remove();
198
+ svg.attr("viewBox", [0, 0, width, height + legendHeight]);
 
199
 
200
  const treemap = d3.treemap()
201
  .size([width, height])
 
455
  if (graphContainer) {
456
  const svg = d3.select("#graph")
457
  .append("svg")
 
 
458
  } else {
459
  console.warn('Graph container not found');
460
  }