1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template>
- <div>
- <canvas :id="id" width="800px" height="400px"></canvas>
- </div>
- </template>
- <script lang="ts">
- import { SGraphScene, SGraphSvgItem, SGraphView } from "@persagy-web/graph/lib";
- import { Component, Vue } from "vue-property-decorator";
- import { v1 as uuid } from "uuid";
- @Component
- export default class SvgCanvas extends Vue {
-
- id: string = uuid();
-
- view: SGraphView | undefined;
- svgData = {
-
-
- url: require('../../../public/assets/img/1.svg'),
- x: 100,
- y: 100,
- width: 200,
- height: 200
- };
-
- private mounted(): void {
- this.init()
- };
-
- init(): void {
- this.view = new SGraphView(this.id);
- const scene = new SGraphScene();
- this.view.scene = scene;
- const item = new SGraphSvgItem(null, this.svgData);
- scene.addItem(item);
-
-
-
-
-
- };
- }
- </script>
|