Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
e7d08ad
First commit
Sep 11, 2019
9b01a7a
Update README.md
Sep 11, 2019
16e6405
Fix one more bug
Sep 11, 2019
375ec39
Reduce number of warnings
Sep 11, 2019
b82df49
suppress halogen-svg warnings
Sep 11, 2019
a184ae7
Supress shadowedName warnings (during bundling only)
Sep 11, 2019
a4aa3b1
Clean up code
Sep 12, 2019
8704787
changes for vscode
Sep 19, 2019
ebac222
Generate haskell arrow code
Sep 20, 2019
6026071
smaller generated arrow code
Sep 20, 2019
53c19b7
Cleaner generated haskell code
Sep 24, 2019
30fede9
fixes
Sep 25, 2019
df67ca6
Visual Studio integration with Halogen component lifecycle. #4 (WIP)
epost Sep 20, 2019
7cb4313
Merge pull request #11 from statebox/generate-haskell
sjoerdvisscher Sep 26, 2019
0453d6b
Add spiders
Sep 26, 2019
1d51401
Fix saving state in hash in Safari
Sep 26, 2019
501fee1
Replace explicit record type by App.Input alias. #4
epost Sep 26, 2019
c8b8ff0
Put {pixels,context} into field in App.State. #14
epost Sep 26, 2019
4c93814
Qualify fromPixels as Bricks.fromPixels. #14
epost Sep 26, 2019
2fef6db
Fix doc comment. #14
epost Sep 26, 2019
0fce0bd
Merge pull request #15 from statebox/14/vscode-expose-data
epost Sep 26, 2019
9b20406
Refactor generated code
Sep 27, 2019
dd273e3
Merge branch 'master' into 4/vscode-halogen-io
epost Sep 27, 2019
9382b21
Replace another written-out App.Input record by its alias. #4
epost Sep 27, 2019
7777c2f
Rename setPixels and setPixelsAndContext to setInput. #4
epost Sep 27, 2019
ca2581b
Eliminate repetition of fields from Bricks.Input. #14
epost Sep 27, 2019
e3a10fd
Move View.Bricks model state into its own field 'input :: Input'. #14
epost Sep 27, 2019
9f5b8a7
Copy to clipboard buttons
Sep 27, 2019
3c5c948
Merge pull request #17 from statebox/14/vscode-expose-data-2
sjoerdvisscher Sep 27, 2019
b62b832
Update src/View/CopyToClipboard.js
sjoerdvisscher Sep 27, 2019
5d43746
Update src/View/CopyToClipboard.purs
sjoerdvisscher Sep 27, 2019
ce1ab3b
Create .editorconfig
Sep 27, 2019
1404d62
Merge pull request #18 from statebox/copy-to-clipboard
sjoerdvisscher Sep 27, 2019
abe387f
Merge pull request #19 from statebox/editorconfig
epost Sep 27, 2019
dc7f3a2
Factor Bricks.Input formation out of bricksView. #14
epost Sep 27, 2019
4d3b2b8
Merge pull request #20 from statebox/14/vscode-expose-data-3
epost Sep 28, 2019
2dc20e5
Don't automatically install the component on module load. #4
epost Sep 28, 2019
70c4991
Merge pull request #13 from statebox/4/vscode-halogen-io
sjoerdvisscher Sep 29, 2019
62ac7de
Clean up type inferencing
Sep 29, 2019
867ebb9
Move i/o connection matching to view/bricks
Sep 30, 2019
ef4bc10
Detect more type errors in spiders
Sep 30, 2019
1319eee
Fix restorting state from location.hash
Sep 30, 2019
59125d9
Use parseHash function for restoring state
Sep 30, 2019
0f4f06a
tidy up
clayrat Sep 30, 2019
3ef9998
Merge pull request #24 from statebox/warnings
epost Sep 30, 2019
79bea37
Automatically trim trailing whitespace
Oct 1, 2019
de446b0
Don't put labels on wires, center labels above node
Oct 2, 2019
ca63e90
Fix label bug
Oct 2, 2019
c0d5d16
Make wire bricks clickable
Oct 2, 2019
9d828ec
More greek
Oct 2, 2019
2227c92
Fix disappearing wires
Oct 2, 2019
a3ee533
make selected wires visible again
Oct 3, 2019
798fe4c
Typed terms
Oct 6, 2019
29928a2
Show types on identities in Term view
Oct 6, 2019
6d07591
Show types with perms and spiders in term view
Oct 7, 2019
10f7e00
Remove ann field from TC and TT and use Ann
Oct 7, 2019
4dd9af9
Make variable names in TypedTerm just strings
Oct 7, 2019
d7fc617
Make use of typed term in output formats
Oct 7, 2019
6ff199b
Add direction arrows
Oct 8, 2019
8d4daf5
Cup and Cap
Oct 8, 2019
0c0bc21
Switch from Int /\ Int to { x :: Int, y :: Int }
Oct 9, 2019
b573c43
use Parcel to run and bundle (#30)
sjoerdvisscher Oct 10, 2019
814ff3e
Expose bricksView-related code to vscode. #14 (#26)
epost Oct 10, 2019
ee62027
Fix npm start and move static files to html dir
Oct 10, 2019
33e197f
Merge branch 'master' of https://github.com/statebox/purescript-kdmoncat
Oct 10, 2019
c7b8773
Url encode parenthesis
Oct 12, 2019
bcdb705
Generate cleaner haskell arrow code
Oct 12, 2019
aa27cfa
Reduce parenthesis in generated Haskell code
Oct 14, 2019
06b3aa0
Allow a name and multiple pixel letters per type
Nov 25, 2019
6a33d68
Use names i/o bids in generated JSON and Haskell
Nov 26, 2019
0bb5df1
Switch to purescript-vec
Nov 27, 2019
e83448f
Use github token to access private vec package
Dec 2, 2019
bb9e0ac
Use names in terms view
sjoerdvisscher Dec 5, 2019
c2f5cac
Make sure the labels fit in their boxes
sjoerdvisscher Dec 5, 2019
514a5de
Some syntax and comments changes. #34
epost Dec 6, 2019
b004c4e
Explicitly type unsafe coercion from Element -> HTMLElement. #34
epost Dec 6, 2019
0ec743f
Make sure the labels fit in their boxes (#34)
epost Dec 6, 2019
a92a0ae
Fix text positioning in Safari
sjoerdvisscher Dec 10, 2019
b87cd1a
Add 'halogen-kdmoncat/' from commit 'a92a0ae6f142477e2bc89869a86e62e1…
epost Dec 13, 2019
880df55
halogen-kdmoncat: Put kdmoncat modules under KDMonCat module. #257
epost Dec 13, 2019
cd648be
studio: Render wiring diagrams in kdmoncat. #257
epost Dec 13, 2019
403488e
halogen-kdmoncat: Fix compilation failure related to purescript-vec r…
epost Dec 13, 2019
73e48dd
stbx-lang: Adapt diagram parser for use with the kdmoncat wiring view…
epost Dec 13, 2019
9328d66
studio: Move conversion of DiagramInfo to Operators into stbx-lang. #257
epost Dec 13, 2019
f6067cd
studio: Fix whitespace. #257
epost Dec 13, 2019
57728ba
stbx-lang: Refactor fromOps for clarity. #257.
epost Dec 13, 2019
62ae4c4
studio: Refactor a 'let' to 'where'. #257
epost Dec 16, 2019
ddb97c0
prefix kdmoncat bricks css with kdmoncat
sjoerdvisscher Dec 17, 2019
69827ea
Prefix bricks component with kdmoncat
sjoerdvisscher Dec 17, 2019
aa9ff22
Refactor fromOps
sjoerdvisscher Dec 17, 2019
63f27ba
halogen-kdmoncat: Remove ABOUT.md. #257
epost Dec 17, 2019
71953f7
studio: Qualify fromOperators as DiagramV2.fromOperators. #257
epost Dec 17, 2019
0e79d42
studio: Qualify as KDMonCat.Bricks instead of KDMonCatBricks. #257
epost Dec 17, 2019
81eeeda
studio: use 'zero' for 'Box' instead of the explicit version. #257
epost Dec 17, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions halogen-kdmoncat/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
12 changes: 12 additions & 0 deletions halogen-kdmoncat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/bower_components/
/node_modules/
/.pulp-cache/
/output/
/generated-docs/
/.psc-package/
/.psc*
/.purs*
/.psa*
/.spago
/.cache
/dist
36 changes: 36 additions & 0 deletions halogen-kdmoncat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# kdmoncat brick diagram editor for monoidal categories and beyond

[![Netlify Status](https://api.netlify.com/api/v1/badges/683fd161-cc3e-42dc-84af-7b77259af156/deploy-status)](https://app.netlify.com/sites/cranky-goldstine-6a507b/deploys)


## setup

```
npm install
```

## usage

Run these simultaneously:

- `npm run watch`
- `npm start`

Then open `localhost:1234` in your browser.

### usage without server

Run these simultaneously:

- `npm run watch`
- `npm run start1`

Then open `dist/index.html` in your browser.

## bundling

```
npm run bundle
```

This generates a static version in `dist/index.html`.
248 changes: 248 additions & 0 deletions halogen-kdmoncat/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
<meta charset="UTF-8">
<style>
* { box-sizing: border-box; }
*:focus {
outline: none;
}
html, body {
font-family: sans-serif;
background: #eee;
color: #444;
margin: 0;
padding: 0;
}


.app {
display: flex;
flex-direction: column;
height: 100vh;
padding: 20px;
}
.app > a {
position: absolute;
width: 100px;
height: 100px;
right: 0;
bottom: 0;
background-image: url(logo-statebox.svg);
background-size: 100% 100%;
background-origin: content-box;
background-repeat: no-repeat;
padding: 20px;
}
.main {
flex: 1;
display: flex;
}
aside {
display: flex;
flex-direction: column;
width: 25vw;
margin: -10px 0 0 20px;
}
h2 {
font-size: inherit;
margin-top: 20px;
margin-bottom: 10px;
}
footer {
overflow: auto;
margin-right: 80px;
}


.bricks {
position: relative;
justify-self: stretch;
display: grid;
grid-gap: 2px;
flex: 1;
user-select: none;
-webkit-user-select: none;
}
.bricks svg {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.box > rect:first-child {
fill: rgba(0, 0, 0, .07);
transition: fill 0.3s;
}
.bricks:focus .box.selected > rect:first-child {
fill: rgba(0, 112, 204, 0.2);
}
.bricks.show-wires:not(:focus) .box > rect:first-child {
fill: rgba(221, 221, 221, 0) !important;
}
.inner-box {
fill: rgba(255, 255, 255, 0);
stroke: rgba(68, 68, 68, 0);
stroke-width: 0.01;
transition: fill 0.3s, stroke 0.3s;
}
.inner-box-text {
fill: white;
font-size: .4px;
font-weight: bold;
transition: fill 0.3s;
}
.bricks.show-wires .inner-box {
fill: white;
stroke: #444;
}
.bricks.show-wires .inner-box-text {
fill: #444;
}
.selection {
fill: none;
stroke: rgba(112, 112, 112, 0);
stroke-width: 0.02;
pointer-events: none;
transition: stroke 0.3s;
}
.bricks:focus .selection {
stroke: rgba(0, 112, 204, 0.7);
}
.object {
fill: #444;
stroke-width: 0;
transition: opacity 0.3s;
font-family: 'Times New Roman', Times, serif;
font-style: italic;
font-size: 0.13px;
}
.object.invalid {
fill: rgba(204, 0, 0, 1);
}
.show-wires path, .show-wires .object circle {
opacity: 0;
}
.object.equal.valid span.output {
display: none;
}
.line {
stroke: #444;
stroke-width: 0.01;
fill: none;
transition: opacity 0.3s, stroke 0.3s, stroke-width 0.3s;
}
.arrowhead {
fill: #444;
}
.object.invalid .line, .object.invalid .arrowhead {
stroke: rgba(204, 0, 0, 1);
}
.show-wires .line, .show-wires .arrowhead {
opacity: 1;
}
.show-bricks .box .line {
stroke: rgba(68, 68, 68, 0);
}
.bricks:focus::after {
content: 'Press alt to toggle between bricks and wires.';
position: absolute;
right: 0;
top: 100%;
font-family: 'Times New Roman', Times, serif;
font-style: italic;
padding-top: 5px;
}
.wires {
fill: #444;
}
.wires > rect:first-child {
opacity: 0;
}
.wires .node {
stroke: #444;
stroke-width: 0.01;
z-index: 1;
}
.wires .node.white {
fill: #fff;
}
.bricks:focus .wires.selected > rect:first-child {
fill: rgba(0, 112, 204, 0.1);
opacity: 1;
}
text.object[text-anchor=start] {
transform: translate(0.05px, -0.05px);
}
text.object[text-anchor=end] {
transform: translate(-0.05px, -0.05px);
}
text.object.centered {
text-anchor: middle !important;
transform: translate(0, -0.07px);
}

.fieldset {
display: grid;
grid-template-columns: auto 1fr;
grid-gap: 10px;
align-items: center;
}
.inputs {
display: grid;
grid-gap: 0 10px;
}
textarea, input {
border: none;
border-radius: 3px;
width: 100%;
font-family: 'Fira Code', 'Courier New', Courier, monospace;
font-size: 14px;
font-weight: 500;
color: inherit;
padding: 8px;
}
textarea {
flex: 1;
}


.term {
line-height: 20px;
margin-top: -10px;
}
.tc, .tt {
display: flex;
border-top: 20px solid rgba(0, 0, 0, .1);
border-radius: 5px;
transition: background-color 0.3s;
}
.selected.tc, .selected.tt, .selected .tc, .selected .tt {
border-top-color: rgba(0, 112, 204, 0.3);
}
.term > .tc, .term > .tt {
border-top: none;
}
.term span, .term i {
display: inline-block;
background: rgba(0, 0, 0, .2);
color: white;
min-width: 20px;
padding: 0 3px;
border-radius: 5px;
text-align: center;
font-family: 'Times New Roman', Times, serif;
transition: background-color 0.3s;
}
.term .selected span, .term .selected i {
background: rgba(0, 112, 204, 0.7);
color: white;
}
.term i {
background: rgba(0, 0, 0, .1);
color: inherit;
}
.term div {
margin: 5px 1px 0 1px;
}
</style>
<body></body>
<script src="index.js"></script>
4 changes: 4 additions & 0 deletions halogen-kdmoncat/html/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
var Main = require("../output/KDMonCat.Main")
var runHalogenAff = require("../output/Halogen.Aff.Util").runHalogenAff
var initialModel = Main.parseHash(location.hash)
runHalogenAff(Main.runJs2(initialModel)("body"))()
1 change: 1 addition & 0 deletions halogen-kdmoncat/html/logo-statebox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading