feat(additional-components): add maskStrokeColor and maskStrokeWidth props to MiniMap
This commit is contained in:
@@ -20,6 +20,8 @@ const {
|
|||||||
nodeStrokeWidth = 2,
|
nodeStrokeWidth = 2,
|
||||||
maskColor = 'rgb(240, 240, 240, 0.6)',
|
maskColor = 'rgb(240, 240, 240, 0.6)',
|
||||||
position = 'bottom-right' as PanelPosition,
|
position = 'bottom-right' as PanelPosition,
|
||||||
|
maskStrokeColor = 'none',
|
||||||
|
maskStrokeWidth = 1,
|
||||||
pannable = false,
|
pannable = false,
|
||||||
zoomable = false,
|
zoomable = false,
|
||||||
} = defineProps<MiniMapProps>()
|
} = defineProps<MiniMapProps>()
|
||||||
@@ -221,7 +223,14 @@ export default {
|
|||||||
@mouseleave="onNodeMouseLeave($event, node)"
|
@mouseleave="onNodeMouseLeave($event, node)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<path class="vue-flow__minimap-mask" :style="pannable ? 'cursor: grab' : ''" :d="d" :fill="maskColor" fill-rule="evenodd" />
|
<path
|
||||||
|
class="vue-flow__minimap-mask"
|
||||||
|
:d="d"
|
||||||
|
:fill="maskColor"
|
||||||
|
:stroke="maskStrokeColor"
|
||||||
|
:stroke-width="maskStrokeWidth"
|
||||||
|
fill-rule="evenodd"
|
||||||
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
</Panel>
|
</Panel>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -21,8 +21,12 @@ export interface MiniMapProps {
|
|||||||
nodeBorderRadius?: number
|
nodeBorderRadius?: number
|
||||||
/** Node stroke width */
|
/** Node stroke width */
|
||||||
nodeStrokeWidth?: number
|
nodeStrokeWidth?: number
|
||||||
/** Background color of minimap */
|
/** Background color of minimap mask */
|
||||||
maskColor?: string
|
maskColor?: string
|
||||||
|
/** Border color of minimap mask */
|
||||||
|
maskStrokeColor?: string
|
||||||
|
/** Border width of minimap mask */
|
||||||
|
maskStrokeWidth?: number
|
||||||
/** Position of the minimap {@link PanelPosition} */
|
/** Position of the minimap {@link PanelPosition} */
|
||||||
position?: PanelPosition
|
position?: PanelPosition
|
||||||
/** Enable drag minimap to drag viewport */
|
/** Enable drag minimap to drag viewport */
|
||||||
|
|||||||
@@ -108,6 +108,12 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vue-flow__minimap-mask {
|
||||||
|
&.pannable {
|
||||||
|
cursor: grab;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.vue-flow__controls {
|
.vue-flow__controls {
|
||||||
box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08);
|
box-shadow: 0 0 2px 1px rgba(0, 0, 0, 0.08);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user