@boldreports/javascript-reporting-extensions 9.1.9 → 9.1.11
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.
- package/package.json +1 -1
- package/shape.reportitem.js +17 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boldreports/javascript-reporting-extensions",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.11",
|
|
4
4
|
"description": "The Bold Reports Extensions by Syncfusion contains scripts and themes for barcode report item to be integrated in JavaScript Report Viewer and JavaScript Report Designer for enterprise web development(HTML5)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/shape.reportitem.js
CHANGED
|
@@ -105,7 +105,7 @@ var EJShape = (function () {
|
|
|
105
105
|
y: point.x * sinValue + point.y * cosValue
|
|
106
106
|
}); });
|
|
107
107
|
var pathData = " M " + rotatedEllipsePoints[0].x + " " + rotatedEllipsePoints[0].y + "\n A " + rx + " " + ry + " " + shapeInfo.angle + " 0 1 " + rotatedEllipsePoints[2].x + " " + rotatedEllipsePoints[2].y + "\n A " + rx + " " + ry + " " + shapeInfo.angle + " 0 1 " + rotatedEllipsePoints[0].x + " " + rotatedEllipsePoints[0].y + "\n Z";
|
|
108
|
-
var viewBox = -rotatedWidth / 2 + " " + -rotatedHeight / 2 + " " +
|
|
108
|
+
var viewBox = -rotatedWidth / 2 + " " + -rotatedHeight / 2 + " " + rotatedWidth + " " + rotatedHeight;
|
|
109
109
|
this.renderSvg(target, pathData, viewBox, shapeInfo);
|
|
110
110
|
};
|
|
111
111
|
EJShape.prototype.renderRectangle = function (target, shapeInfo) {
|
|
@@ -114,8 +114,6 @@ var EJShape = (function () {
|
|
|
114
114
|
var angleRad = (parseFloat(shapeInfo.angle) % 360 * Math.PI) / 180;
|
|
115
115
|
var sinValue = Math.sin(angleRad);
|
|
116
116
|
var cosValue = Math.cos(angleRad);
|
|
117
|
-
var rotatedWidth = Math.abs(shapeInfo.svgWidth * cosValue) + Math.abs(shapeInfo.svgHeight * sinValue);
|
|
118
|
-
var rotatedHeight = Math.abs(shapeInfo.svgWidth * sinValue) + Math.abs(shapeInfo.svgHeight * cosValue);
|
|
119
117
|
var corners = [
|
|
120
118
|
{ x: -halfWidth, y: -halfHeight },
|
|
121
119
|
{ x: halfWidth, y: -halfHeight },
|
|
@@ -127,7 +125,7 @@ var EJShape = (function () {
|
|
|
127
125
|
y: corner.x * sinValue + corner.y * cosValue
|
|
128
126
|
}); });
|
|
129
127
|
var pathData = this.getPathData(rotatedPoints);
|
|
130
|
-
var viewBox =
|
|
128
|
+
var viewBox = this.getViewBox(rotatedPoints);
|
|
131
129
|
this.renderSvg(target, pathData, viewBox, shapeInfo);
|
|
132
130
|
};
|
|
133
131
|
EJShape.prototype.renderTriangle = function (target, shapeInfo) {
|
|
@@ -284,8 +282,8 @@ var EJShape = (function () {
|
|
|
284
282
|
for (var index = 0; index < 8; index++) {
|
|
285
283
|
var theta = (Math.PI / 8) + (Math.PI * 2 / 8) * index;
|
|
286
284
|
points.push({
|
|
287
|
-
x:
|
|
288
|
-
y:
|
|
285
|
+
x: maxRadiusX + Math.cos(theta) * maxRadiusX,
|
|
286
|
+
y: maxRadiusY + Math.sin(theta) * maxRadiusY
|
|
289
287
|
});
|
|
290
288
|
}
|
|
291
289
|
}
|
|
@@ -293,8 +291,8 @@ var EJShape = (function () {
|
|
|
293
291
|
for (var index = 0; index < 5; index++) {
|
|
294
292
|
var theta = (-Math.PI / 2) + (Math.PI * 2 / 5) * index;
|
|
295
293
|
points.push({
|
|
296
|
-
x:
|
|
297
|
-
y:
|
|
294
|
+
x: maxRadiusX + Math.cos(theta) * maxRadiusX,
|
|
295
|
+
y: maxRadiusY + Math.sin(theta) * maxRadiusY
|
|
298
296
|
});
|
|
299
297
|
}
|
|
300
298
|
}
|
|
@@ -302,14 +300,14 @@ var EJShape = (function () {
|
|
|
302
300
|
for (var index = 0; index < 6; index++) {
|
|
303
301
|
var theta = (Math.PI / 3) * index;
|
|
304
302
|
points.push({
|
|
305
|
-
x:
|
|
306
|
-
y:
|
|
303
|
+
x: maxRadiusX + Math.cos(theta) * maxRadiusX,
|
|
304
|
+
y: maxRadiusY + Math.sin(theta) * maxRadiusY
|
|
307
305
|
});
|
|
308
306
|
}
|
|
309
307
|
}
|
|
310
308
|
var rotatedPoints = points.map(function (point) { return ({
|
|
311
|
-
x:
|
|
312
|
-
y:
|
|
309
|
+
x: (point.x - maxRadiusX) * cosValue - (point.y - maxRadiusY) * sinValue + maxRadiusX,
|
|
310
|
+
y: (point.x - maxRadiusX) * sinValue + (point.y - maxRadiusY) * cosValue + maxRadiusY
|
|
313
311
|
}); });
|
|
314
312
|
var pathData = this.getPathData(rotatedPoints);
|
|
315
313
|
var viewBox = this.getViewBox(rotatedPoints);
|
|
@@ -324,10 +322,10 @@ var EJShape = (function () {
|
|
|
324
322
|
return pathData;
|
|
325
323
|
};
|
|
326
324
|
EJShape.prototype.getViewBox = function (points) {
|
|
327
|
-
var minX = Math.
|
|
328
|
-
var maxX = Math.
|
|
329
|
-
var minY = Math.
|
|
330
|
-
var maxY = Math.
|
|
325
|
+
var minX = Math.min.apply(Math, points.map(function (p) { return p.x; }));
|
|
326
|
+
var maxX = Math.max.apply(Math, points.map(function (p) { return p.x; }));
|
|
327
|
+
var minY = Math.min.apply(Math, points.map(function (p) { return p.y; }));
|
|
328
|
+
var maxY = Math.max.apply(Math, points.map(function (p) { return p.y; }));
|
|
331
329
|
var viewBox = minX + " " + minY + " " + (maxX - minX) + " " + (maxY - minY);
|
|
332
330
|
return viewBox;
|
|
333
331
|
};
|
|
@@ -341,7 +339,7 @@ var EJShape = (function () {
|
|
|
341
339
|
var targetId = target.attr('id');
|
|
342
340
|
this.setAttributes(svg, {
|
|
343
341
|
'width': shapeInfo.svgWidth + "px", 'height': shapeInfo.svgHeight + "px",
|
|
344
|
-
'viewBox': viewBox, 'id': targetId + "_svg", 'preserveAspectRatio': '
|
|
342
|
+
'viewBox': viewBox, 'id': targetId + "_svg", 'preserveAspectRatio': 'none'
|
|
345
343
|
});
|
|
346
344
|
this.setAttributes(clipPathElement, { 'd': pathData });
|
|
347
345
|
this.setAttributes(clipPath, { 'id': targetId + "_clip_path", 'clipPathUnits': 'userSpaceOnUse' });
|
|
@@ -692,7 +690,7 @@ var EJShape = (function () {
|
|
|
692
690
|
borderWidth = this.getBorderWidth(customJson.Border.Default, false);
|
|
693
691
|
}
|
|
694
692
|
var totalBorderWidth = (topBorderWidth || borderWidth) + (bottomBorderWidth || borderWidth);
|
|
695
|
-
return height -
|
|
693
|
+
return height - totalBorderWidth;
|
|
696
694
|
};
|
|
697
695
|
EJShape.prototype.getSvgWidth = function (customJson) {
|
|
698
696
|
var width = 0;
|
|
@@ -712,7 +710,7 @@ var EJShape = (function () {
|
|
|
712
710
|
borderWidth = this.getBorderWidth(customJson.Border.Default, false);
|
|
713
711
|
}
|
|
714
712
|
var totalBorderWidth = (leftBorderWidth || borderWidth) + (rightBorderWidth || borderWidth);
|
|
715
|
-
return width -
|
|
713
|
+
return width - totalBorderWidth;
|
|
716
714
|
};
|
|
717
715
|
EJShape.prototype.getBorderWidth = function (border, isDesigner) {
|
|
718
716
|
var borderWidth = 0;
|