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

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

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

<style scoped>

</style>
