How to make diagrams

Post your games here for other members to critique your play.
User avatar
Joaz Banbeck
Judan
Posts: 5546
Joined: Sun Dec 06, 2009 11:30 am
Rank: 1D AGA
GD Posts: 1512
Kaya handle: Test
Location: Banbeck Vale
Has thanked: 1080 times
Been thanked: 1434 times

How to make diagrams

Post by Joaz Banbeck »

A diagram of a go board consists of 6 parts:

1) The opening tag, which is the word 'go' enclosed in brackets. This usually goes on one line by itself.

2) One line which includes several display codes and the label.
                              It starts with two dollar signs ('$$')

                              Next is optional, either a 'B or a 'W', indicating what color is the first move. ( If not specified, it defaults to 'B'. )

                              An optional lower case 'c' can be added for coordinates.

                              An optional lower case 'm' can be added, followed by one or more digits to indicate the number of the first move. ( Defaults to 'm1' )


3) The top of the board, which is two dollar signs and a row of dashes. ( '$$---------------' )

4) Multiple - up to 19 - lines which define the board. Each line should start with two dollar signs ('$$').
                              A period (".") is an empty intersection.

                              A comma (",") is a star point.

                              A vertical line ( "|" )( usually a shifted tab key ) is the edge of the board


5) The bottom of the board, which is two dollar signs and a row of dashes. ( '$$---------------' )

6) The closing tag, which is the word '/go' enclosed in brackets. This usually goes on one line by itself.


Strictly speaking, only parts 1 and 6 are necessary. In practice, usually only 3 or 5 are skipped to form portions of a board.

====================================================================================================================

Here it is:

Click Here To Show Diagram Code
[go]$$c This is a label for the diagram. Remember to replace it with something relevant.
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]

Directly above this sentence, there should be a sentence in blue that says "Click here to show diagram code". It will show you all 6 parts put together.

====================================================================================================================


The above generates a blank board. Now let's look at putting something on the board. To do this, replace the periods with letters, numbers, or other symbols.

X = black stone
O = white stone
* = half black and half white
V = half wood and half white
A = half wood and half black

B = black stone with circle
W = white stone with circle
C = circle on empty intersection
# = black stone with square
@ = white stone with square
S = square on empty intersection
Y = black stone with triangle
Q = white stone with triangle
T = triangle on empty intersection
Z = black stone with X
P = white stone with X
M = X on empty intersection
? = shading

Click Here To Show Diagram Code
[go]$$Wcm31 Thanks to Kirby, \n we can now put line breaks \n in the label. \nAgain, click on the blue line \n below to see how it is done.
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . . . . . . . . . . . . . ? ? ? ? ? |
$$ | . . X X X . . A . * . V . . O O O . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . B . . . . . C . . . . . W . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . # . . . . . S . . . . . @ . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . Y . . . . . T . . . . . Q . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . Z . . . . . M . . . . . P . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . 1 . 2 . 3 . 4 . 5 . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . a . b . c . d . x . y . z . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------[/go]


You can also use lowercase letters which appear literally.


Also, a hyphen can be used like this:

Click Here To Show Diagram Code
[go]$$W
$$ -------------------------------
$$ - . . . . . . . - . . . . . . .
$$ - . . . . . . . - . . 1 . . . .
$$ - . 0 3 X . . . - . X O X 3 . .
$$ - . . 4 5 . . . - . . X O . . .
$$ - . . 6 1 . . . - . 2 X O . . .
$$ - . 9 7 8 . . . - . O O X 5 . .
$$ - . . 2 . . . . - . 4 X 6 . . .
$$ - . . . . . . . - . . . . . . .
$$ - . . . . . . . - . . . . . . .[/go]



Lines and Arrows:

Click Here To Show Diagram Code
[go]$$Bc Example: using arrows to show influence
$$ ------------------
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . O O O . O . . .
$$ | . O X X X . . . .
$$ | . X . . . . . . .
$$ | . . X . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ {AR C14 C11}
$$ {AR 5:6 5:9}[/go]


As it is hard to visualize and edit such lines in edit mode, lines and arrows are specified in extra lines - usually after the diagram. The code for the above diagram looks like this:
$$ {AR C14 C11}
$$ {AR 5:6 5:9}
The syntax basically is "$$ {command point1 point2}".
Command can be either ''AR'' for arrows or ''LN'' for lines. Coordinates can be given in two different ways:
1) Board coordinates: this is the usual Go coordinate system. Points are denoted as A1 .. T19. For this to work the diagram has to be anchored in at least one corner, i.e. center diagrams cannot use this method. IOW, if you can switch on coordinates with the $$c option, then this method works.
2) Relative coordinates: points are denoted in 'X:Y' syntax. X and Y are a coordinate system with the root being in the upper left - numbering starts at 1:1. The second arrow in the example uses this system. These coordinates will always work, as they do not rely on borders and corners.

EDIT(10-10-15): For those who don't want to learn the nuts and bolts, Herman Hiddema has a very useful tool at http://hiddema.nl/diagrammer/
Help make L19 more organized. Make an index: https://lifein19x19.com/viewtopic.php?f=14&t=5207
User avatar
mic
Lives with ko
Posts: 185
Joined: Wed Apr 21, 2010 4:24 am
Rank: 6k KGS
GD Posts: 0
KGS: mic
Location: Kassel, Germany
Has thanked: 66 times
Been thanked: 6 times
Contact:

Re: How to make diagrams

Post by mic »

Is there a way to create an empty board without copy and paste of an already existing board or typing in all by myself? If yes, I unfortunately have not found it, if not, this would be a nice feature for a button in the editor.

- Mic
Go is easy: don't play bad moves.
User avatar
zenith
Dies in gote
Posts: 21
Joined: Wed Apr 21, 2010 1:34 pm
Rank: KGS 10 kyu
GD Posts: 0
Has thanked: 4 times
Been thanked: 3 times

Re: How to make diagrams

Post by zenith »

People probably have these already (or just copy/paste from existing ones) but I thought I'd stick these empty templates here for reference.

whole board:
$$B 19x19 board
$$ ---------------------------------------
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . , . . . . . , . . . . . , . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$ ---------------------------------------


Just a corner:
$$B Corner
$$ ------------------
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . , . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .
$$ | . . . . . . . . .



Having buttons that load the different layouts within [go] tags would be nice, although I'm not sure how it would be done.
User avatar
fwiffo
Gosei
Posts: 1435
Joined: Tue Apr 20, 2010 6:22 am
Rank: Out of practice
GD Posts: 1104
KGS: fwiffo
Location: California
Has thanked: 49 times
Been thanked: 168 times

Re: How to make diagrams

Post by fwiffo »

This doesn't cover every option. It uses the same code as Sensei's library, so you can take a look at the Sensei's page on how diagrams work. That page misses a few options related searching, but you can read about them on the Sensei's help page on position search. We don't have a position search function here, but you can use those options in your diagrams.
User avatar
Fedya
Lives in gote
Posts: 603
Joined: Tue Apr 20, 2010 8:21 pm
Rank: 6-7k KGS
GD Posts: 0
Has thanked: 43 times
Been thanked: 139 times

Re: How to make diagrams

Post by Fedya »

mic wrote:Is there a way to create an empty board without copy and paste of an already existing board or typing in all by myself? If yes, I unfortunately have not found it, if not, this would be a nice feature for a button in the editor.


qGo has an Import/Export feature, although it includes the coordinates. That, and you have to go through the preferences to change the notation for Black stones -- I believe it uses # by default.
User avatar
Harleqin
Lives in sente
Posts: 921
Joined: Sat Mar 06, 2010 10:31 am
Rank: German 2 dan
GD Posts: 0
Has thanked: 401 times
Been thanked: 164 times

Re: How to make diagrams

Post by Harleqin »

These threads are doubtlessly important, but they now appear constantly at the "View unread posts" list, which is very annoying.
A good system naturally covers all corner cases without further effort.
User avatar
Dante31
Lives with ko
Posts: 129
Joined: Sat May 15, 2010 6:08 pm
Rank: KGS 4k
GD Posts: 0
Has thanked: 5 times
Been thanked: 14 times

Re: How to make diagrams

Post by Dante31 »

Thank you for posting this. Nothing quite like a diagram to show what you mean.
User avatar
daniel_the_smith
Gosei
Posts: 2116
Joined: Wed Apr 21, 2010 8:51 am
Rank: 2d AGA
GD Posts: 1193
KGS: lavalamp
Tygem: imapenguin
IGS: lavalamp
OGS: daniel_the_smith
Location: Silicon Valley
Has thanked: 152 times
Been thanked: 330 times
Contact:

Re: How to make diagrams

Post by daniel_the_smith »

SL has a tool to make a diagram from an SGF, I think it deserves a mention here: http://senseis.xmp.net/tools/sgf2diagram.php
That which can be destroyed by the truth should be.
--
My (sadly neglected, but not forgotten) project: http://dailyjoseki.com
Mark356
Dies with sente
Posts: 85
Joined: Sun Oct 10, 2010 2:15 am
Rank: KGS 7k
GD Posts: 0
KGS: markjgc, zombieboy
Has thanked: 30 times
Been thanked: 3 times

Re: How to make diagrams

Post by Mark356 »

A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: How to make diagrams

Post by Kirby »

Mark356 wrote:A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?


I see what you're referring to. It may have something to do with the update I made yesterday. I'm investigating it now.
be immersed
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: How to make diagrams

Post by Kirby »

Mark356 wrote:A lot of the diagrams in my study journal aren't showing up. Am I doing something wrong?


Were your diagrams working before?

I can find two issues in the diagrams in your study journal, which might make all of your problems go away:

1.) Do not add extra line breaks after the title line. An example of this is here:

Code: Select all

[go]$$W 

$$ | . . . . . . . . . . . . . . . . . . . |
$$ | . . O . . . . . . . . . . . . . O . . |
$$ | . . . . . . . . . . . . X . . . . . . |
$$ | . . X . . . . . . . . . . . . . . . . |
$$ | . . . O O . . . . . . X . O 8 . X . . |
$$ | . . O O X O O . O , . . 6 4 5 9 . . . |
$$ | . . X X X X . . . O . X 2 O 7 X 0 . . |
$$ | . . . . . . . X X O . 1 3 . . . . . . |
$$ | . . . . . . . . . . . . . . . . . . . |
$$  ---------------------------------------[/go]


Above, you do not need the extra newline after the title line.

2.) You do not need extra spaces before your lines:

Code: Select all

[go]$$B 
  $$ --------------------
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . 3 1 . X . . . |
  $$ , . 4 2 O . , . . . |
  $$ . . . . . . O . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ . . . . . . . . . . |
  $$ , . . . . . , . . . |[/go]


Here, there are two leading spaces before each of the lines (except for the title line). If you remove the leading spaces, you should be good to go.

---

Both of these are issues that I can work on fixing by doing some extra parsing of the text, but in the meantime, if you want your diagrams to work, you should be able to apply these format modifications.
be immersed
Mark356
Dies with sente
Posts: 85
Joined: Sun Oct 10, 2010 2:15 am
Rank: KGS 7k
GD Posts: 0
KGS: markjgc, zombieboy
Has thanked: 30 times
Been thanked: 3 times

Re: How to make diagrams

Post by Mark356 »

No, they weren't working before. I'd been wondering what was wrong, and wondering if maybe it was just me, since sometimes I'll make a diagram that other people can see but I can't.

But they're fixed now! Apparently it was just a space issue. I don't know how some of those extra spaces got in there, but at least for one of the posts, once they were in one diagram, they were in all of them, since I mostly pasted from one to the next. But it was a simple matter to remove them, and now they look fine. Thanks so much!
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: How to make diagrams

Post by Kirby »

Line wrapping functionality has been added to the diagram annotation feature: viewtopic.php?f=14&t=3340
be immersed
thequietcenter
Dies with sente
Posts: 87
Joined: Thu Nov 18, 2010 12:55 pm
Rank: 9k
GD Posts: 0
OGS: thequietcenter
Has thanked: 8 times
Been thanked: 2 times

Re: How to make diagrams

Post by thequietcenter »

It'z too bad when you link to a particular move number in Eidogo you cant export that as SGF :)
My OGS profile is https://online-go.com/user/view/1084709
My twitch stream is https://www.twitch.tv/thedeepself
My flashcard software for baduk is www.may69.com/flash-goban
thequietcenter
Dies with sente
Posts: 87
Joined: Thu Nov 18, 2010 12:55 pm
Rank: 9k
GD Posts: 0
OGS: thequietcenter
Has thanked: 8 times
Been thanked: 2 times

Re: How to make diagrams

Post by thequietcenter »

Maybe there should be a way to simply provide SGF for a game and have it display the game at the last move played instead of the first move.
My OGS profile is https://online-go.com/user/view/1084709
My twitch stream is https://www.twitch.tv/thedeepself
My flashcard software for baduk is www.may69.com/flash-goban
Post Reply