-
Notifications
You must be signed in to change notification settings - Fork 0
/
weekly.mjs
36 lines (28 loc) · 1.15 KB
/
weekly.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { drawBrainDump } from "./drawBrainDump.mjs";
import { drawDots } from "./drawDots.mjs";
import { drawTopSection } from "./drawTopSection.mjs";
import { prepareDoc } from "./jspdf.factory.mjs";
import { startX, startY, endY, endX, sectionW, approximateLabelH } from "./constants.mjs";
import { drawPlanner } from "./drawPlanner.mjs";
export function getWeeklyDoc({
cellSize = 9.5,
}) {
const doc = prepareDoc();
// Top priorities
const tpBottomY = drawTopSection(doc, startX, startY, sectionW, cellSize)
// Brain dump
const bdY = tpBottomY + cellSize - approximateLabelH;
const bdH = endY - tpBottomY;
drawBrainDump(doc, startX, bdY, sectionW, bdH);
drawDots(doc, startX, bdY + approximateLabelH, sectionW, bdH, cellSize);
// Weekly planner
const pSectionX = startX + sectionW + cellSize;
doc.text(pSectionX, startY, "Week:");
const pLabelY = startY + approximateLabelH;
const pLabelX = pSectionX + 10.5;
doc.line(pLabelX, pLabelY, endX, pLabelY);
const pSectionY = pLabelY + cellSize;
const pSectionH = endY - pSectionY + cellSize;
drawPlanner(doc, pSectionX, pSectionY, sectionW, pSectionH, 1, 7, cellSize);
return doc;
}