abstract-image 3.1.3 → 3.2.3
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/CHANGELOG.md +27 -21
- package/LICENSE +21 -21
- package/README.md +73 -71
- package/lib/__stories__/react-svg-export/example-1.stories.d.ts.map +1 -1
- package/lib/__stories__/react-svg-export/example-1.stories.js +1 -1
- package/lib/__stories__/react-svg-export/example-1.stories.js.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.js +379 -379
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.d.ts.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.js +124 -124
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.js.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.js +55 -55
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.js +89 -89
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.js +79 -79
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.js +99 -99
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.d.ts.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.js +139 -139
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.js.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.js +64 -64
- package/lib/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.js.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.js +24 -24
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.js +27 -27
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.js.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-group.d.ts.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-group.js +32 -32
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-group.js.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-line.js +20 -20
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polygon.js +34 -34
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-polyline.js +26 -26
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.js +20 -20
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.d.ts.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.js +63 -63
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.js.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text.js +27 -27
- package/lib/exporters/__tests__/eps-export-image/test-defs/eps-text.js.map +1 -1
- package/lib/exporters/__tests__/exception/react-svg-direction-exception.test.js +2 -2
- package/lib/exporters/__tests__/exception/react-svg-direction-exception.test.js.map +1 -1
- package/lib/exporters/__tests__/exception/svg-direction-exception.test.js +2 -2
- package/lib/exporters/__tests__/exception/svg-direction-exception.test.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.d.ts +3 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.d.ts.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.js +35 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.js.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.js +4 -4
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.d.ts +3 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.d.ts.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.js +36 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.js.map +1 -0
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.js +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.js.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.js +2 -2
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-binary.js +2 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-binary.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.js +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-group.d.ts.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-group.js +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-group.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.d.ts +3 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.d.ts.map +1 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.js +35 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.js.map +1 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.d.ts.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.js +4 -4
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.js.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.d.ts +3 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.d.ts.map +1 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.js +36 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.js.map +1 -0
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text.d.ts.map +1 -1
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text.js +2 -2
- package/lib/exporters/__tests__/svg-export-image/test-defs/svg-text.js.map +1 -1
- package/lib/exporters/react-svg-export-image.js +4 -5
- package/lib/exporters/react-svg-export-image.js.map +1 -1
- package/lib/exporters/svg-export-image.d.ts.map +1 -1
- package/lib/exporters/svg-export-image.js +30 -35
- package/lib/exporters/svg-export-image.js.map +1 -1
- package/lib/model/component.d.ts +3 -2
- package/lib/model/component.d.ts.map +1 -1
- package/lib/model/component.js +12 -11
- package/lib/model/component.js.map +1 -1
- package/package.json +2 -2
- package/src/__stories__/react-svg-export/example-1.stories.tsx +54 -53
- package/src/__stories__/svg-export/example-1.stories.tsx +42 -42
- package/src/exporters/__tests__/dxf2d-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/dxf2d-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-ellipse.ts +405 -405
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-group.ts +166 -165
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-line.ts +80 -80
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polygon.ts +114 -114
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-polyline.ts +103 -103
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-rectangle.ts +125 -125
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text-growth-directions.ts +214 -210
- package/src/exporters/__tests__/dxf2d-export-image/test-defs/dxf2d-text.ts +97 -96
- package/src/exporters/__tests__/eps-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/eps-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-ellipse.ts +50 -50
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-empty-text.ts +60 -59
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-group.ts +74 -73
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-line.ts +45 -45
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-polygon.ts +65 -65
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-polyline.ts +58 -58
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-rectangle.ts +46 -46
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-text-growth-directions.ts +138 -134
- package/src/exporters/__tests__/eps-export-image/test-defs/eps-text.ts +60 -59
- package/src/exporters/__tests__/exception/png-unsupported.test.tsx +25 -25
- package/src/exporters/__tests__/exception/react-svg-direction-exception.test.tsx +65 -63
- package/src/exporters/__tests__/exception/svg-direction-exception.test.tsx +65 -63
- package/src/exporters/__tests__/png-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/png-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/png-export-image/test-defs/png-createPNG.tsx +26 -26
- package/src/exporters/__tests__/react-svg-export-image/export-test-def.tsx +13 -13
- package/src/exporters/__tests__/react-svg-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary-png.tsx +27 -27
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-binary.tsx +26 -26
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx +60 -59
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-ellipse.tsx +28 -28
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-empty-text.tsx +35 -34
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-group.tsx +44 -43
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-line.tsx +26 -26
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polygon.tsx +32 -32
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-polyline.tsx +33 -33
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-rectangle.tsx +27 -27
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-subimage.tsx +36 -35
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-bold.tsx +50 -0
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-growth-directions.tsx +80 -76
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-italic.tsx +65 -0
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text-sub.tsx +35 -34
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-text.tsx +35 -34
- package/src/exporters/__tests__/svg-export-image/export-test-def.ts +11 -11
- package/src/exporters/__tests__/svg-export-image/export.test.tsx +13 -13
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-binary.tsx +26 -26
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-ellipse.ts +27 -27
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-empty-text.ts +34 -33
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-group.ts +44 -43
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-line.ts +26 -26
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-polygon.ts +32 -32
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-polyline.ts +33 -33
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-rectangle.ts +27 -27
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-bold.ts +50 -0
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-growth-directions.ts +80 -76
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text-italic.ts +65 -0
- package/src/exporters/__tests__/svg-export-image/test-defs/svg-text.ts +35 -34
- package/src/exporters/dxf2d-export-image.ts +218 -218
- package/src/exporters/eps-export-image.ts +154 -154
- package/src/exporters/index.ts +3 -3
- package/src/exporters/png-export-image.ts +12 -12
- package/src/exporters/react-svg-export-image.tsx +301 -298
- package/src/exporters/svg-export-image.ts +296 -334
- package/src/index.ts +11 -11
- package/src/model/__tests__/color/export-test-def.ts +13 -13
- package/src/model/__tests__/color/export.test.tsx +14 -14
- package/src/model/__tests__/color/test-defs/color-from-string.ts +46 -46
- package/src/model/__tests__/color/test-defs/color-to-string.ts +35 -35
- package/src/model/__tests__/color/test-defs/color-undefined-2.ts +8 -8
- package/src/model/__tests__/color/test-defs/color-undefined.ts +8 -8
- package/src/model/abstract-image.ts +25 -25
- package/src/model/color.ts +52 -52
- package/src/model/component.ts +266 -279
- package/src/model/index.ts +5 -5
- package/src/model/point.ts +11 -11
- package/src/model/size.ts +11 -11
- package/lib/exporters/__tests__/svg-export-image.test.d.ts +0 -2
- package/lib/exporters/__tests__/svg-export-image.test.d.ts.map +0 -1
- package/lib/exporters/__tests__/svg-export-image.test.js +0 -35
- package/lib/exporters/__tests__/svg-export-image.test.js.map +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createPolygon(
|
|
6
|
-
[
|
|
7
|
-
AbstractImage.createPoint(110, 10),
|
|
8
|
-
AbstractImage.createPoint(100, 20),
|
|
9
|
-
AbstractImage.createPoint(110, 30),
|
|
10
|
-
AbstractImage.createPoint(100, 40),
|
|
11
|
-
AbstractImage.createPoint(110, 50),
|
|
12
|
-
],
|
|
13
|
-
AbstractImage.blue,
|
|
14
|
-
2,
|
|
15
|
-
AbstractImage.red
|
|
16
|
-
),
|
|
17
|
-
];
|
|
18
|
-
const image = AbstractImage.createAbstractImage(
|
|
19
|
-
AbstractImage.createPoint(0, 0),
|
|
20
|
-
AbstractImage.createSize(400, 400),
|
|
21
|
-
AbstractImage.white,
|
|
22
|
-
components
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const svg = AbstractImage.createSVG(image);
|
|
26
|
-
|
|
27
|
-
export const test: ExportTestDef = {
|
|
28
|
-
name: "svg polygon",
|
|
29
|
-
abstractImage: svg,
|
|
30
|
-
expectedImage:
|
|
31
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><polygon points="110,10 100,20 110,30 100,40 110,50" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-width="2" fill="rgb(255, 0, 0)" fill-opacity="1"></polygon></svg>',
|
|
32
|
-
};
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createPolygon(
|
|
6
|
+
[
|
|
7
|
+
AbstractImage.createPoint(110, 10),
|
|
8
|
+
AbstractImage.createPoint(100, 20),
|
|
9
|
+
AbstractImage.createPoint(110, 30),
|
|
10
|
+
AbstractImage.createPoint(100, 40),
|
|
11
|
+
AbstractImage.createPoint(110, 50),
|
|
12
|
+
],
|
|
13
|
+
AbstractImage.blue,
|
|
14
|
+
2,
|
|
15
|
+
AbstractImage.red
|
|
16
|
+
),
|
|
17
|
+
];
|
|
18
|
+
const image = AbstractImage.createAbstractImage(
|
|
19
|
+
AbstractImage.createPoint(0, 0),
|
|
20
|
+
AbstractImage.createSize(400, 400),
|
|
21
|
+
AbstractImage.white,
|
|
22
|
+
components
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const svg = AbstractImage.createSVG(image);
|
|
26
|
+
|
|
27
|
+
export const test: ExportTestDef = {
|
|
28
|
+
name: "svg polygon",
|
|
29
|
+
abstractImage: svg,
|
|
30
|
+
expectedImage:
|
|
31
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><polygon points="110,10 100,20 110,30 100,40 110,50" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-width="2" fill="rgb(255, 0, 0)" fill-opacity="1"></polygon></svg>',
|
|
32
|
+
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createPolyLine(
|
|
6
|
-
[
|
|
7
|
-
AbstractImage.createPoint(10, 40),
|
|
8
|
-
AbstractImage.createPoint(20, 30),
|
|
9
|
-
AbstractImage.createPoint(30, 40),
|
|
10
|
-
AbstractImage.createPoint(40, 30),
|
|
11
|
-
AbstractImage.createPoint(50, 40),
|
|
12
|
-
AbstractImage.createPoint(60, 30),
|
|
13
|
-
AbstractImage.createPoint(70, 40),
|
|
14
|
-
],
|
|
15
|
-
AbstractImage.black,
|
|
16
|
-
2
|
|
17
|
-
),
|
|
18
|
-
];
|
|
19
|
-
const image = AbstractImage.createAbstractImage(
|
|
20
|
-
AbstractImage.createPoint(0, 0),
|
|
21
|
-
AbstractImage.createSize(400, 400),
|
|
22
|
-
AbstractImage.white,
|
|
23
|
-
components
|
|
24
|
-
);
|
|
25
|
-
|
|
26
|
-
const svg = AbstractImage.createSVG(image);
|
|
27
|
-
|
|
28
|
-
export const test: ExportTestDef = {
|
|
29
|
-
name: "svg polyline",
|
|
30
|
-
abstractImage: svg,
|
|
31
|
-
expectedImage:
|
|
32
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><polyline fill="none" points="10,40 20,30 30,40 40,30 50,40 60,30 70,40" stroke="rgb(0, 0, 0)" stroke-opacity="1" stroke-width="2"></polyline></svg>',
|
|
33
|
-
};
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createPolyLine(
|
|
6
|
+
[
|
|
7
|
+
AbstractImage.createPoint(10, 40),
|
|
8
|
+
AbstractImage.createPoint(20, 30),
|
|
9
|
+
AbstractImage.createPoint(30, 40),
|
|
10
|
+
AbstractImage.createPoint(40, 30),
|
|
11
|
+
AbstractImage.createPoint(50, 40),
|
|
12
|
+
AbstractImage.createPoint(60, 30),
|
|
13
|
+
AbstractImage.createPoint(70, 40),
|
|
14
|
+
],
|
|
15
|
+
AbstractImage.black,
|
|
16
|
+
2
|
|
17
|
+
),
|
|
18
|
+
];
|
|
19
|
+
const image = AbstractImage.createAbstractImage(
|
|
20
|
+
AbstractImage.createPoint(0, 0),
|
|
21
|
+
AbstractImage.createSize(400, 400),
|
|
22
|
+
AbstractImage.white,
|
|
23
|
+
components
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const svg = AbstractImage.createSVG(image);
|
|
27
|
+
|
|
28
|
+
export const test: ExportTestDef = {
|
|
29
|
+
name: "svg polyline",
|
|
30
|
+
abstractImage: svg,
|
|
31
|
+
expectedImage:
|
|
32
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><polyline fill="none" points="10,40 20,30 30,40 40,30 50,40 60,30 70,40" stroke="rgb(0, 0, 0)" stroke-opacity="1" stroke-width="2"></polyline></svg>',
|
|
33
|
+
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createRectangle(
|
|
6
|
-
AbstractImage.createPoint(10, 50),
|
|
7
|
-
AbstractImage.createPoint(50, 60),
|
|
8
|
-
AbstractImage.blue,
|
|
9
|
-
2,
|
|
10
|
-
AbstractImage.red
|
|
11
|
-
),
|
|
12
|
-
];
|
|
13
|
-
const image = AbstractImage.createAbstractImage(
|
|
14
|
-
AbstractImage.createPoint(0, 0),
|
|
15
|
-
AbstractImage.createSize(400, 400),
|
|
16
|
-
AbstractImage.white,
|
|
17
|
-
components
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const svg = AbstractImage.createSVG(image);
|
|
21
|
-
|
|
22
|
-
export const test: ExportTestDef = {
|
|
23
|
-
name: "svg rectangle",
|
|
24
|
-
abstractImage: svg,
|
|
25
|
-
expectedImage:
|
|
26
|
-
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><rect x="10" y="50" width="40" height="10" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-width="2" fill="rgb(255, 0, 0)" fill-opacity="1"></rect></svg>',
|
|
27
|
-
};
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createRectangle(
|
|
6
|
+
AbstractImage.createPoint(10, 50),
|
|
7
|
+
AbstractImage.createPoint(50, 60),
|
|
8
|
+
AbstractImage.blue,
|
|
9
|
+
2,
|
|
10
|
+
AbstractImage.red
|
|
11
|
+
),
|
|
12
|
+
];
|
|
13
|
+
const image = AbstractImage.createAbstractImage(
|
|
14
|
+
AbstractImage.createPoint(0, 0),
|
|
15
|
+
AbstractImage.createSize(400, 400),
|
|
16
|
+
AbstractImage.white,
|
|
17
|
+
components
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const svg = AbstractImage.createSVG(image);
|
|
21
|
+
|
|
22
|
+
export const test: ExportTestDef = {
|
|
23
|
+
name: "svg rectangle",
|
|
24
|
+
abstractImage: svg,
|
|
25
|
+
expectedImage:
|
|
26
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><rect x="10" y="50" width="40" height="10" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-width="2" fill="rgb(255, 0, 0)" fill-opacity="1"></rect></svg>',
|
|
27
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createText(
|
|
6
|
+
AbstractImage.createPoint(10, 10),
|
|
7
|
+
"Hello World",
|
|
8
|
+
"Arial",
|
|
9
|
+
12,
|
|
10
|
+
AbstractImage.black,
|
|
11
|
+
"bold",
|
|
12
|
+
0,
|
|
13
|
+
"center",
|
|
14
|
+
"right",
|
|
15
|
+
"down",
|
|
16
|
+
2,
|
|
17
|
+
AbstractImage.red,
|
|
18
|
+
false
|
|
19
|
+
),
|
|
20
|
+
AbstractImage.createText(
|
|
21
|
+
AbstractImage.createPoint(40, 40),
|
|
22
|
+
"Hello World",
|
|
23
|
+
"Arial",
|
|
24
|
+
12,
|
|
25
|
+
AbstractImage.black,
|
|
26
|
+
"mediumBold",
|
|
27
|
+
0,
|
|
28
|
+
"center",
|
|
29
|
+
"right",
|
|
30
|
+
"down",
|
|
31
|
+
2,
|
|
32
|
+
AbstractImage.red,
|
|
33
|
+
false
|
|
34
|
+
),
|
|
35
|
+
];
|
|
36
|
+
const image = AbstractImage.createAbstractImage(
|
|
37
|
+
AbstractImage.createPoint(0, 0),
|
|
38
|
+
AbstractImage.createSize(400, 400),
|
|
39
|
+
AbstractImage.white,
|
|
40
|
+
components
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const svg = AbstractImage.createSVG(image);
|
|
44
|
+
|
|
45
|
+
export const test: ExportTestDef = {
|
|
46
|
+
name: "svg text bold",
|
|
47
|
+
abstractImage: svg,
|
|
48
|
+
expectedImage:
|
|
49
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 40 40)"><tspan x="40" y="52" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 40 40)"><tspan x="40" y="52" height="12px">Hello World</tspan></text></svg>',
|
|
50
|
+
};
|
|
@@ -1,76 +1,80 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createText(
|
|
6
|
-
AbstractImage.createPoint(10, 10),
|
|
7
|
-
"Hello World",
|
|
8
|
-
"Arial",
|
|
9
|
-
12,
|
|
10
|
-
AbstractImage.black,
|
|
11
|
-
"bold",
|
|
12
|
-
0,
|
|
13
|
-
"center",
|
|
14
|
-
"left",
|
|
15
|
-
"up",
|
|
16
|
-
2,
|
|
17
|
-
AbstractImage.red
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"uniform",
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createText(
|
|
6
|
+
AbstractImage.createPoint(10, 10),
|
|
7
|
+
"Hello World",
|
|
8
|
+
"Arial",
|
|
9
|
+
12,
|
|
10
|
+
AbstractImage.black,
|
|
11
|
+
"bold",
|
|
12
|
+
0,
|
|
13
|
+
"center",
|
|
14
|
+
"left",
|
|
15
|
+
"up",
|
|
16
|
+
2,
|
|
17
|
+
AbstractImage.red,
|
|
18
|
+
false
|
|
19
|
+
),
|
|
20
|
+
AbstractImage.createText(
|
|
21
|
+
AbstractImage.createPoint(10, 30),
|
|
22
|
+
"Hello World",
|
|
23
|
+
"Arial",
|
|
24
|
+
12,
|
|
25
|
+
AbstractImage.black,
|
|
26
|
+
"bold",
|
|
27
|
+
0,
|
|
28
|
+
"center",
|
|
29
|
+
"uniform",
|
|
30
|
+
"uniform",
|
|
31
|
+
2,
|
|
32
|
+
AbstractImage.red,
|
|
33
|
+
false
|
|
34
|
+
),
|
|
35
|
+
AbstractImage.createText(
|
|
36
|
+
AbstractImage.createPoint(10, 50),
|
|
37
|
+
"Hello World",
|
|
38
|
+
"Arial",
|
|
39
|
+
12,
|
|
40
|
+
AbstractImage.black,
|
|
41
|
+
"bold",
|
|
42
|
+
0,
|
|
43
|
+
"left",
|
|
44
|
+
"right",
|
|
45
|
+
"down",
|
|
46
|
+
2,
|
|
47
|
+
AbstractImage.red,
|
|
48
|
+
false
|
|
49
|
+
),
|
|
50
|
+
AbstractImage.createText(
|
|
51
|
+
AbstractImage.createPoint(10, 70),
|
|
52
|
+
"Hello World",
|
|
53
|
+
"Arial",
|
|
54
|
+
12,
|
|
55
|
+
AbstractImage.black,
|
|
56
|
+
"bold",
|
|
57
|
+
0,
|
|
58
|
+
"right",
|
|
59
|
+
"right",
|
|
60
|
+
"down",
|
|
61
|
+
2,
|
|
62
|
+
AbstractImage.red,
|
|
63
|
+
false
|
|
64
|
+
),
|
|
65
|
+
];
|
|
66
|
+
const image = AbstractImage.createAbstractImage(
|
|
67
|
+
AbstractImage.createPoint(0, 0),
|
|
68
|
+
AbstractImage.createSize(400, 400),
|
|
69
|
+
AbstractImage.white,
|
|
70
|
+
components
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const svg = AbstractImage.createSVG(image);
|
|
74
|
+
|
|
75
|
+
export const test: ExportTestDef = {
|
|
76
|
+
name: "svg text growth directions",
|
|
77
|
+
abstractImage: svg,
|
|
78
|
+
expectedImage:
|
|
79
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text>,<text style="text-anchor:end;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="10" height="12px">Hello World</tspan></text><text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text>,<text style="text-anchor:middle;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 30)"><tspan x="10" y="36" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 50)"><tspan x="10" y="62" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 70)"><tspan x="10" y="82" height="12px">Hello World</tspan></text></svg>',
|
|
80
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createText(
|
|
6
|
+
AbstractImage.createPoint(10, 10),
|
|
7
|
+
"Hello World",
|
|
8
|
+
"Arial",
|
|
9
|
+
12,
|
|
10
|
+
AbstractImage.black,
|
|
11
|
+
"normal",
|
|
12
|
+
0,
|
|
13
|
+
"center",
|
|
14
|
+
"right",
|
|
15
|
+
"down",
|
|
16
|
+
2,
|
|
17
|
+
AbstractImage.red,
|
|
18
|
+
true
|
|
19
|
+
),
|
|
20
|
+
AbstractImage.createText(
|
|
21
|
+
AbstractImage.createPoint(20, 20),
|
|
22
|
+
"Hello World",
|
|
23
|
+
"Arial",
|
|
24
|
+
12,
|
|
25
|
+
AbstractImage.black,
|
|
26
|
+
"bold",
|
|
27
|
+
0,
|
|
28
|
+
"center",
|
|
29
|
+
"right",
|
|
30
|
+
"down",
|
|
31
|
+
2,
|
|
32
|
+
AbstractImage.red,
|
|
33
|
+
true
|
|
34
|
+
),
|
|
35
|
+
AbstractImage.createText(
|
|
36
|
+
AbstractImage.createPoint(30, 30),
|
|
37
|
+
"Hello World",
|
|
38
|
+
"Arial",
|
|
39
|
+
12,
|
|
40
|
+
AbstractImage.black,
|
|
41
|
+
"mediumBold",
|
|
42
|
+
0,
|
|
43
|
+
"center",
|
|
44
|
+
"right",
|
|
45
|
+
"down",
|
|
46
|
+
2,
|
|
47
|
+
AbstractImage.red,
|
|
48
|
+
true
|
|
49
|
+
),
|
|
50
|
+
];
|
|
51
|
+
const image = AbstractImage.createAbstractImage(
|
|
52
|
+
AbstractImage.createPoint(0, 0),
|
|
53
|
+
AbstractImage.createSize(400, 400),
|
|
54
|
+
AbstractImage.white,
|
|
55
|
+
components
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const svg = AbstractImage.createSVG(image);
|
|
59
|
+
|
|
60
|
+
export const test: ExportTestDef = {
|
|
61
|
+
name: "svg text italic",
|
|
62
|
+
abstractImage: svg,
|
|
63
|
+
expectedImage:
|
|
64
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:bold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 20 20)"><tspan x="20" y="32" height="12px">Hello World</tspan></text><text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:mediumBold;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 30 30)"><tspan x="30" y="42" height="12px">Hello World</tspan></text></svg>',
|
|
65
|
+
};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { ExportTestDef } from "../export-test-def";
|
|
2
|
-
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
-
|
|
4
|
-
const components = [
|
|
5
|
-
AbstractImage.createText(
|
|
6
|
-
AbstractImage.createPoint(10, 10),
|
|
7
|
-
"Hello World",
|
|
8
|
-
"Arial",
|
|
9
|
-
12,
|
|
10
|
-
AbstractImage.black,
|
|
11
|
-
"
|
|
12
|
-
0,
|
|
13
|
-
"center",
|
|
14
|
-
"right",
|
|
15
|
-
"down",
|
|
16
|
-
2,
|
|
17
|
-
AbstractImage.red
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
AbstractImage.
|
|
23
|
-
AbstractImage.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { ExportTestDef } from "../export-test-def";
|
|
2
|
+
import * as AbstractImage from "../../../../../src/index";
|
|
3
|
+
|
|
4
|
+
const components = [
|
|
5
|
+
AbstractImage.createText(
|
|
6
|
+
AbstractImage.createPoint(10, 10),
|
|
7
|
+
"Hello World",
|
|
8
|
+
"Arial",
|
|
9
|
+
12,
|
|
10
|
+
AbstractImage.black,
|
|
11
|
+
"normal",
|
|
12
|
+
0,
|
|
13
|
+
"center",
|
|
14
|
+
"right",
|
|
15
|
+
"down",
|
|
16
|
+
2,
|
|
17
|
+
AbstractImage.red,
|
|
18
|
+
false
|
|
19
|
+
),
|
|
20
|
+
];
|
|
21
|
+
const image = AbstractImage.createAbstractImage(
|
|
22
|
+
AbstractImage.createPoint(0, 0),
|
|
23
|
+
AbstractImage.createSize(400, 400),
|
|
24
|
+
AbstractImage.white,
|
|
25
|
+
components
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const svg = AbstractImage.createSVG(image);
|
|
29
|
+
|
|
30
|
+
export const test: ExportTestDef = {
|
|
31
|
+
name: "svg text",
|
|
32
|
+
abstractImage: svg,
|
|
33
|
+
expectedImage:
|
|
34
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="400px" height="400px" viewBox="0 0 400 400"><text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;stroke:rgb(255, 0, 0);stroke-opacity:1;stroke-width:2px;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text>,<text style="text-anchor:start;font-size:12px;font-weight:normal;font-family:Arial;fill:rgb(0, 0, 0);fill-opacity:1;" transform="rotate(0 10 10)"><tspan x="10" y="22" height="12px">Hello World</tspan></text></svg>',
|
|
35
|
+
};
|