From 49d208b1906f2f39be823d4364941ab3613275cf Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 16 Jul 2018 01:09:49 +0000 Subject: [PATCH] WIP gim: I had started working on some file vertex.go, not sure if I'll end up needing it or not --- gim/view/vertex.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gim/view/vertex.go diff --git a/gim/view/vertex.go b/gim/view/vertex.go new file mode 100644 index 0000000..75c7b68 --- /dev/null +++ b/gim/view/vertex.go @@ -0,0 +1,27 @@ +package view + +import ( + "github.com/mediocregopher/ginger/gim/geo" + "github.com/mediocregopher/ginger/gim/terminal" +) + +type edge struct { + from, to *vertex + tail, head rune // if empty do directional segment char + body string + switchback bool + + lineStyle terminal.LineStyle +} + +type vertex struct { + coord, pos geo.XY + in, out [][]*edge // top level is port index + body string + + // means it won't be drawn, and will be removed and have its in/out edges + // spliced together into a single edge. + ephemeral bool + + lineStyle terminal.LineStyle // if zero value don't draw border +}