diff --git a/package/src/store/actions.ts b/package/src/store/actions.ts index 6aa991e7..857fad3d 100644 --- a/package/src/store/actions.ts +++ b/package/src/store/actions.ts @@ -38,7 +38,7 @@ const isDef = (val: T): val is NonNullable => typeof val !== 'undefined' const addEdge = (edgeParams: Edge | Connection, edges: Edge[]) => { if (!edgeParams.source || !edgeParams.target) { - console.warn("Can't create edge. An edge needs a source and a target.") + console.warn("[vueflow]: Can't create edge. An edge needs a source and a target.") return false } @@ -58,14 +58,14 @@ const addEdge = (edgeParams: Edge | Connection, edges: Edge[]) => { const updateEdgeAction = (edge: GraphEdge, newConnection: Connection, edges: GraphEdge[], add: Actions['addEdges']) => { if (!newConnection.source || !newConnection.target) { - console.warn("Can't create new edge. An edge needs a source and a target.") + console.warn("[vueflow]: Can't create new edge. An edge needs a source and a target.") return false } const foundEdge = edges.find((e) => isGraphEdge(e) && e.id === edge.id) if (!foundEdge) { - console.warn(`The old edge with id=${edge.id} does not exist.`) + console.warn(`[vueflow]: The old edge with id=${edge.id} does not exist.`) return false } @@ -236,8 +236,8 @@ export default (state: State, getters: ComputedGetters): Actions => { const missingSource = !sourceNode || typeof sourceNode === 'undefined' const missingTarget = !targetNode || typeof targetNode === 'undefined' - if (missingSource) console.warn(`couldn't create edge for source id: ${edge.source}; edge id: ${edge.id}`) - if (missingTarget) console.warn(`couldn't create edge for target id: ${edge.target}; edge id: ${edge.id}`) + if (missingSource) console.warn(`[vueflow]: Couldn't create edge for source id: ${edge.source}; edge id: ${edge.id}`) + if (missingTarget) console.warn(`[vueflow]: Couldn't create edge for target id: ${edge.target}; edge id: ${edge.id}`) const storedEdge = getters.getEdge.value(edge.id) @@ -273,8 +273,8 @@ export default (state: State, getters: ComputedGetters): Actions => { const missingSource = !sourceNode || typeof sourceNode === 'undefined' const missingTarget = !targetNode || typeof targetNode === 'undefined' - if (missingSource) console.warn(`couldn't create edge for source id: ${edge.source}; edge id: ${edge.id}`) - if (missingTarget) console.warn(`couldn't create edge for target id: ${edge.target}; edge id: ${edge.id}`) + if (missingSource) console.warn(`[vueflow]: Couldn't create edge for source id: ${edge.source}; edge id: ${edge.id}`) + if (missingTarget) console.warn(`[vueflow]: Couldn't create edge for target id: ${edge.target}; edge id: ${edge.id}`) state.edges.push({ ...state.defaultEdgeOptions, diff --git a/package/src/utils/edge.ts b/package/src/utils/edge.ts index 7bb55f21..4d51cf08 100644 --- a/package/src/utils/edge.ts +++ b/package/src/utils/edge.ts @@ -40,7 +40,6 @@ export const getHandle = (bounds: HandleElement[] = [], handleId?: string | null if (!handleId && bounds.length === 1) handle = bounds[0] else if (handleId) handle = bounds.find((d) => d.id === handleId) - console.log(handleId, handle, bounds) return handle } diff --git a/package/src/utils/graph.ts b/package/src/utils/graph.ts index 20f302d5..8f36c110 100644 --- a/package/src/utils/graph.ts +++ b/package/src/utils/graph.ts @@ -147,7 +147,7 @@ export const connectionExists = (edge: Edge, elements: Elements) => */ export const addEdge = (edgeParams: Edge | Connection, elements: Elements, defaults?: DefaultEdgeOptions) => { if (!edgeParams.source || !edgeParams.target) { - console.warn("Can't create edge. An edge needs a source and a target.") + console.warn("[vueflow]: Can't create edge. An edge needs a source and a target.") return elements } @@ -172,14 +172,14 @@ export const addEdge = (edgeParams: Edge | Connection, elements: Elements, defau */ export const updateEdge = (oldEdge: Edge, newConnection: Connection, elements: Elements) => { if (!newConnection.source || !newConnection.target) { - console.warn("Can't create new edge. An edge needs a source and a target.") + console.warn("[vueflow]: Can't create new edge. An edge needs a source and a target.") return elements } const foundEdge = elements.find((e) => isEdge(e) && e.id === oldEdge.id) if (!foundEdge) { - console.warn(`The old edge with id=${oldEdge.id} does not exist.`) + console.warn(`[vueflow]: The old edge with id=${oldEdge.id} does not exist.`) return elements }