feat(minimap): add offsetScale prop
This commit is contained in:
@@ -26,6 +26,7 @@ const {
|
||||
ariaLabel = 'Vue Flow mini map',
|
||||
inversePan = false,
|
||||
zoomStep = 10,
|
||||
offsetScale = 5,
|
||||
} = defineProps<MiniMapProps>()
|
||||
|
||||
const emit = defineEmits(['click', 'nodeClick', 'nodeDblclick', 'nodeMouseenter', 'nodeMousemove', 'nodeMouseleave'])
|
||||
@@ -78,7 +79,7 @@ const viewScale = computed(() => {
|
||||
const viewBox = computed(() => {
|
||||
const viewWidth = viewScale.value * elementWidth.value
|
||||
const viewHeight = viewScale.value * elementHeight.value
|
||||
const offset = 5 * viewScale.value
|
||||
const offset = offsetScale * viewScale.value
|
||||
|
||||
return {
|
||||
offset,
|
||||
|
||||
@@ -42,6 +42,8 @@ export interface MiniMapProps {
|
||||
inversePan?: boolean
|
||||
/** Specify zoom step */
|
||||
zoomStep?: number
|
||||
/** Specify minimap scale */
|
||||
offsetScale?: number
|
||||
}
|
||||
|
||||
/** these props are passed to mini map node slots */
|
||||
|
||||
Reference in New Issue
Block a user