function generatePetal(project,year) {
let project_data = data_dt.filter(x => x.project == project);
if (year != undefined) {
project_data = project_data.filter(x => x.date.getFullYear() == year);
}
let monthOffset = (24*60*60*1000) * 31;
let preDate = new Date(project_data[0].date.getTime() - monthOffset);
let afterDate = new Date(project_data[project_data.length - 1].date.getTime() + monthOffset);
project_data.unshift({date: preDate, issue: 0});
project_data.push({date: afterDate, issue: 0});
let petal = project_data.map(x => [
monthToAngle(x.date.getMonth()),
yearOffset(x.date.getFullYear()) + petalScale(x.issue)
]);
petal.push(...project_data.reverse().map(x => [
monthToAngle(x.date.getMonth()),
yearOffset(x.date.getFullYear()) + petalScale(0)]));
return petal;
}