Search code examples
jointjs

How to add a link with crow's foot erd notation in jointjs


Is there any way to have a link in crow's foot notation with JointJS?

If yes, what would be the code look like?


Solution

  • Yes, you can make crow feet notation in jointjs. Need to edit in shapes, Code for one-to-many is

    case '1 optional-N optional':
        attrs = {
                 '.marker-source': {
                   d: 'M 10 0 L 10 20 L 10 10 L 0 10 L 14 10 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0',
                   fill: '#FFFFFF'
                  },
                 '.marker-target': {
                   d: "M 0 0 L 10 10 L 0 10 L 10 10 L 0 20 L 10 10 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0",
                   fill: '#FFFFFF'
                  }
        };
    break;