changed
hex_metadata.config
|
@@ -1,6 +1,6 @@
|
1
1
|
{<<"links">>,[{<<"GitHub">>,<<"https://git.5sigma.io/sigmakit/sigmakit">>}]}.
|
2
2
|
{<<"name">>,<<"sigma_kit">>}.
|
3
|
- {<<"version">>,<<"0.0.7">>}.
|
3
|
+ {<<"version">>,<<"0.0.8">>}.
|
4
4
|
{<<"description">>,
|
5
5
|
<<"An Appplication kit for Phoenix based applications.\n\n SigmaKit Provides UI components, helpers, and opinionated frameowrk extensions for quickly devloping rich Phoenix LiveView based applications.">>}.
|
6
6
|
{<<"elixir">>,<<"~> 1.17.2">>}.
|
|
@@ -12,8 +12,8 @@
|
12
12
|
<<"lib/components/formatters.ex">>,<<"lib/components/forms.ex">>,
|
13
13
|
<<"lib/components/icons.ex">>,<<"lib/components/modal.ex">>,
|
14
14
|
<<"lib/components/headers.ex">>,<<"lib/components/buttons.ex">>,
|
15
|
- <<"lib/components/containers.ex">>,<<"lib/components/charts.ex">>,
|
16
15
|
<<"lib/components/table.ex">>,<<"lib/components/tabs.ex">>,
|
16
|
+ <<"lib/components/charts.ex">>,<<"lib/components/containers.ex">>,
|
17
17
|
<<"lib/extensions">>,<<"lib/extensions/context.ex">>,
|
18
18
|
<<"lib/extensions/repo.ex">>,<<"lib/extensions/schema.ex">>,<<"lib/util">>,
|
19
19
|
<<"lib/util/changeset.ex">>,<<"lib/util/string.ex">>,<<"lib/util/map.ex">>,
|
changed
lib/components/charts.ex
|
@@ -22,7 +22,7 @@ defmodule SigmaKit.Components.Charts do
|
22
22
|
data-y-label-format={@y_label_format}
|
23
23
|
data-event={@chart_id}
|
24
24
|
>
|
25
|
- <canvas style="height: #{@canvas_height} !important; width: #{@canvas_width} !important;">
|
25
|
+ <canvas style={"height: #{@canvas_height} !important; width: #{@canvas_width} !important;"}>
|
26
26
|
</canvas>
|
27
27
|
</div>
|
28
28
|
"""
|
|
@@ -30,31 +30,51 @@ defmodule SigmaKit.Components.Charts do
|
30
30
|
|
31
31
|
attr :chart_id, :string, required: true
|
32
32
|
attr :class, :any, default: ""
|
33
|
+ attr :canvas_width, :string, default: "100%"
|
34
|
+ attr :canvas_height, :string, default: "100%"
|
33
35
|
attr :rest, :global
|
34
36
|
|
35
37
|
def bar_chart(assigns) do
|
36
38
|
~H"""
|
37
|
- <.chart chart_id={@chart_id} class={@class} options={build_options("bar", @rest)} />
|
39
|
+ <.chart
|
40
|
+ canvas_width={@canvas_width}
|
41
|
+ canvas_height={@canvas_height}
|
42
|
+ chart_id={@chart_id}
|
43
|
+ class={@class}
|
44
|
+ options={build_options("bar", @rest)}
|
45
|
+ />
|
38
46
|
"""
|
39
47
|
end
|
40
48
|
|
41
49
|
attr :chart_id, :string, required: true
|
42
50
|
attr :class, :any, default: ""
|
43
51
|
attr :rest, :global
|
52
|
+ attr :canvas_width, :string, default: "100%"
|
53
|
+ attr :canvas_height, :string, default: "100%"
|
44
54
|
|
45
55
|
def line_chart(assigns) do
|
46
56
|
~H"""
|
47
|
- <.chart chart_id={@chart_id} class={@class} options={build_options("line", @rest)} />
|
57
|
+ <.chart
|
58
|
+ canvas_width={@canvas_width}
|
59
|
+ canvas_height={@canvas_height}
|
60
|
+ chart_id={@chart_id}
|
61
|
+ class={@class}
|
62
|
+ options={build_options("line", @rest)}
|
63
|
+ />
|
48
64
|
"""
|
49
65
|
end
|
50
66
|
|
51
67
|
attr :chart_id, :string, required: true
|
52
68
|
attr :class, :any, default: ""
|
69
|
+ attr :canvas_width, :string, default: "100%"
|
70
|
+ attr :canvas_height, :string, default: "100%"
|
53
71
|
attr :rest, :global
|
54
72
|
|
55
73
|
def pie_chart(assigns) do
|
56
74
|
~H"""
|
57
75
|
<.chart
|
76
|
+ canvas_width={@canvas_width}
|
77
|
+ canvas_height={@canvas_height}
|
58
78
|
chart_id={@chart_id}
|
59
79
|
class={@class}
|
60
80
|
options={build_options("pie", @rest, grid: false, legend: true)}
|
|
@@ -64,21 +84,37 @@ defmodule SigmaKit.Components.Charts do
|
64
84
|
|
65
85
|
attr :chart_id, :string, required: true
|
66
86
|
attr :class, :any, default: ""
|
87
|
+ attr :canvas_width, :string, default: "100%"
|
88
|
+ attr :canvas_height, :string, default: "100%"
|
67
89
|
attr :rest, :global
|
68
90
|
|
69
91
|
def scatter_chart(assigns) do
|
70
92
|
~H"""
|
71
|
- <.chart chart_id={@chart_id} class={@class} options={build_options("scatter", @rest)} />
|
93
|
+ <.chart
|
94
|
+ canvas_width={@canvas_width}
|
95
|
+ canvas_height={@canvas_height}
|
96
|
+ chart_id={@chart_id}
|
97
|
+ class={@class}
|
98
|
+ options={build_options("scatter", @rest)}
|
99
|
+ />
|
72
100
|
"""
|
73
101
|
end
|
74
102
|
|
75
103
|
attr :chart_id, :string, required: true
|
76
104
|
attr :class, :any, default: ""
|
105
|
+ attr :canvas_width, :string, default: "100%"
|
106
|
+ attr :canvas_height, :string, default: "100%"
|
77
107
|
attr :rest, :global
|
78
108
|
|
79
109
|
def bubble_chart(assigns) do
|
80
110
|
~H"""
|
81
|
- <.chart chart_id={@chart_id} class={@class} options={build_options("bubble", @rest)} />
|
111
|
+ <.chart
|
112
|
+ canvas_width={@canvas_width}
|
113
|
+ canvas_height={@canvas_height}
|
114
|
+ chart_id={@chart_id}
|
115
|
+ class={@class}
|
116
|
+ options={build_options("bubble", @rest)}
|
117
|
+ />
|
82
118
|
"""
|
83
119
|
end
|
84
120
|
|
|
@@ -90,10 +126,11 @@ defmodule SigmaKit.Components.Charts do
|
90
126
|
%{
|
91
127
|
type: type,
|
92
128
|
options: %{
|
129
|
+ animation: false,
|
93
130
|
maintainAspectRatio: false,
|
94
131
|
responsive: true,
|
95
132
|
tension: 0.4,
|
96
|
- pointRadius: 5,
|
133
|
+ pointRadius: 1,
|
97
134
|
scales: %{
|
98
135
|
y: %{
|
99
136
|
border: %{
|
|
@@ -109,6 +146,7 @@ defmodule SigmaKit.Components.Charts do
|
109
146
|
}
|
110
147
|
},
|
111
148
|
x: %{
|
149
|
+ type: "timeseries",
|
112
150
|
border: %{
|
113
151
|
display: false
|
114
152
|
},
|
changed
lib/components/containers.ex
|
@@ -17,7 +17,7 @@ defmodule SigmaKit.Components.Containers do
|
17
17
|
!@shadow && "border-zinc-200",
|
18
18
|
@class
|
19
19
|
]}>
|
20
|
- <div :if={!Enum.empty?(@action_bar) || @title} class="flex 4 justify-between my-2 h-8 px-4 mt-4">
|
20
|
+ <div :if={!Enum.empty?(@action_bar) || @title} class="flex justify-between my-2 h-8 px-4 mt-4">
|
21
21
|
<div class="font-medium text-lg">
|
22
22
|
{@title}
|
23
23
|
</div>
|
changed
mix.exs
|
@@ -4,7 +4,7 @@ defmodule SigmaKit.MixProject do
|
4
4
|
def project do
|
5
5
|
[
|
6
6
|
app: :sigma_kit,
|
7
|
- version: "0.0.7",
|
7
|
+ version: "0.0.8",
|
8
8
|
build_path: "../../_build",
|
9
9
|
config_path: "../../config/config.exs",
|
10
10
|
deps_path: "../../deps",
|