<template>
    <div>
        <canvas id="radialGradient5" 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: "radialGradient5",
        data(){
            return {
                view: ''
            }
        },
        mounted() {
            this.init();
        },
        methods:{
            init(){
                this.view = new SGraphView('radialGradient5');
                const scene = new SGraphScene();
                // 渐变1
                const grad1 = new SRadialGradient(
                    400,
                    400,
                    200, //圆1半径
                    600,
                    600,
                    200 //圆2半径
                );
                const item = new GradRect(null, grad1);
                scene.addItem(item);
                this.view.scene = scene;
                this.view.fitSceneToView();
                this.view.scalable = false;
            }
        }
    }
</script>

<style scoped>

</style>
