From f55917290e77f2c697871d123ce91a72b99db4d9 Mon Sep 17 00:00:00 2001 From: Mohammed Sadique Date: Fri, 10 Jan 2025 16:11:18 +0530 Subject: [PATCH 1/3] title --- .gitignore | 3 ++- lib/matplotex.ex | 2 -- mix.lock | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d6478c8..07d3d2a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ matplotex-*.tar /tmp/ /.github -/samples \ No newline at end of file +/samples +/add_line.sh diff --git a/lib/matplotex.ex b/lib/matplotex.ex index 824ab66..965cdce 100644 --- a/lib/matplotex.ex +++ b/lib/matplotex.ex @@ -1,7 +1,5 @@ defmodule Matplotex do @moduledoc """ - # Matplotex - A lightweight and efficient Elixir library designed for server-side SVG generation, ideal for data visualization in web applications. It integrates seamlessly with Phoenix LiveView and provides powerful tools for generating dynamic visualizations. ## Supported Graph Types diff --git a/mix.lock b/mix.lock index a7a0d1f..436b972 100644 --- a/mix.lock +++ b/mix.lock @@ -2,7 +2,13 @@ "complex": {:hex, :complex, "0.5.0", "af2d2331ff6170b61bb738695e481b27a66780e18763e066ee2cd863d0b1dd92", [:mix], [], "hexpm", "2683bd3c184466cfb94fad74cbfddfaa94b860e27ad4ca1bffe3bff169d91ef1"}, "csv": {:hex, :csv, "3.2.1", "6d401f1ed33acb2627682a9ab6021e96d33ca6c1c6bccc243d8f7e2197d032f5", [:mix], [], "hexpm", "8f55a0524923ae49e97ff2642122a2ce7c61e159e7fe1184670b2ce847aee6c8"}, "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.42", "f23d856f41919f17cd06a493923a722d87a2d684f143a1e663c04a2b93100682", [:mix], [], "hexpm", "6915b6ca369b5f7346636a2f41c6a6d78b5af419d61a611079189233358b8b8b"}, "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, + "ex_doc": {:hex, :ex_doc, "0.36.1", "4197d034f93e0b89ec79fac56e226107824adcce8d2dd0a26f5ed3a95efc36b1", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d7d26a7cf965dacadcd48f9fa7b5953d7d0cfa3b44fa7a65514427da44eafd89"}, + "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, + "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "nx": {:hex, :nx, "0.7.3", "51ff45d9f9ff58b616f4221fa54ccddda98f30319bb8caaf86695234a469017a", [:mix], [{:complex, "~> 0.5", [hex: :complex, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5ff29af84f08db9bda66b8ef7ce92ab583ab4f983629fe00b479f1e5c7c705a6"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, } From 6047dfe15312950e6c43068cbb7883cbbebbb3ef Mon Sep 17 00:00:00 2001 From: Mohammed Sadique Date: Fri, 10 Jan 2025 16:35:42 +0530 Subject: [PATCH 2/3] doc correct --- lib/matplotex/blueprint.ex | 1 + lib/matplotex/blueprint/chord.ex | 1 + lib/matplotex/blueprint/frame.ex | 1 + lib/matplotex/element.ex | 1 + lib/matplotex/element/circle.ex | 1 + lib/matplotex/element/label.ex | 1 + lib/matplotex/element/legend.ex | 1 + lib/matplotex/element/line.ex | 1 + lib/matplotex/element/polygon.ex | 1 + lib/matplotex/element/rad_legend.ex | 1 + lib/matplotex/element/rect.ex | 1 + lib/matplotex/element/slice.ex | 1 + lib/matplotex/element/spline.ex | 1 + lib/matplotex/element/stencil.ex | 1 + lib/matplotex/element/tick.ex | 1 + lib/matplotex/figure.ex | 1 + lib/matplotex/figure/areal.ex | 1 + lib/matplotex/figure/areal/bar_chart.ex | 1 + lib/matplotex/figure/areal/histogram.ex | 1 + lib/matplotex/figure/areal/line_plot.ex | 1 + lib/matplotex/figure/areal/plot_options.ex | 1 + lib/matplotex/figure/areal/region.ex | 1 + lib/matplotex/figure/areal/scatter.ex | 1 + lib/matplotex/figure/areal/spline.ex | 1 + lib/matplotex/figure/areal/ticker.ex | 1 + .../figure/areal/xy_region/coords.ex | 1 + lib/matplotex/figure/cast.ex | 1 + lib/matplotex/figure/coords.ex | 1 + lib/matplotex/figure/dataset.ex | 1 + lib/matplotex/figure/dimension.ex | 1 + lib/matplotex/figure/font.ex | 1 + lib/matplotex/figure/lead.ex | 1 + lib/matplotex/figure/legend.ex | 1 + lib/matplotex/figure/marker.ex | 1 + lib/matplotex/figure/numer.ex | 1 + lib/matplotex/figure/radial.ex | 1 + lib/matplotex/figure/radial/accumulator.ex | 1 + lib/matplotex/figure/radial/dataset.ex | 1 + lib/matplotex/figure/radial/legend_acc.ex | 1 + lib/matplotex/figure/radial/pie.ex | 1 + lib/matplotex/figure/rc_params.ex | 1 + lib/matplotex/figure/sketch.ex | 1 + lib/matplotex/figure/text.ex | 1 + lib/matplotex/figure/two_d.ex | 1 + lib/matplotex/helpers.ex | 1 + lib/matplotex/utils/algebra.ex | 1 + lib/matplotex/utils/helpers.ex | 23 ++++++++++--------- lib/matplotex/utils/input_error.ex | 1 + lib/matplotex/utils/math_func.ex | 1 + lib/matplotex/utils/svg.ex | 5 ++-- lib/matplotex/validation/helpers.ex | 1 + 51 files changed, 63 insertions(+), 14 deletions(-) diff --git a/lib/matplotex/blueprint.ex b/lib/matplotex/blueprint.ex index 4119194..09980ce 100644 --- a/lib/matplotex/blueprint.ex +++ b/lib/matplotex/blueprint.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Blueprint do +@moduledoc false @callback new(graph :: module(), params :: map()) :: any() @callback set_content(graphset :: any()) :: any() @callback add_elements(graphset :: any()) :: any() diff --git a/lib/matplotex/blueprint/chord.ex b/lib/matplotex/blueprint/chord.ex index 41940bd..f8327af 100644 --- a/lib/matplotex/blueprint/chord.ex +++ b/lib/matplotex/blueprint/chord.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Blueprint.Chord do +@moduledoc false @true_by_default false @false_by_default true defmacro chord(opts \\ []) do diff --git a/lib/matplotex/blueprint/frame.ex b/lib/matplotex/blueprint/frame.ex index 5b7e356..4e45f60 100644 --- a/lib/matplotex/blueprint/frame.ex +++ b/lib/matplotex/blueprint/frame.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Blueprint.Frame do +@moduledoc false alias Matplotex.Figure.Legend @default_margin 0.05 @show_by_default true diff --git a/lib/matplotex/element.ex b/lib/matplotex/element.ex index cdc4d83..ebcf5cf 100644 --- a/lib/matplotex/element.ex +++ b/lib/matplotex/element.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element do +@moduledoc false @callback assemble(element :: struct()) :: String.t() def assemble(%module{} = element), do: module.assemble(element) diff --git a/lib/matplotex/element/circle.ex b/lib/matplotex/element/circle.ex index 79601c7..b9376b5 100644 --- a/lib/matplotex/element/circle.ex +++ b/lib/matplotex/element/circle.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Circle do +@moduledoc false alias Matplotex.Element use Element diff --git a/lib/matplotex/element/label.ex b/lib/matplotex/element/label.ex index bc29554..0f664da 100644 --- a/lib/matplotex/element/label.ex +++ b/lib/matplotex/element/label.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Label do +@moduledoc false alias Matplotex.Element use Element @default_fill "black" diff --git a/lib/matplotex/element/legend.ex b/lib/matplotex/element/legend.ex index 340e44c..2124be8 100644 --- a/lib/matplotex/element/legend.ex +++ b/lib/matplotex/element/legend.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Legend do +@moduledoc false alias Matplotex.Element.Label alias Matplotex.Element diff --git a/lib/matplotex/element/line.ex b/lib/matplotex/element/line.ex index 4f6d914..fce6a6c 100644 --- a/lib/matplotex/element/line.ex +++ b/lib/matplotex/element/line.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Line do +@moduledoc false alias Matplotex.Element use Element diff --git a/lib/matplotex/element/polygon.ex b/lib/matplotex/element/polygon.ex index 2d81010..b7ca54e 100644 --- a/lib/matplotex/element/polygon.ex +++ b/lib/matplotex/element/polygon.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Polygon do +@moduledoc false alias Matplotex.Element use Element @default_fill "blue" diff --git a/lib/matplotex/element/rad_legend.ex b/lib/matplotex/element/rad_legend.ex index 7ff0294..5a36415 100644 --- a/lib/matplotex/element/rad_legend.ex +++ b/lib/matplotex/element/rad_legend.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.RadLegend do +@moduledoc false alias Matplotex.Element.Label alias Matplotex.Element alias Matplotex.Element.Rect diff --git a/lib/matplotex/element/rect.ex b/lib/matplotex/element/rect.ex index 71591c2..689ccc9 100644 --- a/lib/matplotex/element/rect.ex +++ b/lib/matplotex/element/rect.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Rect do +@moduledoc false alias Matplotex.Element @default_stroke_width 2 diff --git a/lib/matplotex/element/slice.ex b/lib/matplotex/element/slice.ex index 7c1a436..bee7dcd 100644 --- a/lib/matplotex/element/slice.ex +++ b/lib/matplotex/element/slice.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Slice do +@moduledoc false alias Matplotex.Element use Element diff --git a/lib/matplotex/element/spline.ex b/lib/matplotex/element/spline.ex index a3f60c6..630af28 100644 --- a/lib/matplotex/element/spline.ex +++ b/lib/matplotex/element/spline.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Spline do +@moduledoc false alias Matplotex.Element use Element @default_stroke_width 2 diff --git a/lib/matplotex/element/stencil.ex b/lib/matplotex/element/stencil.ex index 03c2590..0d69508 100644 --- a/lib/matplotex/element/stencil.ex +++ b/lib/matplotex/element/stencil.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Element.Stencil do +@moduledoc false def line(line) do ~s( 10 do factor = value |> :math.log10() |> floor() diff --git a/lib/matplotex/figure/radial.ex b/lib/matplotex/figure/radial.ex index 8fbc267..f8724c7 100644 --- a/lib/matplotex/figure/radial.ex +++ b/lib/matplotex/figure/radial.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Radial do +@moduledoc false alias Matplotex.Utils.Algebra @callback create(struct(), list(), keyword()) :: struct() diff --git a/lib/matplotex/figure/radial/accumulator.ex b/lib/matplotex/figure/radial/accumulator.ex index 963a978..a594973 100644 --- a/lib/matplotex/figure/radial/accumulator.ex +++ b/lib/matplotex/figure/radial/accumulator.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Radial.Accumulator do +@moduledoc false alias Matplotex.Figure.Radial.LegendAcc @start_angle :math.pi() / 2 diff --git a/lib/matplotex/figure/radial/dataset.ex b/lib/matplotex/figure/radial/dataset.ex index 84088fb..a0ebd43 100644 --- a/lib/matplotex/figure/radial/dataset.ex +++ b/lib/matplotex/figure/radial/dataset.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Radial.Dataset do +@moduledoc false defstruct sizes: [], labels: [], colors: [], diff --git a/lib/matplotex/figure/radial/legend_acc.ex b/lib/matplotex/figure/radial/legend_acc.ex index 86bc875..bce62eb 100644 --- a/lib/matplotex/figure/radial/legend_acc.ex +++ b/lib/matplotex/figure/radial/legend_acc.ex @@ -1,3 +1,4 @@ defmodule Matplotex.Figure.Radial.LegendAcc do +@moduledoc false defstruct [:x, :y, :uheight, :uwidth] end diff --git a/lib/matplotex/figure/radial/pie.ex b/lib/matplotex/figure/radial/pie.ex index a9d6769..60b36b1 100644 --- a/lib/matplotex/figure/radial/pie.ex +++ b/lib/matplotex/figure/radial/pie.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Radial.Pie do +@moduledoc false alias Matplotex.Figure.RcParams alias Matplotex.Utils.Algebra alias Matplotex.Figure.Areal.Region diff --git a/lib/matplotex/figure/rc_params.ex b/lib/matplotex/figure/rc_params.ex index 96ef24f..328e424 100644 --- a/lib/matplotex/figure/rc_params.ex +++ b/lib/matplotex/figure/rc_params.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.RcParams do +@moduledoc false alias Matplotex.Figure.Font @default_figsize {8, 6} @default_dpi 96 diff --git a/lib/matplotex/figure/sketch.ex b/lib/matplotex/figure/sketch.ex index 9f6d71b..87d2a8f 100644 --- a/lib/matplotex/figure/sketch.ex +++ b/lib/matplotex/figure/sketch.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Sketch do +@moduledoc false alias Matplotex.Figure @dpi 96 diff --git a/lib/matplotex/figure/text.ex b/lib/matplotex/figure/text.ex index 7b915a0..85eea7a 100644 --- a/lib/matplotex/figure/text.ex +++ b/lib/matplotex/figure/text.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.Text do +@moduledoc false alias Matplotex.Figure.Text alias Matplotex.Figure.Font diff --git a/lib/matplotex/figure/two_d.ex b/lib/matplotex/figure/two_d.ex index 6021936..1c3cf37 100644 --- a/lib/matplotex/figure/two_d.ex +++ b/lib/matplotex/figure/two_d.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Figure.TwoD do +@moduledoc false defstruct [:x, :y] def update(%__MODULE__{x: x, y: y} = twod, opts, context) do diff --git a/lib/matplotex/helpers.ex b/lib/matplotex/helpers.ex index 08ef9ea..cd52ba8 100644 --- a/lib/matplotex/helpers.ex +++ b/lib/matplotex/helpers.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Helpers do +@moduledoc false def copy(term) do text = if is_binary(term) do diff --git a/lib/matplotex/utils/algebra.ex b/lib/matplotex/utils/algebra.ex index 46268b6..56caa53 100644 --- a/lib/matplotex/utils/algebra.ex +++ b/lib/matplotex/utils/algebra.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Utils.Algebra do +@moduledoc false alias Nx @tensor_data_type_bits 64 diff --git a/lib/matplotex/utils/helpers.ex b/lib/matplotex/utils/helpers.ex index 92828b5..d57a033 100644 --- a/lib/matplotex/utils/helpers.ex +++ b/lib/matplotex/utils/helpers.ex @@ -1,16 +1,17 @@ defmodule Matplotex.Utils.Helpers do - @moduledoc """ - Module contains some misslenious helper functions - """ +@moduledoc false + # @moduledoc """ + # Module contains some misslenious helper functions + # """ - @doc """ - Input params may contains params for that chart struct and params for - content struct this functions sgregates that and return a tuple with - params for chart struct and content struct. - ### Params - * params - Map contains input params - * content_fields - list of atoms contains field names - """ + # @doc """ + # Input params may contains params for that chart struct and params for + # content struct this functions sgregates that and return a tuple with + # params for chart struct and content struct. + # ### Params + # * params - Map contains input params + # * content_fields - list of atoms contains field names + # """ @spec segregate_content(any(), list()) :: {any(), any()} def segregate_content(params, content_fields) do diff --git a/lib/matplotex/utils/input_error.ex b/lib/matplotex/utils/input_error.ex index c5b2067..7105505 100644 --- a/lib/matplotex/utils/input_error.ex +++ b/lib/matplotex/utils/input_error.ex @@ -1,3 +1,4 @@ defmodule Matplotex.InputError do +@moduledoc false defexception [:keys, :message] end diff --git a/lib/matplotex/utils/math_func.ex b/lib/matplotex/utils/math_func.ex index 7e7cdc1..09a23f1 100644 --- a/lib/matplotex/utils/math_func.ex +++ b/lib/matplotex/utils/math_func.ex @@ -1,4 +1,5 @@ defmodule Matplotex.Utilities.MathFunc do +@moduledoc false alias NX @tensor_double_data_type_bits 64 def euclidean_distance(x1, y1, x2, y2) do diff --git a/lib/matplotex/utils/svg.ex b/lib/matplotex/utils/svg.ex index 00afea0..c02610e 100644 --- a/lib/matplotex/utils/svg.ex +++ b/lib/matplotex/utils/svg.ex @@ -1,7 +1,6 @@ defmodule Matplotex.Utils.Svg do - @moduledoc """ - Modules to wrap function shares common svg functions - """ +@moduledoc false + def wrap_with_frame(%{width: width, height: height}, svg) do ~s( Date: Fri, 10 Jan 2025 16:43:24 +0530 Subject: [PATCH 3/3] dep --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e2f884..18ae6ff 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The package can be installed by adding **Matplotex** 0.2.0" } ] ```