Skip to content

Commit

Permalink
Hasse diagram contains a deep copy of the poset
Browse files Browse the repository at this point in the history
  • Loading branch information
scheinerman committed Sep 3, 2024
1 parent 97af485 commit e12c46e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordere

## Basic Usage

To create a Hasse diagram for a `Poset` and draw it on the screen, do this:
```
julia> using Posets, HasseDiagrams
julia> p = subset_lattice(3)
{8, 19} Int64 poset
Expand All @@ -13,6 +16,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`.

## Creating a Layout

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-02T15:15:13","documenter_version":"1.6.0"}}
{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-03T17:15:22","documenter_version":"1.6.0"}}
8 changes: 5 additions & 3 deletions docs/build/index.html

Large diffs are not rendered by default.

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.

4 changes: 4 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Drawings of [Posets](https://github.com/scheinerman/Posets.jl) (partially ordere

## Basic Usage

To create a Hasse diagram for a `Poset` and draw it on the screen, do this:
```
julia> using Posets, HasseDiagrams
julia> p = subset_lattice(3)
{8, 19} Int64 poset
Expand All @@ -13,6 +16,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`.

## Creating a Layout

Expand Down
2 changes: 1 addition & 1 deletion src/HasseDiagrams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mutable struct HasseDiagram
labels[v] = v
end

return new(p, xy, RADIUS, FILL_COLOR, labels, FONT_SIZE)
return new(deepcopy(p), xy, RADIUS, FILL_COLOR, labels, FONT_SIZE)
end
end

Expand Down

0 comments on commit e12c46e

Please sign in to comment.