xpict 0.4.0 → 0.4.1
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.
|
@@ -7,9 +7,10 @@ export type RectangleLayerOptions<Data> = {
|
|
|
7
7
|
height: number;
|
|
8
8
|
fill: string;
|
|
9
9
|
borderRadius?: number;
|
|
10
|
+
when?: WhenFunction<Data>;
|
|
10
11
|
};
|
|
11
12
|
export declare class RectangleLayer<Data> extends Layer<Data> {
|
|
12
13
|
private readonly options;
|
|
13
|
-
constructor(options: RectangleLayerOptions<Data
|
|
14
|
+
constructor(options: RectangleLayerOptions<Data>);
|
|
14
15
|
render({ context: ctx, data, index, templateConfig }: RenderOptions<Data>): Promise<void>;
|
|
15
16
|
}
|
|
@@ -5,8 +5,8 @@ const canvas_1 = require("canvas");
|
|
|
5
5
|
const layer_1 = require("./layer");
|
|
6
6
|
const resolve_axis_1 = require("../utils/resolve-axis");
|
|
7
7
|
class RectangleLayer extends layer_1.Layer {
|
|
8
|
-
constructor(options
|
|
9
|
-
super(when);
|
|
8
|
+
constructor(options) {
|
|
9
|
+
super(options.when);
|
|
10
10
|
this.options = options;
|
|
11
11
|
}
|
|
12
12
|
async render({ context: ctx, data, index = 0, templateConfig }) {
|
package/package.json
CHANGED