fix(edges): pass className to edge closes #420

This commit is contained in:
moklick
2020-08-11 09:57:45 +02:00
parent ccf03eb604
commit 6d651bdc98
3 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ const initialElements = [
{ id: '6', type: 'output', data: { label: 'Output 6' }, position: { x: 50, y: 550 } },
{ id: '7', type: 'output', data: { label: 'Output 7' }, position: { x: 250, y: 550 } },
{ id: '8', type: 'output', data: { label: 'Output 8' }, position: { x: 525, y: 600 } },
{ id: 'e1-2', source: '1', target: '2', label: 'bezier edge (default)' },
{ id: 'e1-2', source: '1', target: '2', label: 'bezier edge (default)', className: 'normal-edge' },
{ id: 'e2-2a', source: '2', target: '2a', type: 'smoothstep', label: 'smoothstep edge' },
{ id: 'e2-3', source: '2', target: '3', type: 'step', label: 'step edge' },
{ id: 'e3-4', source: '3', target: '4', type: 'straight', label: 'straight edge' },
-2
View File
@@ -12,8 +12,6 @@ export default memo(({ x, y, label, labelStyle = {}, labelShowBg = true, labelBg
if (edgeRef.current) {
const textBbox = edgeRef.current.getBBox();
console.log(textBbox);
setEdgeTextBbox({
x: textBbox.x,
y: textBbox.y,
+1
View File
@@ -161,6 +161,7 @@ function renderEdge(
<EdgeComponent
key={edge.id}
id={edge.id}
className={edge.className}
type={edge.type}
data={edge.data}
onClick={props.onElementClick}