Skip to content

Commit

Permalink
Complete intended LegendEntry constructor (#281)
Browse files Browse the repository at this point in the history
* Complete intended `LegendEntry` constructor

* Add `LegendEntry` tests

* Increment version
  • Loading branch information
CiaranOMara authored Sep 17, 2021
1 parent 6049a8f commit 7b41de7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "PGFPlotsX"
uuid = "8314cec4-20b6-5062-9cdb-752b83310925"
version = "1.4.0"
version = "1.4.1"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
3 changes: 2 additions & 1 deletion src/axiselements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,8 @@ end
Corresponds to the `\\addlegendentry` and `\\addlegendentryexpanded` forms of
PGFPlots.
"""
LegendEntry(options::Options, name::AbstractString, isexpanded = false)
LegendEntry(options::Options, name::AbstractString, isexpanded = false) =
LegendEntry(options, name, isexpanded)

LegendEntry(name::AbstractString, isexpanded = false) =
LegendEntry(Options(), name, isexpanded)
Expand Down
2 changes: 2 additions & 0 deletions test/test_elements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ end
" 1 3 \\\\\n 2 4 \\\\\n }\n trailing\n ;\n"
# legend
@test repr_tex(Legend(["a", "b", "c"])) == "\\legend{{a},{b},{c}}\n"
@test repr_tex(@pgf LegendEntry({red}, "a")) == "\\addlegendentry[red] {a}\n"
@test repr_tex(@pgf LegendEntry({red}, "a", true)) == "\\addlegendentryexpanded[red] {a}\n"
l = LegendEntry("a")
@test repr_tex(l) == "\\addlegendentry {a}\n"
# axis
Expand Down

2 comments on commit 7b41de7

@KristofferC
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/45064

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.1 -m "<description of version>" 7b41de7160f3a1516e3cefb7eee419a9a55845d1
git push origin v1.4.1

Please sign in to comment.