How to use the snapsvg.load function in snapsvg

To help you get started, we’ve selected a few snapsvg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / CanvasTools-for-VOTT / src / canvastools / ts / CanvasTools.Toolbar.ts View on Github external
private buildIconUI() {
            this.iconGroup = this.paper.g();
            this.iconGroup.addClass("iconStyle");

            this.iconBackgrounRect = this.paper.rect(0, 0, ToolbarIcon.IconWidth, ToolbarIcon.IconHeight);
            this.iconBackgrounRect.addClass("iconBGRectStyle");
            this.iconGroup.add(this.iconBackgrounRect);

            this.iconImage = this.paper.g();
            if (this.description.iconUrl !== undefined) {
                Snap.load(this.description.iconUrl, (fragment) => {
                    this.iconImage.append(fragment);
                    this.iconImageSVG = this.iconImage.children().find((element) => {
                        return (element.type === "svg");
                    });
                    if (this.iconImageSVG !== undefined) {
                        this.iconImageSVG.attr({
                            width: ToolbarIcon.IconWidth,
                            height: ToolbarIcon.IconHeight
                        });

                        this.move(this.x, this.y);
                    }                    
                });
            }
            this.iconImage.addClass("iconImageStyle");
            this.iconGroup.add(this.iconImage);
github saschwarz / react-svgpathplayer / src / svgpathplayer.jsx View on Github external
componentDidMount() {
        Snap.load(this.props.svg, this.loadFile);
    }

snapsvg

JavaScript Vector Library

Apache-2.0
Latest version published 7 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages