Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions lib/xcode-build-times-chart/gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function build_gantt_chart() {
const legend = [
['Build time', build_time],
['Total computation time', compudataion_time],
['Theoretical minimum', theoretical_minimum],
['Theoretical minimum', theoretical_minimum.toFixed(2)],
['Theoretical speedup x', theoretical_speedup.toFixed(2)]
].map(function (t) {
const title = t[0];
Expand All @@ -101,31 +101,27 @@ function build_gantt_chart() {
console.log(legend);

minDate = tasks[0].startDate;

var max_time = 10 * 60 * 1000;
task_name_lengths = tasks_result.names.map( n => n.length )
max_name_length = Math.max(...task_name_lengths)

var gantt = d3.gantt()
.margin({ top : 20, right : 40, bottom : 20, left : 6 * max_name_length })
.taskTypes(tasks_result.names)
.tickFormat("%M:%S")
.timeDomainMode("fixed")
.timeDomain([minDate, new Date(minDate.getTime() + max_time)]);
.timeDomainMode("fit")
updateWindow()

gantt(tasks, legend);

var w = window;
function updateWindow(){
x = w.innerWidth || e.clientWidth || g.clientWidth;
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
x = window.innerWidth || e.clientWidth || g.clientWidth;
y = window.innerHeight|| e.clientHeight|| g.clientHeight;

console.log("Gantt value " + gantt.margin);
var margin = gantt.margin();
gantt
.width(x - margin.left - margin.right - 5)
.height(y - margin.top - margin.bottom - 5)
.redraw(tasks);
}
d3.select(window).on('resize.updatesvg', updateWindow);


};