mirror of
https://github.com/rgleichman/glance.git
synced 2024-09-11 15:05:41 +03:00
Add result icon
This commit is contained in:
parent
65e4a49d05
commit
13325deb6a
@ -12,7 +12,8 @@ module Icons
|
|||||||
connectIconToIcon,
|
connectIconToIcon,
|
||||||
textBox,
|
textBox,
|
||||||
enclosure,
|
enclosure,
|
||||||
lambdaRegion
|
lambdaRegion,
|
||||||
|
resultIcon
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Diagrams.Prelude
|
import Diagrams.Prelude
|
||||||
@ -125,3 +126,6 @@ lambdaIcon x = coloredTextBox lime transparent "λ" # alignB <> makePort x
|
|||||||
-- | lambdaRegion takes as an argument the numbers of parameters to the lambda,
|
-- | lambdaRegion takes as an argument the numbers of parameters to the lambda,
|
||||||
-- and draws the diagram inside a region with the lambda icons on top.
|
-- and draws the diagram inside a region with the lambda icons on top.
|
||||||
lambdaRegion n dia = hsep 0.4 (take n (map lambdaIcon [0,1..])) # center === enclosure dia
|
lambdaRegion n dia = hsep 0.4 (take n (map lambdaIcon [0,1..])) # center === enclosure dia
|
||||||
|
|
||||||
|
-- RESULT ICON --
|
||||||
|
resultIcon = unitSquare # lw none # fc lime
|
||||||
|
@ -17,11 +17,10 @@ apply0B = applyDia # nameDiagram "B"
|
|||||||
ex3 = atPoints (map p2 [(0,0), (3,0)]) [apply0A, apply0B]
|
ex3 = atPoints (map p2 [(0,0), (3,0)]) [apply0A, apply0B]
|
||||||
fromAtoB = ex3 # connectPorts "A" (PortName 0) "B" (PortName 2)
|
fromAtoB = ex3 # connectPorts "A" (PortName 0) "B" (PortName 2)
|
||||||
ex4 = apply0A ||| textBox "hello world" === textBox "1" === textBox "gpq" === textBox ['A'..'Z']
|
ex4 = apply0A ||| textBox "hello world" === textBox "1" === textBox "gpq" === textBox ['A'..'Z']
|
||||||
ex5 = textBox "baz" # named "baz"||| hrule 1 ||| fromAtoB ||| hrule 1 ||| textBox "foo" # named "foo" === vrule 1 === textBox "bar" # named "bar"
|
ex5 = resultIcon # named "res"||| hrule 1 ||| fromAtoB ||| hrule 1 ||| textBox "foo" # named "foo" === vrule 1 === textBox "bar" # named "bar"
|
||||||
ex6 = ex5 # connectIconToPort "baz" "A" (PortName 2) # connectIconToPort "foo" "B" (PortName 0)
|
ex6 = ex5 # connectIconToPort "res" "A" (PortName 2) # connectIconToPort "foo" "B" (PortName 0)
|
||||||
# connectIconToPort "bar" "B" (PortName 3) # centerXY
|
# connectIconToPort "bar" "B" (PortName 3) # centerXY
|
||||||
ex7 = ex6 # center # showOrigin # showEnvelope
|
ex7 = ex6 # center # showOrigin # showEnvelope
|
||||||
--ex8 = ex6 <> boundingRect (ex6 # frame 0.5) # lc blue # lw veryThick
|
|
||||||
ex8 = enclosure ex6
|
ex8 = enclosure ex6
|
||||||
ex9 = lambdaRegion 3 ex6 # nameDiagram "lam0"
|
ex9 = lambdaRegion 3 ex6 # nameDiagram "lam0"
|
||||||
ex10 = ex9 # connectPorts ("lam0" .> "A") (PortName 1) "lam0" (PortName 0)
|
ex10 = ex9 # connectPorts ("lam0" .> "A") (PortName 1) "lam0" (PortName 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user