diff --git a/lib/plox.ex b/lib/plox.ex index dcdf889..ba2ba8c 100644 --- a/lib/plox.ex +++ b/lib/plox.ex @@ -199,6 +199,7 @@ defmodule Plox do """ @doc type: :component + attr :id, :string, default: nil attr :dataset, :any, required: true attr :x, :atom, default: :x, doc: "The dataset axis key to use for x values" @@ -211,25 +212,29 @@ defmodule Plox do def line_plot(%{type: :line} = assigns) do ~H""" - GraphDataset.to_graph_points(@x, @y) |> polyline_points()} - fill="none" - stroke={@color} - stroke-width={@width} - stroke-dasharray={stroke_dasharray(@line_style)} - /> + + GraphDataset.to_graph_points(@x, @y) |> polyline_points()} + fill="none" + stroke={@color} + stroke-width={@width} + stroke-dasharray={stroke_dasharray(@line_style)} + /> + """ end def line_plot(%{type: :step_line} = assigns) do ~H""" - step_points(@x, @y) |> polyline_points()} - fill="none" - stroke={@color} - stroke-width={@width} - stroke-dasharray={stroke_dasharray(@line_style)} - /> + + step_points(@x, @y) |> polyline_points()} + fill="none" + stroke={@color} + stroke-width={@width} + stroke-dasharray={stroke_dasharray(@line_style)} + /> + """ end @@ -250,6 +255,7 @@ defmodule Plox do """ @doc type: :component + attr :id, :string, default: nil attr :dataset, :any, required: true attr :x, :atom, default: :x, doc: "The dataset axis key to use for x values" @@ -262,27 +268,29 @@ defmodule Plox do def points_plot(assigns) do ~H""" - + + + """ end @@ -291,6 +299,7 @@ defmodule Plox do """ @doc type: :component + attr :id, :string, default: nil attr :dataset, :any, required: true attr :x, :atom, default: :x, doc: "The dataset axis key to use for x values" @@ -308,34 +317,36 @@ defmodule Plox do def bar_plot(assigns) do ~H""" - <%= for point <- GraphDataset.to_graph_points(@dataset, @x, @y) do %> - - <% end %> + + <%= for point <- GraphDataset.to_graph_points(@dataset, @x, @y) do %> + + <% end %> + """ end @@ -422,6 +433,7 @@ defmodule Plox do """ @doc type: :component + attr :id, :string, default: nil attr :dataset, :any, required: true attr :area, :atom, required: true, doc: "The dataset axis key to use for the area plots" @@ -434,67 +446,71 @@ defmodule Plox do def area_plot(%{orientation: :horizontal} = assigns) do ~H""" - <%= for [scalar1, scalar2] <- area_points(@dataset, @area, @orientation), rect_color = GraphDataset.to_color(@dataset, @color, scalar1.data_point) do %> - - <% end %> + + <%= for [scalar1, scalar2] <- area_points(@dataset, @area, @orientation), rect_color = GraphDataset.to_color(@dataset, @color, scalar1.data_point) do %> + + <% end %> + """ end def area_plot(%{orientation: :vertical} = assigns) do ~H""" - <%= for [scalar1, scalar2] <- area_points(@dataset, @area, @orientation), rect_color = GraphDataset.to_color(@dataset, @color, scalar1.data_point) do %> - - <% end %> + + <%= for [scalar1, scalar2] <- area_points(@dataset, @area, @orientation), rect_color = GraphDataset.to_color(@dataset, @color, scalar1.data_point) do %> + + <% end %> + """ end diff --git a/mix.exs b/mix.exs index 189c97a..af471cc 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Plox.MixProject do use Mix.Project - @version "0.3.2" + @version "0.3.3" @source_url "https://github.com/gridpoint-com/plox" def project do