<template>
    <div style="margin-top: 10px;">
<!--        <el-button size="small" @click="changeEnable">切换item1禁用状态</el-button>-->
<!--        圆角半径 : <el-input-number @change="changeY" v-model="R" size="mini" style="width: 100px"></el-input-number>-->
        <canvas :id="id" width="740" height="400" />
    </div>
</template>

<script>
    import {SGraphAreaGroupItem,SGraphScene, SGraphView} from "@persagy-web/graph/lib";

    export default {
        name: "areaCanvas",
        data(){
            return{
                id: 'area'+Date.now(),
                view: '',
                outline: [
                    [
                        [{X: 0, Y:0},{X: 0, Y:-100},{X: 100, Y:-100}],
                        // [{X: 800, Y:200},{X: 800, Y:800},{X: 200, Y:800},{X: 200, Y:200}]
                    ]
                ]
            }
        },
        mounted() {
            this.init();
        },
        methods:{
            init(){
                this.view = new SGraphView(this.id);
                const scene = new SGraphScene();
                console.log(this.outline[0][0])
                const item = new SGraphAreaGroupItem(null, {OutLine: this.outline});
                scene.addItem(item);
                this.view.scene = scene;
                this.view.fitSceneToView();
                console.log(item)
            }
        }
    }
</script>

<style scoped>

</style>
