update(docs): fix view height

This commit is contained in:
Braks
2021-11-06 08:54:35 +01:00
parent 67876cdd1b
commit ae0772b6d4
42 changed files with 91 additions and 220 deletions
@@ -2,7 +2,7 @@
import { HTMLAttributes } from 'vue'
import { getBoundsofRects, getRectOfNodes } from '../../utils'
import { Node } from '../../types'
import { useStore } from '../../composables'
import { useStore, useWindow } from '../../composables'
import MiniMapNode from './MiniMapNode.vue'
type StringFunc = (node: Node) => string
@@ -27,6 +27,7 @@ const props = withDefaults(defineProps<MiniMapProps>(), {
})
const attrs: any = useAttrs()
const window = useWindow()
const defaultWidth = 200
const defaultHeight = 150
@@ -41,8 +42,7 @@ const nodeStrokeColorFunc: StringFunc =
const nodeClassNameFunc = props.nodeClassName instanceof Function ? props.nodeClassName : () => props.nodeClassName as StringFunc
const shapeRendering: ShapeRendering =
(window && typeof window === 'undefined') || !!window.chrome ? 'crispEdges' : 'geometricPrecision'
const shapeRendering: ShapeRendering = typeof window === 'undefined' || !!window.chrome ? 'crispEdges' : 'geometricPrecision'
const viewBox = computed(() => {
const bb = getRectOfNodes(store.nodes)