Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
bokeh / server / static / js / lib / models / textures / canvas_texture.js
Size: Mime:
var _a;
import { Texture } from "./texture";
import { use_strict } from "../../core/util/string";
export class CanvasTexture extends Texture {
    constructor(attrs) {
        super(attrs);
    }
    get func() {
        const code = use_strict(this.code);
        return new Function("ctx", "color", "scale", "weight", code);
    }
    get_pattern(color, scale, weight) {
        const canvas = document.createElement("canvas");
        canvas.width = scale;
        canvas.height = scale;
        const pattern_ctx = canvas.getContext("2d");
        this.func.call(this, pattern_ctx, color, scale, weight);
        return canvas;
    }
}
_a = CanvasTexture;
CanvasTexture.__name__ = "CanvasTexture";
(() => {
    _a.define(({ String }) => ({
        code: [String],
    }));
})();
//# sourceMappingURL=canvas_texture.js.map