View Source Changelog

v0.2.0 (2023-09-23)

Added

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}
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}
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}
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

Fixed

  • Support setting :orient in Tucan.density/3.
  • Make size encodings quantitative by default.

Deprecated

v0.1.1 (2023-08-29)

Added

  • Add concat/2, hconcat/2 and vconcat/2 helper concatenation functions.

v0.1.0 (2023-08-28)

Initial release.