1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template>
- <div>
- <canvas :id="id" width="800px" height="400px"></canvas>
- </div>
- </template>
- <script lang="ts">
- import {SGraphScene, SGraphView, SGraphSvgItem} 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>
|