diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-03-12 20:37:01 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-03-13 18:32:01 +1100 |
| commit | 694a728ec4d25f06528c30ac50f69b43644496e8 (patch) | |
| tree | 3673c6b92307d45a9d92ab9d924b5c3082da866a /src/components/TileTree.vue | |
| parent | 8f2b6dff0179eb42831dad42e5a68d1c328df7ff (diff) | |
Add LayoutFn type. Refactor some layout functions.
Diffstat (limited to 'src/components/TileTree.vue')
| -rw-r--r-- | src/components/TileTree.vue | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/components/TileTree.vue b/src/components/TileTree.vue index 73959ee..ce2688e 100644 --- a/src/components/TileTree.vue +++ b/src/components/TileTree.vue @@ -2,12 +2,11 @@ import {defineComponent} from 'vue'; import Tile from './Tile.vue'; -import {staticSqrLayout, staticRectLayout, sweepToSideLayout, layoutInfoHooks} from '../layout'; - //for importing f1.ts: - //using 'import f1.ts' makes vue-tsc complain, and 'import f1.js' makes vite complain - //using 'import f1' might cause problems with build systems other than vite import {TolNode, TreeNode, LayoutNode} from '../types'; -let LAYOUT_FUNC = sweepToSideLayout; +import {genLayout, layoutInfoHooks} from '../layout'; +//regarding importing a file f1.ts: + //using 'import f1.ts' makes vue-tsc complain, and 'import f1.js' makes vite complain + //using 'import f1' might cause problems with build systems other than vite import tol from '../tol.json'; function preprocessTol(tree: any): void { @@ -73,7 +72,7 @@ export default defineComponent({ nodeList[0].children = children; }, tryLayout(){ - let layout = LAYOUT_FUNC(this.tree, 0, 0, this.width, this.height, true); + let layout = genLayout(this.tree, 0, 0, this.width, this.height, true); if (layout == null){ console.log('Unable to layout tree'); return false; |
