feat(edges): allow markers to have unique id
* fix overwriting by spreading marker def Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,7 @@ const markers = computed(() => {
|
|||||||
if (marker) {
|
if (marker) {
|
||||||
const markerId = getMarkerId(marker)
|
const markerId = getMarkerId(marker)
|
||||||
if (!ids.includes(markerId)) {
|
if (!ids.includes(markerId)) {
|
||||||
if (typeof marker === 'object') markers.push({ id: markerId, color: marker.color || props.defaultColor, ...marker })
|
if (typeof marker === 'object') markers.push({ ...marker, id: markerId, color: marker.color || props.defaultColor })
|
||||||
else markers.push({ id: markerId, color: props.defaultColor, type: marker as MarkerType })
|
else markers.push({ id: markerId, color: props.defaultColor, type: marker as MarkerType })
|
||||||
ids.push(markerId)
|
ids.push(markerId)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export enum MarkerType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface EdgeMarker {
|
export interface EdgeMarker {
|
||||||
|
id?: string
|
||||||
type: MarkerType
|
type: MarkerType
|
||||||
color?: string
|
color?: string
|
||||||
width?: number
|
width?: number
|
||||||
|
|||||||
Reference in New Issue
Block a user