<template>
    <div>
        <canvas id="radialGradient1" width="740" height="400" tabindex="0"/>
    </div>
</template>

<script>
    import { SGraphScene, SGraphView } from "@persagy-web/graph/lib";
    import { SRadialGradient } from "@persagy-web/draw/lib";
    import {GradRect} from "./GradRect";

    export default {
        name: "radialGradient1",
        data(){
            return {
                view: ''
            }
        },
        mounted() {
            this.init();
        },
        methods:{
            init(){
                this.view = new SGraphView('radialGradient1');
                const scene = new SGraphScene();
                const grad = new SRadialGradient(500,500,50,500,500,500);
                const item = new GradRect(null, grad);
                scene.addItem(item);
                this.view.scene = scene;
                this.view.fitSceneToView();
                this.view.scalable = false;
            }
        }
    }
</script>

<style scoped>

</style>
