Skip to content

Commit

Permalink
Ready for announcement
Browse files Browse the repository at this point in the history
  • Loading branch information
scheinerman committed Sep 4, 2024
1 parent a36e9f3 commit 0ee1bfa
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name = "HasseDiagrams"
uuid = "eda30fb7-e799-4e1d-8790-5b2716643197"
authors = ["Ed Scheinerman <ers@jhu.edu>"]
version = "0.0.2"
version = "0.1.0"

[deps]
Posets = "9a158a65-591e-4f68-ac4f-9ffef2fc51f2"
SimpleDrawing = "d78a06e8-ae74-583c-9a07-0d6572347000"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"

Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"


Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# HasseDiagrams

Drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordered sets).
[Hasse diagrams](https://en.wikipedia.org/wiki/Hasse_diagram) are
drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordered sets).

## Basic Usage

Expand All @@ -16,7 +17,7 @@ Hasse diagram of a {8, 19} Int64 poset
julia> draw(h)
```
Note that `h` contains a copy of `p`, so subsequent changes to `p` are not reflected in `h`.
> Note that `h` contains a copy of `p`, so subsequent changes to `p` are not reflected in `h`.
## Creating a Layout

Expand All @@ -25,7 +26,7 @@ When a Hasse diagram is created, it is given a default layout. Hasse diagrams ca
* `set_xy!(h, method)` uses the function `method` to compute the layout. The function acts on the posets held inside `h`. The list of available layout methods is in the next section.
* `set_xy!(h, xy)` uses the dictionary `xy` to site the vertices. Vertex `v` is placed at `xy[v]`. If `v` is not a key of `xy`, then its location is unchanged.

### Scaling
#### Scaling

The function `scale!(p,μ)` multiplies all coordinates in the embedding by `μ`.
It is likely more useful just to multiply the `x`- or `y`-coordinates;
Expand Down
2 changes: 1 addition & 1 deletion docs/build/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-03T17:15:22","documenter_version":"1.6.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-04T11:38:28","documenter_version":"1.6.0"}}
6 changes: 3 additions & 3 deletions docs/build/index.html

Large diffs are not rendered by default.

Binary file modified docs/build/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/search_index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# HasseDiagrams

Drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordered sets).
[Hasse diagrams](https://en.wikipedia.org/wiki/Hasse_diagram) are
drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordered sets).

## Basic Usage

Expand All @@ -16,7 +17,7 @@ Hasse diagram of a {8, 19} Int64 poset
julia> draw(h)
```
Note that `h` contains a copy of `p`, so subsequent changes to `p` are not reflected in `h`.
> Note that `h` contains a copy of `p`, so subsequent changes to `p` are not reflected in `h`.
## Creating a Layout

Expand All @@ -25,7 +26,7 @@ When a Hasse diagram is created, it is given a default layout. Hasse diagrams ca
* `set_xy!(h, method)` uses the function `method` to compute the layout. The function acts on the posets held inside `h`. The list of available layout methods is in the next section.
* `set_xy!(h, xy)` uses the dictionary `xy` to site the vertices. Vertex `v` is placed at `xy[v]`. If `v` is not a key of `xy`, then its location is unchanged.

### Scaling
#### Scaling

The function `scale!(p,μ)` multiplies all coordinates in the embedding by `μ`.
It is likely more useful just to multiply the `x`- or `y`-coordinates;
Expand Down
9 changes: 8 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
using Test
using Posets, HasseDiagrams

@test true

p = chain(1) / (chain(2) + chain(1)) / chain(2)
h = HasseDiagram(p)
set_xy!(h, layered_layout)
coords = values(get_xy(h))
ys = [ v[2] for v in coords ]

@test maximum(ys) == height(p)

0 comments on commit 0ee1bfa

Please sign in to comment.