From be21b2fb7d2c22c29ba42815c6dccb943c1c28d2 Mon Sep 17 00:00:00 2001 From: Cody Rogers Date: Thu, 4 Jun 2026 13:21:28 -0500 Subject: [PATCH 1/5] Add sticky_left_axis and sticky_right_axis slot support --- lib/plox.ex | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/plox.ex b/lib/plox.ex index 94f3d89..9f79496 100644 --- a/lib/plox.ex +++ b/lib/plox.ex @@ -51,6 +51,8 @@ defmodule Plox do slot :legend slot :tooltips + slot :sticky_left_axis, doc: "Y-axes included in this slot will stick to the left of the graph" + slot :sticky_right_axis, doc: "Y-axes included in this slot will stick to the right of the graph" slot :inner_block, required: true def graph(assigns) do @@ -78,10 +80,22 @@ defmodule Plox do
+ <%= for sticky_left_axis <- @sticky_left_axis do %> +
+ {render_slot(sticky_left_axis, @graph)} +
+ <% end %> + {render_slot(@inner_block, @graph)} + <%= for sticky_right_axis <- @sticky_right_axis do %> +
+ {render_slot(sticky_right_axis, @graph)} +
+ <% end %> + <%= for tooltip <- @tooltips do %> {render_slot(tooltip, @graph)} <% end %> From 730325695365f22a3b4291faae9e67e5a355b927 Mon Sep 17 00:00:00 2001 From: Cody Rogers Date: Thu, 4 Jun 2026 13:27:42 -0500 Subject: [PATCH 2/5] bump version to 0.3.2 --- mix.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index c0b8544..189c97a 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Plox.MixProject do use Mix.Project - @version "0.3.1" + @version "0.3.2" @source_url "https://github.com/gridpoint-com/plox" def project do From 0c1b587b8654537eaf368849dc3b868df5d1554d Mon Sep 17 00:00:00 2001 From: Cody Rogers Date: Thu, 4 Jun 2026 13:52:31 -0500 Subject: [PATCH 3/5] Small refactor --- lib/plox.ex | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/plox.ex b/lib/plox.ex index 9f79496..a914445 100644 --- a/lib/plox.ex +++ b/lib/plox.ex @@ -80,21 +80,17 @@ defmodule Plox do
- <%= for sticky_left_axis <- @sticky_left_axis do %> -
- {render_slot(sticky_left_axis, @graph)} -
- <% end %> +
+ {render_slot(@sticky_left_axis, @graph)} +
{render_slot(@inner_block, @graph)} - <%= for sticky_right_axis <- @sticky_right_axis do %> -
- {render_slot(sticky_right_axis, @graph)} -
- <% end %> +
+ {render_slot(@sticky_right_axis, @graph)} +
<%= for tooltip <- @tooltips do %> {render_slot(tooltip, @graph)} From ad7e0baf66e8578190c414cdd2fc9823d50ef293 Mon Sep 17 00:00:00 2001 From: Cody Rogers Date: Thu, 4 Jun 2026 14:04:51 -0500 Subject: [PATCH 4/5] Another small refactor --- lib/plox.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/plox.ex b/lib/plox.ex index a914445..dc28318 100644 --- a/lib/plox.ex +++ b/lib/plox.ex @@ -80,7 +80,8 @@ defmodule Plox do
-
+ +
{render_slot(@sticky_left_axis, @graph)}
@@ -88,7 +89,7 @@ defmodule Plox do {render_slot(@inner_block, @graph)} -
+
{render_slot(@sticky_right_axis, @graph)}
From 57c4678761c3b883979eefbe5476060d54488776 Mon Sep 17 00:00:00 2001 From: Cody Rogers Date: Thu, 4 Jun 2026 14:06:04 -0500 Subject: [PATCH 5/5] mix format --- lib/plox.ex | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/plox.ex b/lib/plox.ex index dc28318..dcdf889 100644 --- a/lib/plox.ex +++ b/lib/plox.ex @@ -80,8 +80,10 @@ defmodule Plox do
- -
+
{render_slot(@sticky_left_axis, @graph)}
@@ -89,7 +91,10 @@ defmodule Plox do {render_slot(@inner_block, @graph)} -
+
{render_slot(@sticky_right_axis, @graph)}