Skip to content

Commit

Permalink
rename to in
Browse files Browse the repository at this point in the history
  • Loading branch information
pnezis committed Dec 29, 2023
1 parent 0815714 commit a61e156
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Tucan.scatter(:iris, "petal_width", "petal_length")
- Flipped `:orient` semantics for `Tucan.bar/4`
- Rename `:group` option to `:group_by` in `Tucan.stripplot/3` for consistency.
- Rename `:groupby` option to `:group_by` in `Tucan.density/3` for consistency.
- Rename `:area_color` option to `:fill_color` in `Tucan.density/3` for consistency.

### Deprecated

Expand Down
12 changes: 4 additions & 8 deletions lib/tucan.ex
Original file line number Diff line number Diff line change
Expand Up @@ -551,11 +551,6 @@ defmodule Tucan do
end

density_opts = [
area_color: [
type: :string,
doc: "The color of the density area plot",
section: :style
],
filled: [
type: :boolean,
doc: "Whether the density plot will be filled or not, default to `true` if not set",
Expand Down Expand Up @@ -648,6 +643,7 @@ defmodule Tucan do
:x,
:y,
:orient,
:fill_color,
:color
],
density_opts
Expand Down Expand Up @@ -741,12 +737,12 @@ defmodule Tucan do
|> Tucan.facet_by(:column, "Species")
```
You can change the color of the plot by setting the `:area_color` option and/or specify if it
You can change the color of the plot by setting the `:fill_color` option and/or specify if it
will be filled or not:
```tucan
Tucan.hconcat([
Tucan.density(:penguins, "Body Mass (g)", area_color: "red"),
Tucan.density(:penguins, "Body Mass (g)", fill_color: "red"),
Tucan.density(:penguins, "Body Mass (g)", filled: false)
])
```
Expand All @@ -762,7 +758,7 @@ defmodule Tucan do
mark_opts =
Tucan.Options.take_options(opts, @histogram_opts, :mark)
|> Keyword.merge(orient: :vertical)
|> Tucan.Keyword.put_not_nil(:color, opts[:area_color])
|> Tucan.Keyword.put_not_nil(:color, opts[:fill_color])
|> Tucan.Keyword.put_not_nil(:filled, opts[:filled])

transform_opts =
Expand Down
4 changes: 2 additions & 2 deletions test/tucan_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ defmodule TucanTest do
expected
end

test "with area_color, filled set" do
test "with fill_color, filled set" do
expected =
Vl.new()
|> Vl.data_from_url(@iris_dataset)
Expand All @@ -979,7 +979,7 @@ defmodule TucanTest do
axis: [title: "petal_width"]
)

assert Tucan.density(@iris_dataset, "petal_width", area_color: "green", filled: true) ==
assert Tucan.density(@iris_dataset, "petal_width", fill_color: "green", filled: true) ==
expected
end

Expand Down

0 comments on commit a61e156

Please sign in to comment.