@measurequick/measurequick-report-generator 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +9 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -85,7 +85,7 @@ function printBodyData(geolocationMap) {
85
85
  }
86
86
 
87
87
  function printSingleBodySection(dataPoints, xLeft, xRight, y) {
88
- var yTop = y;
88
+ var yTop = y + .22;
89
89
  var s = .2;
90
90
  var dataPoint;
91
91
  var val;
@@ -113,9 +113,12 @@ function printSingleBodySection(dataPoints, xLeft, xRight, y) {
113
113
  } else {
114
114
  dataPoint = dataPoints[key];
115
115
  val = reportData.values[key];
116
- units = Array.isArray(dataPoint.units) ? `${dataPoint.units[0]} / ${dataPoint.units[1]}` : dataPoint.units;
116
+ units = "";
117
+ if (dataPoint.hasOwnProperty("units")) {
118
+ units = Array.isArray(dataPoint.units) ? ` (${dataPoint.units[0]} / ${dataPoint.units[1]})` : ` (${dataPoint.units})`;
119
+ }
117
120
  text = dataPoint.hasOwnProperty("secondaryValue") ? `${val} / ${reportData.values[dataPoint.secondaryValue]}` : val;
118
- doc.text(`${dataPoint.label} (${units}):`, xLeft, y);
121
+ doc.text(`${dataPoint.label}${units}:`, xLeft, y);
119
122
  doc.text(text, alignRight(text, xRight, 8), y);
120
123
  doc.addImage(graphics[reportData.rangeIcons[key]], "JPEG", xRight + .05, y - .12, .16, .16);
121
124
  doc.addImage(graphics[reportData.toolIcons[key]], "JPEG", xRight+.25, y - .12, .16, .16);
@@ -144,10 +147,10 @@ function printFooterData(techName, profilePicture, companyLogo) {
144
147
  if (companyLogo) printCompanyLogo("footer", companyLogo);
145
148
  doc.setTextColor(255, 255, 255);
146
149
  var s = .2;
147
- var x = 1;
148
- var y = 7;
150
+ var x = .2;
151
+ var y = 8;
149
152
  var key;
150
- for (let key in reportData.footerData) {
153
+ for (let key in templates.footerData) {
151
154
  doc.text(`${reportData.footerData[key]}`, x, y);
152
155
  y += s;
153
156
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measurequick/measurequick-report-generator",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Generates PDF documents for various MeasureQuick applications.",
5
5
  "main": "index.js",
6
6
  "scripts": {