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) {
|
||||
const markerId = getMarkerId(marker)
|
||||
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 })
|
||||
ids.push(markerId)
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ export enum MarkerType {
|
||||
}
|
||||
|
||||
export interface EdgeMarker {
|
||||
id?: string
|
||||
type: MarkerType
|
||||
color?: string
|
||||
width?: number
|
||||
|
||||
Reference in New Issue
Block a user