Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abstract-image

Package Overview
Dependencies
Maintainers
12
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-image - npm Package Compare versions

Comparing version 3.1.3 to 3.2.0

lib/_tests_/exporters/svg-export-image.test.d.ts

6

CHANGELOG.md

@@ -13,2 +13,8 @@ # Change Log

## [v3.1.4](https://github.com/dividab/abstract-visuals/compare/abstract-image@3.1.3...abstract-image@3.1.4) - 2022-01-05
### Added
- Added italic and mediumBold as options for texts
## [v3.0.1](https://github.com/dividab/abstract-visuals/compare/abstract-image@3.0.0...abstract-image@3.0.1) - 2021-01-01

@@ -15,0 +21,0 @@

2

lib/__stories__/react-svg-export/example-1.stories.js

@@ -29,3 +29,3 @@ "use strict";

AbstractImage.createLine(AbstractImage.createPoint(200, 0), AbstractImage.createPoint(200, 400), AbstractImage.black, 1),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Testing texting", "Arial", 20, AbstractImage.black, "normal", 0, "center", "uniform", "down", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Testing texting", "Arial", 20, AbstractImage.black, "normal", 0, "center", "uniform", "down", 0, AbstractImage.black, false),
];

@@ -32,0 +32,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -26,3 +26,3 @@ "use strict";

AbstractImage.createGroup("group", [
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black, false),
AbstractImage.createRectangle(AbstractImage.createPoint(10, 50), AbstractImage.createPoint(50, 60), AbstractImage.blue, 2, AbstractImage.red),

@@ -29,0 +29,0 @@ ]),

@@ -25,6 +25,6 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red, false),
];

@@ -31,0 +31,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -26,3 +26,3 @@ "use strict";

AbstractImage.createGroup("group", [
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black, false),
AbstractImage.createRectangle(AbstractImage.createPoint(10, 50), AbstractImage.createPoint(50, 60), AbstractImage.blue, 2, AbstractImage.red),

@@ -29,0 +29,0 @@ ]),

@@ -25,6 +25,6 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red, false),
];

@@ -31,0 +31,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -27,3 +27,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "down", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "down", "down", 2, AbstractImage.red, false),
];

@@ -39,3 +39,3 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "right", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "right", 2, AbstractImage.red, false),
];

@@ -42,0 +42,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -27,3 +27,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "down", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "down", "down", 2, AbstractImage.red, false),
];

@@ -39,3 +39,3 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "right", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "right", 2, AbstractImage.red, false),
];

@@ -42,0 +42,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -31,3 +31,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -34,0 +34,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -26,3 +26,3 @@ "use strict";

AbstractImage.createGroup("group", [
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black, false),
AbstractImage.createRectangle(AbstractImage.createPoint(10, 50), AbstractImage.createPoint(50, 60), AbstractImage.blue, 2, AbstractImage.red),

@@ -29,0 +29,0 @@ ]),

@@ -24,3 +24,3 @@ "use strict";

const AbstractImage = __importStar(require("../../../../../src/index"));
const subImage = AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red);
const subImage = AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false);
const components = [AbstractImage.createSubImage(AbstractImage.createPoint(10, 10), subImage)];

@@ -27,0 +27,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,6 +25,6 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red, false),
];

@@ -31,0 +31,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello <sub>World</sub>", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello <sub>World</sub>", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -26,3 +26,3 @@ "use strict";

AbstractImage.createGroup("group", [
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black),
AbstractImage.createText(AbstractImage.createPoint(200, 200), "Test", "Helvetica", 12, AbstractImage.black, "normal", 0, "center", "uniform", "uniform", 0, AbstractImage.black, false),
AbstractImage.createRectangle(AbstractImage.createPoint(10, 50), AbstractImage.createPoint(50, 60), AbstractImage.blue, 2, AbstractImage.red),

@@ -29,0 +29,0 @@ ]),

@@ -25,6 +25,6 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "left", "up", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 30), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "uniform", "uniform", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 50), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "left", "right", "down", 2, AbstractImage.red, false),
AbstractImage.createText(AbstractImage.createPoint(10, 70), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "right", "right", "down", 2, AbstractImage.red, false),
];

@@ -31,0 +31,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -25,3 +25,3 @@ "use strict";

const components = [
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red),
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
];

@@ -28,0 +28,0 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0), AbstractImage.createSize(400, 400), AbstractImage.white, components);

@@ -95,3 +95,3 @@ "use strict";

fontSize: component.fontSize.toString() + "px",
fontWeight: component.fontWeight,
fontWeight: component.fontWeight === "mediumBold" ? "bold" : component.fontWeight,
fontFamily: component.fontFamily,

@@ -104,3 +104,3 @@ stroke: colorToRgb(component.strokeColor),

fontSize: component.fontSize.toString() + "px",
fontWeight: component.fontWeight,
fontWeight: component.fontWeight === "mediumBold" ? "bold" : component.fontWeight,
fontFamily: component.fontFamily,

@@ -107,0 +107,0 @@ fill: colorToRgb(component.textColor),

@@ -71,3 +71,3 @@ import * as Point from "./point";

export declare function corners(rectangle: Rectangle): Array<Point.Point>;
export declare type AbstractFontWeight = "normal" | "bold";
export declare type AbstractFontWeight = "normal" | "mediumBold" | "bold";
export declare type TextAlignment = "left" | "center" | "right";

@@ -89,4 +89,5 @@ export declare type GrowthDirection = "up" | "down" | "uniform" | "left" | "right";

readonly strokeColor: Color.Color;
readonly italic: boolean;
}
export declare function createText(position: Point.Point, text: string, fontFamily: string, fontSize: number, textColor: Color.Color, fontWeight: AbstractFontWeight, clockwiseRotationDegrees: number, textAlignment: TextAlignment, horizontalGrowthDirection: GrowthDirection, verticalGrowthDirection: GrowthDirection, strokeThickness: number, strokeColor: Color.Color): Text;
export declare function createText(position: Point.Point, text: string, fontFamily: string, fontSize: number, textColor: Color.Color, fontWeight: AbstractFontWeight, clockwiseRotationDegrees: number, textAlignment: TextAlignment, horizontalGrowthDirection: GrowthDirection, verticalGrowthDirection: GrowthDirection, strokeThickness: number, strokeColor: Color.Color, italic: boolean): Text;
export interface SubImage {

@@ -93,0 +94,0 @@ readonly type: "subimage";

@@ -28,3 +28,3 @@ "use strict";

name: name,
children: children
children: children,
};

@@ -40,3 +40,3 @@ }

data: data,
id: id
id: id,
};

@@ -53,3 +53,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -65,3 +65,3 @@ }

strokeThickness: strokeThickness,
id: id
id: id,
};

@@ -76,3 +76,3 @@ }

strokeThickness: strokeThickness,
id: id
id: id,
};

@@ -88,3 +88,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -101,3 +101,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -111,7 +111,7 @@ }

rectangle.bottomRight,
Point.createPoint(rectangle.topLeft.x, rectangle.bottomRight.y)
Point.createPoint(rectangle.topLeft.x, rectangle.bottomRight.y),
];
}
exports.corners = corners;
function createText(position, text, fontFamily, fontSize, textColor, fontWeight, clockwiseRotationDegrees, textAlignment, horizontalGrowthDirection, verticalGrowthDirection, strokeThickness, strokeColor) {
function createText(position, text, fontFamily, fontSize, textColor, fontWeight, clockwiseRotationDegrees, textAlignment, horizontalGrowthDirection, verticalGrowthDirection, strokeThickness, strokeColor, italic) {
return {

@@ -130,3 +130,4 @@ type: "text",

strokeThickness: strokeThickness,
strokeColor: strokeColor
strokeColor: strokeColor,
italic: italic,
};

@@ -139,3 +140,3 @@ }

topLeft: topLeft,
image: image
image: image,
};

@@ -142,0 +143,0 @@ }

{
"name": "abstract-image",
"version": "3.1.3",
"version": "3.2.0",
"description": "Dynamically create images using code or JSX and render to any format",

@@ -25,3 +25,3 @@ "repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-image",

},
"gitHead": "4ddaca0bd9426b1737200824792ba348d2936490"
"gitHead": "3e9bd6f75744ad088262dd6785e58fd5df6e7f06"
}

@@ -0,0 +0,0 @@ # abstract-image

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -18,3 +18,4 @@ import { ExportTestDef } from "../export-test-def";

0,
AbstractImage.black
AbstractImage.black,
false
),

@@ -21,0 +22,0 @@ AbstractImage.createRectangle(

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -32,3 +33,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -47,3 +49,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -62,3 +65,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -65,0 +69,0 @@ ];

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

0,
AbstractImage.black
AbstractImage.black,
false
),

@@ -20,0 +21,0 @@ ];

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -20,0 +21,0 @@ ];

@@ -18,3 +18,4 @@ import { ExportTestDef } from "../export-test-def";

0,
AbstractImage.black
AbstractImage.black,
false
),

@@ -21,0 +22,0 @@ AbstractImage.createRectangle(

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -32,3 +33,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -47,3 +49,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -62,3 +65,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -65,0 +69,0 @@ ];

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -20,0 +21,0 @@ ];

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -20,0 +21,0 @@ ];

@@ -18,3 +18,4 @@ import { ExportTestDef } from "../export-test-def";

0,
AbstractImage.black
AbstractImage.black,
false
),

@@ -21,0 +22,0 @@ AbstractImage.createRectangle(

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -32,3 +33,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -47,3 +49,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -62,3 +65,4 @@ AbstractImage.createText(

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -65,0 +69,0 @@ ];

@@ -17,3 +17,4 @@ import { ExportTestDef } from "../export-test-def";

2,
AbstractImage.red
AbstractImage.red,
false
),

@@ -20,0 +21,0 @@ ];

@@ -0,0 +0,0 @@ import * as AbstractImage from "../model/index";

@@ -0,0 +0,0 @@ import * as AI from "../model/index";

export * from "./svg-export-image";
export * from "./png-export-image";
export * from "./dxf2d-export-image";

@@ -0,0 +0,0 @@ import * as AbstractImage from "../model/index";

@@ -0,0 +0,0 @@ import * as AbstractImage from "../model/index";

@@ -0,0 +0,0 @@ export * from "./model/abstract-image";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import { ExportTestDef } from "../export-test-def";

@@ -0,0 +0,0 @@ import * as Size from "./size";

@@ -0,0 +0,0 @@ export interface Color {

@@ -5,12 +5,3 @@ import * as Point from "./point";

export type Component =
| BinaryImage
| Ellipse
| Line
| PolyLine
| Polygon
| Rectangle
| Text
| SubImage
| Group;
export type Component = BinaryImage | Ellipse | Line | PolyLine | Polygon | Rectangle | Text | SubImage | Group;

@@ -27,3 +18,3 @@ export interface Group {

name: name,
children: children
children: children,
};

@@ -59,3 +50,3 @@ }

data: data,
id: id
id: id,
};

@@ -89,3 +80,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -116,3 +107,3 @@ }

strokeThickness: strokeThickness,
id: id
id: id,
};

@@ -140,3 +131,3 @@ }

strokeThickness: strokeThickness,
id: id
id: id,
};

@@ -167,3 +158,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -197,3 +188,3 @@ }

fillColor: fillColor,
id: id
id: id,
};

@@ -207,7 +198,7 @@ }

rectangle.bottomRight,
Point.createPoint(rectangle.topLeft.x, rectangle.bottomRight.y)
Point.createPoint(rectangle.topLeft.x, rectangle.bottomRight.y),
];
}
export type AbstractFontWeight = "normal" | "bold";
export type AbstractFontWeight = "normal" | "mediumBold" | "bold";

@@ -232,2 +223,3 @@ export type TextAlignment = "left" | "center" | "right";

readonly strokeColor: Color.Color;
readonly italic: boolean;
}

@@ -247,3 +239,4 @@

strokeThickness: number,
strokeColor: Color.Color
strokeColor: Color.Color,
italic: boolean
): Text {

@@ -263,3 +256,4 @@ return {

strokeThickness: strokeThickness,
strokeColor: strokeColor
strokeColor: strokeColor,
italic: italic,
};

@@ -274,19 +268,12 @@ }

export function createSubImage(
topLeft: Point.Point,
image: Component
): SubImage {
export function createSubImage(topLeft: Point.Point, image: Component): SubImage {
return {
type: "subimage",
topLeft: topLeft,
image: image
image: image,
};
}
export function embedAbstractImage(
topLeft: Point.Point,
name: string,
image: AbstractImage.AbstractImage
): Component {
export function embedAbstractImage(topLeft: Point.Point, name: string, image: AbstractImage.AbstractImage): Component {
return createSubImage(topLeft, createGroup(name, image.components));
}

@@ -0,0 +0,0 @@ export * from "./abstract-image";

@@ -0,0 +0,0 @@ export interface Point {

@@ -0,0 +0,0 @@ export interface Size {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc