Basic Usage

To use jQuery.Feyn, the first thing you should do is to load the scripts found in the distribution:

<script src="js/jquery-2.1.0.min.js"></script>
<script src="js/jquery.feyn-1.0.1.min.js"></script>

jQuery 1.3+ should also work, but it is meaningless to support IE 6/7/8. Notice that jQuery.Feyn does not depend on any external style sheets. Having done this, you can configure your desired Feynman diagram such as

<script>
  $(document).ready(function() {
    $('#container').feyn({
      incoming: {i1: '20,180', i2: '180,180'},
      outgoing: {o1: '20,20', o2: '180,20'},
      vertex: {v1: '100,140', v2: '100,60'},
      fermion: {line: 'i1-v1-i2,o2-v2-o1'},
      photon: {line: 'v1-v2'}
    });
  });
</script>

The jQuery ID selector $('#container') can also be replaced by any other CSS selector that applies to a unique block-level element in your document, which serves as the container of jQuery.Feyn's SVG output.

Further Reading