View Source Changelog
v0.2.0 (2023-09-23)
Added
- Add
Tucan.jointplot/4
composite plot.
Tucan.jointplot(
:penguins,
"Beak Length (mm)",
"Beak Depth (mm)",
marginal: :density,
color_by: "Species",
marginal_opts: [fill_opacity: 0.5]
)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","bounds":"flush","data":{"url":"https://raw.githubusercontent.com/vega/vega-datasets/next/data/penguins.json"},"spacing":15,"vconcat":[{"encoding":{"color":{"field":"Species"},"x":{"axis":null,"field":"value","scale":{"zero":false},"type":"quantitative"},"y":{"field":"density","type":"quantitative"}},"height":90,"mark":{"fillOpacity":0.5,"orient":"vertical","type":"area"},"transform":[{"counts":false,"cumulative":false,"density":"Beak Length (mm)","groupby":["Species"],"maxsteps":200,"minsteps":25}]},{"bounds":"flush","hconcat":[{"encoding":{"color":{"field":"Species","type":"nominal"},"x":{"field":"Beak Length (mm)","scale":{"zero":false},"type":"quantitative"},"y":{"field":"Beak Depth (mm)","scale":{"zero":false},"type":"quantitative"}},"height":200,"mark":{"fillOpacity":1,"type":"point"},"width":200},{"encoding":{"color":{"field":"Species"},"x":{"field":"density","type":"quantitative"},"y":{"axis":null,"field":"value","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":0.5,"orient":"horizontal","type":"area"},"transform":[{"counts":false,"cumulative":false,"density":"Beak Depth (mm)","groupby":["Species"],"maxsteps":200,"minsteps":25}],"width":90}],"spacing":15}]}
- Add
Tucan.punchcard/5
plot. This is similar to heatmap but the third dimension is encoded by size instead of color.
Tucan.punchcard(:glue, "Task", "Model", "Score")
|> Tucan.color_by("Score", recursive: true, type: :quantitative)
|> Tucan.set_size(250, 250)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","__tucan__":{"multilayer":true},"data":{"url":"https://raw.githubusercontent.com/mwaskom/seaborn-data/master/glue.csv"},"height":250,"layer":[{"encoding":{"color":{"field":"Score","type":"quantitative"},"size":{"aggregate":"mean","field":"Score","type":"quantitative"},"x":{"field":"Task","type":"nominal"},"y":{"field":"Model","type":"nominal"}},"mark":{"fillOpacity":1,"type":"circle"}}],"width":250}
- Add
Tucan.heatmap/5
plot.
Tucan.heatmap(:glue, "Task", "Model", "Score", annotate: true, text: [format: ".1f"])
|> Tucan.set_size(250, 250)
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","__tucan__":{"multilayer":true},"data":{"url":"https://raw.githubusercontent.com/mwaskom/seaborn-data/master/glue.csv"},"height":250,"layer":[{"encoding":{"color":{"aggregate":"mean","field":"Score","type":"quantitative"},"x":{"field":"Task","type":"nominal"},"y":{"field":"Model","type":"nominal"}},"mark":{"fillOpacity":1,"type":"rect"}},{"encoding":{"text":{"aggregate":"mean","field":"Score","format":".1f","type":"quantitative"},"x":{"field":"Task","type":"nominal"},"y":{"field":"Model","type":"nominal"}},"mark":"text"}],"width":250}
- Add
Tucan.hruler/2
,Tucan.vruler/2
andTucan.ruler/4
helpers.
Tucan.scatter(:iris, "petal_width", "petal_length", width: 300)
|> Tucan.hruler(3, line_color: "green")
|> Tucan.vruler("petal_width", color_by: "species", stroke_width: 3)
|> Tucan.hruler("petal_length", color_by: "species")
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"layer":[{"encoding":{"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"mark":{"fillOpacity":1,"type":"point"}},{"encoding":{"y":{"datum":3}},"mark":{"color":"green","strokeWidth":1,"type":"rule"}},{"encoding":{"color":{"field":"species"},"x":{"aggregate":"mean","field":"petal_width","type":"quantitative"}},"mark":{"color":"black","strokeWidth":3,"type":"rule"}},{"encoding":{"color":{"field":"species"},"y":{"aggregate":"mean","field":"petal_length","type":"quantitative"}},"mark":{"color":"black","strokeWidth":1,"type":"rule"}}],"width":300}
Add
Tucan.Legend
module for customizing legend properties.Add
Tucan.Scale
helper module with helper functions for working with scales, likeTucan.Scale.set_color_scheme/3
.Add
Tucan.set_size/3
helper for setting both width and height at once.Add
Tucan.Axes.set_xy_titles/3
for setting axes titles at once.Port more themes from
vega-themes
, checkTucan.Themes
for all available themes.Add
Tucan.layers/2
helper
Tucan.layers([
Tucan.scatter(:iris, "petal_width", "petal_length", point_color: "red"),
Tucan.scatter(:iris, "sepal_width", "sepal_length", point_color: "green")
])
{"$schema":"https://vega.github.io/schema/vega-lite/v5.json","layer":[{"data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"x":{"field":"petal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"petal_length","scale":{"zero":false},"type":"quantitative"}},"mark":{"color":"red","fillOpacity":1,"type":"point"}},{"data":{"url":"https://gist.githubusercontent.com/curran/a08a1080b88344b0c8a7/raw/0e7a9b0a5d22642a06d3d5b9bcbad9890c8ee534/iris.csv"},"encoding":{"x":{"field":"sepal_width","scale":{"zero":false},"type":"quantitative"},"y":{"field":"sepal_length","scale":{"zero":false},"type":"quantitative"}},"mark":{"color":"green","fillOpacity":1,"type":"point"}}]}
Added plots options
- Support
:filled
option inTucan.scatter/4
- Support
:wrapped
mode inTucan.facet_by/4
- Support
:color_by
option inTucan.stripplot/3
- Support
:line_color
option inTucan.lineplot/4
- Support
:point_color
,:point_shape
and:point_size
inTucan.scatter/4
Fixed
- Support setting
:orient
inTucan.density/3
. - Make size encodings quantitative by default.
Deprecated
- Made
Tucan.VegaLiteUtils
private. Tucan.Axes.put_axis_options
is renamed toTucan.Axes.put_options/3
- Rename
:groupby
to:group_by
inTucan.boxplot/3
options.
v0.1.1 (2023-08-29)
Added
- Add
concat/2
,hconcat/2
andvconcat/2
helper concatenation functions.
v0.1.0 (2023-08-28)
Initial release.