123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <template>
- <div>
- <canvas id="wall" width="800" height="400" tabindex="0" />
- </div>
- </template>
- <script>
- import {SGraphScene, SGraphView} from "@persagy-web/graph/";
- import {SWindowItem} from "../../../../guides/big/items/src/SWindowItem";
- export default {
- name: "wall",
- data(){
- return {
- view: null,
- // 图中靠上位置的黑色矩形轮廓
- outline1:[[{X:120,Y:100},{X:120,Y:300}]],
- }
- },
- mounted() {
- this.init();
- },
- methods:{
- init(){
- this.view = new SGraphView('wall');
- // this.view.scalable = false;
- const scene = new SGraphScene();
- this.view.scene = scene;
- // 只模拟了轮廓数据
- const item = new SWindowItem(null,{OutLine:this.outline1});
- scene.addItem(item);
- this.view.fitSceneToView();
- console.log(this.view)
- }
- }
- }
- </script>
- <style scoped>
- </style>
|