Who invented diagrammatic algebra? There is a strong and growing trend to do mathematics via diagrammatic algebra, which involves constructing and manipulating equations whose elements are diagrams drawn in the plane. The manipulations are diagram rewrites. The diagrams are considered not as figures illustrating a `string of symbols' algebraic expression; instead, they are considered to be algebraic objects in their own rights. An archetypal diagrammatic algebraic theory is the theory of skein modules.
Notation of "algebra as strings of symbols" was pioneered by Al-Qalasadi in the fifteenth century. Previous to Al-Qalasadi, equations were often written as paragraphs of text, as in Al-Khwarizmi's Compendious Book on Calculation by Completion and Balancing.

Question: Who invented diagrammatic algebra? And when?

The first diagrammatic algebraic text I know is Louis Kauffman's 1987 paper State models and the Jones polynomial. It contains passages such as:

A subquestion is: Is this indeed the origin of diagrammatic algebra?
 A: As I mentioned in a comment, Conway was very close to using diagrammatic algebra in his paper on enumeration of knots and links: he shows skein relations for links differing by tangle replacement defined by symbols, then shows the tangles immediately following in a figure. It's plausible that Conway used diagrammatic algebra notation in his notes, but chose the presentation in the paper for typesetting reasons (it might be worth consulting him).
I found an exposition of Conway's polynomial by Cole Giller from 1982 that actually does use the diagrammatic version of skein relations. It's clear that Kauffman was aware of Giller's exposition (he has alternate expositions from 1979 and 1981 that uses a similar convention to Conway's, but cite Giller's preprint from 1979, even though it didn't appear until 1982), so it's possible that Kauffman subsequently followed Giller's convention. It might be worth looking at the references in Giller's paper to see if there's any earlier papers using diagrammatic algebra. 
A: About the history of "string diagrams" in monoidal categories:
The now called "string diagrams" as a topological representation of morphisms in (free) monoidal categories were introduced in 1965 under the notion "plane nets" by Günter Hotz in his habilitation thesis:
Günter Hotz: Eine Algebraisierung des Syntheseproblems von Schaltkreisen I+II
Elektronische Informationsverarbeitung und Kybernetik (EIK), Band 1, Heft 3+4, 1965, Akademie-Verlag Berlin
Download links:
https://www.magentacloud.de/lnk/LiPMlYfh (part 1)
https://www.magentacloud.de/lnk/YivslUWJ (part 2)
Abstract:
The composition of switching circuits A, B, to new circuits can be reduced to two basic operations:


*

*The sequential composition A \circ B of A and B, if the number of outputs of is equal to the number of inputs of A.

*The composition of A and B to A \times B is analogue to the cartesian product. The number of inputs of A \times B is equal to the sum of the numbers of the inputs of A and B. The same holds for the outputs.
Between different compositions an equivalence is introduced which is compatible with \circ and \times. When the compositions are carried over to the set of the equivalence classes, one gets an algebraic structure that forms a category respective to \circ and a semi-group (monoid) respective \times. The compositions satisfy the relation
(A \times B) \circ (C \times D) = (A \circ C) \times (B \circ D)
if A \circ C and B \circ D are defined. 
A category with this property is called an x-category.
The categories F studied here can be characterized in the following way:


*

*The set of units of F form a semi-group generated by one generator relative to \times.

*F has a countable generator set or it holds

*F is a subcategory of a category satisfying 1. and 2.


In a free x-category of this type holds the cancellation law relative to \circ and \times under a weak condition.
In the whole theory of the x-category, ''plane nets'', a concept from the combinatorial topology related to the braids of Artin plays an important role. 
Each of the studied free x-categories may be mapped onto an x-category of plane nets by a functor. Each theorem about F by the functor is carried over to a theorem about a category of nets. The theorem proved for the nets can easily be proved in most cases for F; i.e. the theorems about F have an essential combinatorial character. This is the reason that the first chapter only deals about nets.
The connection of the switching circuits represented by the elements of F with their function gives a functor from F into the x-category C(S) of the maps of type f: S^n \to S^m, where S is a countable set containing at least two elements. The \times product is in C(S) the cartesian product.*
-- end abstract
Prof. Hotz is one of the "fathers" of computer science in Germany. He has a strong mathematical background in topology and wrote his dissertation on a topic from Knot theory under supervision of Kurt Reidemeister in Göttingen.
A: While Martin and Todd give earlier examples of the use of such diagrams in logic, I think the earliest use in abstract algebra / representation theory (which seems to be more what the question is getting at), is in 1937 by Richard Brauer, in "On Algebras Which are Connected with the Semisimple Continuous Groups". This is 40 years before most of the algebraic examples discussed above.
Here, Brauer defines what would come to be known as the Brauer algebra, which is the Schur-Weyl dual of the orthogonal group. The paper is on JSTOR, and you can see examples of such diagrams from p. 867 on.
A: I'd say C.S. Peirce, from about 1882 until his death, was a very early practitioner with his Existential Graphs. This is a tripartite diagrammatic algebra or calculus that deals with propositional logic, first-order logic with equality, and modal logic. I (with Gerry Brady, who is an expert on Peirce) have argued here and there their kinship with Feynman diagrams and string diagram calculus. 
A: Frege's formalisation of first-order logic from the end of the 19th century uses a two-dimensional formalism, see e.g. here.
Konrad Zuse, inventor of the first computer, also developed the first high-level programming language, the Plankalkül which uses a 2-dimensional notation 

Programming languages where indentation is syntactically relevant are making a comeback, e.g. Python and Haskell.
Przytycki, in his     Classical roots of knot theory traces the history of braid diagrams, including this one of Gauss'.

A: I believe diagrammatic algebra started with 19th century invariant theorists. See Section 2 of my JKTR article "On the volume conjecture for classical spin networks" 
as well as Section 8 of this article
for more elaborate explanations, but I can briefly show some examples here. The earliest article I know which contains diagrammatic algebra, although in rudimentary form is the 1857 paper "On the theory of the analytical forms called trees" by Cayley (see page 172).
Here are some excerpts:


The use of diagrams for representing classical polynomial invariants or covariants was then introduced by Clifford in his 1878 article 
"Extract of a letter to Mr. Sylvester from Prof. Clifford of University
College, London". This was followed by the 1878 article "On an application of the new atomic theory to the graphical representation
of the invariants and covariants of binary quantics, with three appendices" by Sylvester. However, a more substantial development of the corresponding diagrammatic algebra was due to Kempe in the 1885 article "On the application of Clifford's graphs to ordinary binary quantics" as should be clear from this excerpt

which contains some diagrammatic equations (things like: 2 X picture-3 X another picture = yet another picture) and the diagrams for the 4 generating invariants of binary quintics (see the next page for the 19 remaining generating covariants).
Finally and in relation to Todd's answer, it is interesting to note
that there was an exchange of ideas going on between Kempe and Peirce
with regards to such diagrammatic way of doing math. See this very nice article by Grattan-Guinness for more on this story.

Edit: I should also mention the earlier 1846 article "On linear transformations" by Cayley (see page 104). Previously, the only examples of invariants were produced by elimination theory, e.g., the discriminant of a hypersuface in $\mathbb{P}^n$ pointed out by Boole. In his article Cayley showed how to produce an unlimited supply of invariants using contraction of indices (he did not say it that way) between elementary tensors for the ground form and the Levi-Civita epsilon. Assembling these elementary tensors essentially is a diagrammatic construction, although the corresponding pictures only appeared in print in the later articles by Clifford, Sylvester, Buchheim and Kempe. Cayley's procedure in fact produces all $SL_n$ invariants and this is called the FFT but he did not prove this in his 1846 article. As far as I know the first proof was found by Clebsch in 1861 as I explained in this MO answer.
