apexcharts 0.1.11 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +64 -21
  3. data/lib/apex_charts/charts/box_plot_chart.rb +1 -0
  4. data/lib/apex_charts/configuration.rb +0 -2
  5. data/lib/apex_charts/options_builder.rb +128 -125
  6. data/lib/apex_charts/renderer.rb +10 -5
  7. data/lib/apex_charts/series/bubble_series.rb +2 -3
  8. data/lib/apex_charts/series/cartesian_series.rb +8 -2
  9. data/lib/apex_charts/version.rb +2 -2
  10. data/vendor/assets/javascripts/apexcharts.js +5 -5
  11. metadata +3 -79
  12. data/lib/apex_charts/config/schema.rb +0 -20
  13. data/lib/apex_charts/options/default/annotations_options.rb +0 -14
  14. data/lib/apex_charts/options/default/chart_options.rb +0 -33
  15. data/lib/apex_charts/options/default/data_labels_options.rb +0 -18
  16. data/lib/apex_charts/options/default/fill_options.rb +0 -14
  17. data/lib/apex_charts/options/default/grid_options.rb +0 -17
  18. data/lib/apex_charts/options/default/helper_options.rb +0 -22
  19. data/lib/apex_charts/options/default/legend_options.rb +0 -33
  20. data/lib/apex_charts/options/default/markers_options.rb +0 -26
  21. data/lib/apex_charts/options/default/no_data_options.rb +0 -14
  22. data/lib/apex_charts/options/default/plot_options.rb +0 -19
  23. data/lib/apex_charts/options/default/root_options.rb +0 -38
  24. data/lib/apex_charts/options/default/states_options.rb +0 -11
  25. data/lib/apex_charts/options/default/stroke_options.rb +0 -14
  26. data/lib/apex_charts/options/default/theme_options.rb +0 -11
  27. data/lib/apex_charts/options/default/title_subtitle_options.rb +0 -15
  28. data/lib/apex_charts/options/default/tooltip_options.rb +0 -25
  29. data/lib/apex_charts/options/default/x_axis_options.rb +0 -27
  30. data/lib/apex_charts/options/default/y_axis_options.rb +0 -28
  31. data/lib/apex_charts/options/dry_schema/annotations_options/annotation_label.rb +0 -24
  32. data/lib/apex_charts/options/dry_schema/annotations_options/image_annotations.rb +0 -15
  33. data/lib/apex_charts/options/dry_schema/annotations_options/point_annotations.rb +0 -33
  34. data/lib/apex_charts/options/dry_schema/annotations_options/text_annotations.rb +0 -26
  35. data/lib/apex_charts/options/dry_schema/annotations_options/x_axis_annotations.rb +0 -20
  36. data/lib/apex_charts/options/dry_schema/annotations_options/y_axis_annotations.rb +0 -21
  37. data/lib/apex_charts/options/dry_schema/annotations_options.rb +0 -22
  38. data/lib/apex_charts/options/dry_schema/chart_options.rb +0 -35
  39. data/lib/apex_charts/options/dry_schema/data_labels_options.rb +0 -37
  40. data/lib/apex_charts/options/dry_schema/fill_options.rb +0 -34
  41. data/lib/apex_charts/options/dry_schema/general_schema/drop_shadow.rb +0 -14
  42. data/lib/apex_charts/options/dry_schema/general_schema/function.rb +0 -12
  43. data/lib/apex_charts/options/dry_schema/grid_options.rb +0 -19
  44. data/lib/apex_charts/options/dry_schema/helper_options.rb +0 -22
  45. data/lib/apex_charts/options/dry_schema/legend_options.rb +0 -61
  46. data/lib/apex_charts/options/dry_schema/markers_options/discrete_point.rb +0 -13
  47. data/lib/apex_charts/options/dry_schema/markers_options.rb +0 -34
  48. data/lib/apex_charts/options/dry_schema/no_data_options.rb +0 -16
  49. data/lib/apex_charts/options/dry_schema/plot_options.rb +0 -231
  50. data/lib/apex_charts/options/dry_schema/root_options.rb +0 -42
  51. data/lib/apex_charts/options/dry_schema/schema.rb +0 -32
  52. data/lib/apex_charts/options/dry_schema/states_options/filter.rb +0 -10
  53. data/lib/apex_charts/options/dry_schema/states_options.rb +0 -22
  54. data/lib/apex_charts/options/dry_schema/stroke_options.rb +0 -21
  55. data/lib/apex_charts/options/dry_schema/theme_options.rb +0 -18
  56. data/lib/apex_charts/options/dry_schema/title_subtitle_options.rb +0 -22
  57. data/lib/apex_charts/options/dry_schema/tooltip_options.rb +0 -27
  58. data/lib/apex_charts/options/dry_schema/x_axis_options.rb +0 -30
  59. data/lib/apex_charts/options/dry_schema/y_axis_options.rb +0 -30
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'annotations_options/image_annotations'
4
- require_relative 'annotations_options/point_annotations'
5
- require_relative 'annotations_options/text_annotations'
6
- require_relative 'annotations_options/x_axis_annotations'
7
- require_relative 'annotations_options/y_axis_annotations'
8
-
9
- module ApexCharts::Options
10
- module DrySchema
11
- class AnnotationsOptions < Schema
12
- define do
13
- optional(:images).array(ImageAnnotations)
14
- optional(:points).array(PointAnnotations)
15
- optional(:position).filled(:string)
16
- optional(:texts).array(TextAnnotations)
17
- optional(:xaxis).array(XAxisAnnotations)
18
- optional(:yaxis).array(YAxisAnnotations)
19
- end
20
- end
21
- end
22
- end
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- class ChartOptions < Schema
6
- define do
7
- optional(:animations)
8
- optional(:background)
9
- optional(:brush)
10
- optional(:defaultLocale)
11
- optional(:dropShadow)
12
- optional(:events)
13
- optional(:fontFamily)
14
- optional(:foreColor)
15
- optional(:group)
16
- optional(:height)
17
- optional(:id)
18
- optional(:locales)
19
- optional(:offsetX)
20
- optional(:offsetY)
21
- optional(:parentHeightOffset)
22
- optional(:redrawOnParentResize)
23
- optional(:redrawOnWindowResize)
24
- optional(:selection)
25
- optional(:sparkline)
26
- optional(:stackType)
27
- optional(:stacked)
28
- optional(:toolbar)
29
- optional(:type)
30
- optional(:width)
31
- optional(:zoom)
32
- end
33
- end
34
- end
35
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'general_schema/function'
4
- require_relative 'general_schema/drop_shadow'
5
-
6
- module ApexCharts::Options
7
- module DrySchema
8
- class DataLabelsOptions < Schema
9
- define do
10
- optional(:background).hash do
11
- optional(:borderColor) { str? }
12
- optional(:borderRadius) { int? | float? }
13
- optional(:borderWidth) { int? | float? }
14
- optional(:dropShadow).hash(DropShadow)
15
- optional(:enabled) { bool? }
16
- optional(:foreColor) { str? }
17
- optional(:opacity) { int? | float? }
18
- optional(:padding) { int? | float? }
19
- end
20
- optional(:distributed) { bool? }
21
- optional(:dropShadow).hash(DropShadow)
22
- optional(:enabled) { bool? }
23
- optional(:enabledOnSeries) { !nil? > (int? | float?) }
24
- optional(:formatter).hash(Function)
25
- optional(:offsetX) { int? | float? }
26
- optional(:offsetY) { int? | float? }
27
- optional(:style).hash do
28
- optional(:colors) { array? & each { str? } }
29
- optional(:fontFamily) { str? }
30
- optional(:fontSize) { str? }
31
- optional(:fontWeight) { str? | int? | float? }
32
- end
33
- optional(:textAnchor) { included_in? %w[start middle end] }
34
- end
35
- end
36
- end
37
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- class FillOptions < Schema
6
- define do
7
- optional(:colors) { array? }
8
- optional(:gradient).hash do
9
- optional(:gradientToColors) { array? & each { str? } }
10
- optional(:inverseColors) { bool? }
11
- optional(:opacityFrom) { int? | float? }
12
- optional(:opacityTo) { int? | float? }
13
- optional(:shade) { str? }
14
- optional(:shadeIntensity) { int? | float? }
15
- optional(:stops) { array? & each { int? | float? } }
16
- optional(:type) { str? }
17
- end
18
- optional(:image).hash do
19
- optional(:src) { str? | (array? & each { str? }) }
20
- optional(:width) { int? | float? }
21
- optional(:height) { int? | float? }
22
- end
23
- optional(:opacity) { int? | float? | (array? & each { str? }) }
24
- optional(:pattern).hash do
25
- optional(:height) { int? | float? }
26
- optional(:strokeWidth) { int? | float? }
27
- optional(:style) { str? | (array? & each { str? }) }
28
- optional(:width) { int? | float? }
29
- end
30
- optional(:type) { str? | (array? & each { str? }) }
31
- end
32
- end
33
- end
34
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- DropShadow = ::Dry::Schema.Params do
6
- optional(:blur) { int? | float? }
7
- optional(:color) { str? }
8
- optional(:enabled) { bool? }
9
- optional(:left) { int? | float? }
10
- optional(:opacity) { int? | float? }
11
- optional(:top) { int? | float? }
12
- end
13
- end
14
- end
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- Function = ::Dry::Schema.Params do
6
- optional(:function).hash do
7
- optional(:args) { str? }
8
- optional(:body) { str? }
9
- end
10
- end
11
- end
12
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- class GridOptions < Schema
6
- define do
7
- optional(:borderColor)
8
- optional(:column)
9
- optional(:padding)
10
- optional(:position)
11
- optional(:row)
12
- optional(:show)
13
- optional(:strokeDashArray)
14
- optional(:xaxis)
15
- optional(:yaxis)
16
- end
17
- end
18
- end
19
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- class HelperOptions < Schema
6
- define do
7
- optional(:brushTarget)
8
- optional(:class)
9
- optional(:chartId)
10
- optional(:defer)
11
- optional(:group)
12
- optional(:id)
13
- optional(:style)
14
- optional(:var)
15
- optional(:xtitle)
16
- optional(:xtype)
17
- optional(:ytitle)
18
- optional(:ytype)
19
- end
20
- end
21
- end
22
- end
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'general_schema/function'
4
-
5
- module ApexCharts::Options
6
- module DrySchema
7
- class LegendOptions < Schema
8
- define do
9
- optional(:containerMargin).hash do
10
- optional(:left) { int? | float? }
11
- optional(:top) { int? | float? }
12
- end
13
- optional(:customLegendItems) { array? & each { str? } }
14
- optional(:floating) { bool? }
15
- optional(:fontFamily) { str? }
16
- optional(:fontSize) { str? }
17
- optional(:fontWeight) { str? | int? | float? }
18
- optional(:formatter).hash(Function)
19
- optional(:height) { int? | float? }
20
- optional(:horizontalAlign) { included_in?(%w[left center right]) }
21
- optional(:inverseOrder) { bool? }
22
- optional(:itemMargin).hash do
23
- optional(:horizontal) { int? | float? }
24
- optional(:vertical) { int? | float? }
25
- end
26
- optional(:labels).hash do
27
- optional(:colors) { str? | (array? & each { str? }) }
28
- optional(:useSeriesColors) { bool? }
29
- end
30
- optional(:markers).hash do
31
- optional(:customHTML).hash(Function)
32
- optional(:fillColors) { array? & each { str? } }
33
- optional(:height) { int? | float? }
34
- optional(:offsetX) { int? | float? }
35
- optional(:offsetY) { int? | float? }
36
- optional(:onClick).hash(Function)
37
- optional(:radius) { int? | float? }
38
- optional(:strokeColor) { str? }
39
- optional(:strokeWidth) { int? | float? }
40
- optional(:width) { int? | float? }
41
- end
42
- optional(:offsetX) { int? | float? }
43
- optional(:offsetY) { int? | float? }
44
- optional(:onItemClick).hash do
45
- optional(:toggleDataSeries) { bool? }
46
- end
47
- optional(:onItemHover).hash do
48
- optional(:highlightDataSeries) { bool? }
49
- end
50
- optional(:position) { included_in?(%w[top right bottom left]) }
51
- optional(:show) { bool? }
52
- optional(:showForNullSeries) { bool? }
53
- optional(:showForSingleSeries) { bool? }
54
- optional(:showForZeroSeries) { bool? }
55
- optional(:textAnchor) { str? }
56
- optional(:tooltipHoverFormatter).hash(Function)
57
- optional(:width) { int? | float? }
58
- end
59
- end
60
- end
61
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- DiscretePoint = ::Dry::Schema.Params do
6
- optional(:dataPointIndex) { int? | float? }
7
- optional(:fillColor) { str? }
8
- optional(:seriesIndex) { int? | float? }
9
- optional(:size) { int? | float? }
10
- optional(:strokeColor) { str? }
11
- end
12
- end
13
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'general_schema/function'
4
- require_relative 'markers_options/discrete_point'
5
-
6
- module ApexCharts::Options
7
- module DrySchema
8
- class MarkersOptions < Schema
9
- define do
10
- optional(:colors) { array? & each { str? } }
11
- optional(:discrete).array(DiscretePoint)
12
- optional(:fillOpacity) { int? | float? | (array? & each { int? | float? }) }
13
- optional(:height) { int? | float? }
14
- optional(:hover).hash do
15
- optional(:size) { int? | float? }
16
- optional(:sizeOffset) { int? | float? }
17
- end
18
- optional(:offsetX) { int? | float? }
19
- optional(:offsetY) { int? | float? }
20
- optional(:onClick).hash(Function)
21
- optional(:onDblClick).hash(Function)
22
- optional(:radius) { int? | float? }
23
- optional(:shape) { included_in?(%w[circle square]) | (array? & each { str? }) }
24
- optional(:showNullDataPoints) { bool? }
25
- optional(:size) { int? | float? | (array? & each { int? | float? }) }
26
- optional(:strokeColor) { str? | (array? & each { str? }) }
27
- optional(:strokeDashArray) { int? | float? | (array? & each { int? | float? }) }
28
- optional(:strokeOpacity) { int? | float? | (array? & each { int? | float? }) }
29
- optional(:strokeWidth) { int? | float? | (array? & each { int? | float? }) }
30
- optional(:width) { int? | float? }
31
- end
32
- end
33
- end
34
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- class NoDataOptions < Schema
6
- define do
7
- optional(:align)
8
- optional(:offsetX)
9
- optional(:offsetY)
10
- optional(:style)
11
- optional(:text)
12
- optional(:verticalAlign)
13
- end
14
- end
15
- end
16
- end
@@ -1,231 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'general_schema/function'
4
- require_relative 'general_schema/drop_shadow'
5
-
6
- module ApexCharts::Options
7
- module DrySchema
8
- class PlotOptions < Schema
9
- define do
10
- optional(:area).hash do
11
- optional(:fillTo) { included_in? %w[origin end] }
12
- end
13
- optional(:bar).hash do
14
- optional(:barHeight) { str? }
15
- optional(:borderRadius) { int? | float? }
16
- optional(:colors).hash do
17
- optional(:backgroundBarColors) { array? & each { str? } }
18
- optional(:backgroundBarOpacity) { int? | float? }
19
- optional(:backgroundBarRadius) { int? | float? }
20
- optional(:ranges).array(:hash) do
21
- optional(:color) { str? }
22
- optional(:from) { int? | float? }
23
- optional(:to) { int? | float? }
24
- end
25
- end
26
- optional(:columnWidth) { str? }
27
- optional(:dataLabels).hash do
28
- optional(:hideOverflowingLabels) { bool? }
29
- optional(:maxItems) { int? | float? }
30
- optional(:orientation) { included_in? %w[horizontal vertical] }
31
- optional(:position) { str? }
32
- end
33
- optional(:distributed) { bool? }
34
- optional(:endingShape) { included_in? %w[flat rounded] }
35
- optional(:horizontal) { bool? }
36
- optional(:rangeBarOverlap) { bool? }
37
- optional(:rangeBarGroupRows) { bool? }
38
- optional(:startingShape) { included_in? %w[flat rounded] }
39
- end
40
- optional(:boxPlot).hash do
41
- optional(:colors).hash do
42
- optional(:upper) { str? }
43
- optional(:lower) { str? }
44
- end
45
- end
46
- optional(:bubble).hash do
47
- optional(:maxBubbleRadius) { int? | float? }
48
- optional(:minBubbleRadius) { int? | float? }
49
- end
50
- optional(:candlestick).hash do
51
- optional(:colors).hash do
52
- optional(:upward) { str? }
53
- optional(:downward) { str? }
54
- end
55
- optional(:wick).hash do
56
- optional(:useFillColor) { bool? }
57
- end
58
- end
59
- optional(:heatmap).hash do
60
- optional(:colorScale).hash do
61
- optional(:inverse) { bool? }
62
- optional(:max) { int? | float? }
63
- optional(:min) { int? | float? }
64
- optional(:ranges).array(:hash) do
65
- optional(:color) { str? }
66
- optional(:foreColor) { str? }
67
- optional(:from) { int? | float? }
68
- optional(:name) { str? }
69
- optional(:to) { int? | float? }
70
- end
71
- end
72
- optional(:distributed) { bool? }
73
- optional(:enableShades) { bool? }
74
- optional(:radius) { int? | float? }
75
- optional(:reverseNegativeShade) { bool? }
76
- optional(:shadeIntensity) { int? | float? }
77
- optional(:useFillColorAsStroke) { bool? }
78
- end
79
- optional(:pie).hash do
80
- optional(:customScale) { int? | float? }
81
- optional(:dataLabels).hash do
82
- optional(:minAngleToShowLabel) { int? | float? }
83
- optional(:offset) { int? | float? }
84
- end
85
- optional(:donut).hash do
86
- optional(:background) { str? }
87
- optional(:labels).hash do
88
- optional(:name).hash do
89
- optional(:color) { str? }
90
- optional(:fontFamily) { str? }
91
- optional(:fontSize) { str? }
92
- optional(:fontWeight) { str? | int? | float? }
93
- optional(:formatter).hash(Function)
94
- optional(:offsetY) { int? | float? }
95
- optional(:show) { bool? }
96
- end
97
- optional(:show) { bool? }
98
- optional(:total).hash do
99
- optional(:color) { str? }
100
- optional(:fontFamily) { str? }
101
- optional(:fontSize) { str? }
102
- optional(:fontWeight) { str? | int? | float? }
103
- optional(:formatter).hash(Function)
104
- optional(:label) { str? }
105
- optional(:offsetY) { int? | float? }
106
- optional(:show) { bool? }
107
- optional(:showAlways) { bool? }
108
- end
109
- optional(:value).hash do
110
- optional(:color) { str? }
111
- optional(:fontFamily) { str? }
112
- optional(:fontSize) { str? }
113
- optional(:fontWeight) { str? | int? | float? }
114
- optional(:formatter).hash(Function)
115
- optional(:offsetY) { int? | float? }
116
- optional(:show) { bool? }
117
- end
118
- end
119
- optional(:size) { str? }
120
- end
121
- optional(:expandOnClick) { int? | float? }
122
- optional(:offsetX) { int? | float? }
123
- optional(:offsetY) { int? | float? }
124
- optional(:startAngle) { int? | float? }
125
- optional(:endAngle) { int? | float? }
126
- end
127
- optional(:polarArea).hash do
128
- optional(:rings).hash do
129
- optional(:strokeColor) { str? }
130
- optional(:strokeWidth) { int? | float? }
131
- end
132
- optional(:spokes).hash do
133
- optional(:connectorColors) { str? | (array? & each { str? }) }
134
- optional(:strokeWidth) { int? | float? }
135
- end
136
- end
137
- optional(:radar).hash do
138
- optional(:offsetX) { int? | float? }
139
- optional(:offsetY) { int? | float? }
140
- optional(:polygons).hash do
141
- optional(:connectorColors) { str? | (array? & each { str? }) }
142
- optional(:fill).hash do
143
- optional(:colors) { str? | (array? & each { str? }) }
144
- end
145
- optional(:strokeColors) { str? | (array? & each { str? }) }
146
- optional(:strokeWidth) { str? | (array? & each { str? }) }
147
- end
148
- optional(:size) { int? | float? }
149
- end
150
- optional(:radialBar).hash do
151
- optional(:dataLabels).hash do
152
- optional(:name).hash do
153
- optional(:color) { str? }
154
- optional(:fontFamily) { str? }
155
- optional(:fontSize) { str? }
156
- optional(:fontWeight) { str? | int? | float? }
157
- optional(:offsetY) { int? | float? }
158
- optional(:show) { bool? }
159
- end
160
- optional(:show) { bool? }
161
- optional(:total).hash do
162
- optional(:color) { str? }
163
- optional(:fontFamily) { str? }
164
- optional(:fontSize) { str? }
165
- optional(:fontWeight) { str? | int? | float? }
166
- optional(:formatter).hash(Function)
167
- optional(:label) { str? }
168
- optional(:show) { bool? }
169
- end
170
- optional(:value).hash do
171
- optional(:color) { str? }
172
- optional(:fontFamily) { str? }
173
- optional(:fontSize) { str? }
174
- optional(:fontWeight) { str? | int? | float? }
175
- optional(:formatter).hash(Function)
176
- optional(:offsetY) { int? | float? }
177
- optional(:show) { bool? }
178
- end
179
- end
180
- optional(:endAngle) { int? | float? }
181
- optional(:hollow).hash do
182
- optional(:background) { str? }
183
- optional(:dropShadow).hash(DropShadow)
184
- optional(:image) { str? }
185
- optional(:imageClipped) { bool? }
186
- optional(:imageHeight) { int? | float? }
187
- optional(:imageOffsetX) { int? | float? }
188
- optional(:imageOffsetY) { int? | float? }
189
- optional(:imageWidth) { int? | float? }
190
- optional(:margin) { int? | float? }
191
- optional(:position) { included_in?(%w[front back]) }
192
- optional(:size) { str? }
193
- end
194
- optional(:inverseOrder) { bool? }
195
- optional(:offsetX) { int? | float? }
196
- optional(:offsetY) { int? | float? }
197
- optional(:startAngle) { int? | float? }
198
- optional(:track).hash do
199
- optional(:background) { str? }
200
- optional(:dropShadow).hash(DropShadow)
201
- optional(:endAngle) { int? | float? }
202
- optional(:margin) { int? | float? }
203
- optional(:opacity) { int? | float? }
204
- optional(:show) { bool? }
205
- optional(:startAngle) { int? | float? }
206
- optional(:strokeWidth) { str? }
207
- end
208
- end
209
- optional(:treemap).hash do
210
- optional(:colorScale).hash do
211
- optional(:inverse) { bool? }
212
- optional(:max) { int? | float? }
213
- optional(:min) { int? | float? }
214
- optional(:ranges).array(:hash) do
215
- optional(:color) { str? }
216
- optional(:foreColor) { str? }
217
- optional(:from) { int? | float? }
218
- optional(:name) { str? }
219
- optional(:to) { int? | float? }
220
- end
221
- end
222
- optional(:distributed) { bool? }
223
- optional(:enableShades) { bool? }
224
- optional(:reverseNegativeShade) { bool? }
225
- optional(:shadeIntensity) { int? | float? }
226
- optional(:useFillColorAsStroke) { bool? }
227
- end
228
- end
229
- end
230
- end
231
- end
@@ -1,42 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'schema'
4
- require_relative 'helper_options'
5
- require_relative 'chart_options'
6
- require_relative 'stroke_options'
7
- require_relative 'states_options'
8
-
9
- module ApexCharts::Options
10
- module DrySchema
11
- class RootOptions < Schema
12
- define do
13
- optional(:annotations)
14
- optional(:chart)
15
- optional(:colors)
16
- optional(:dataLabels)
17
- optional(:fill)
18
- optional(:grid)
19
- optional(:labels)
20
- optional(:legend)
21
- optional(:markers)
22
- optional(:noData)
23
- optional(:plotOptions)
24
- optional(:responsive)
25
- optional(:series)
26
- optional(:states)
27
- optional(:stroke)
28
- optional(:subtitle)
29
- optional(:theme)
30
- optional(:title)
31
- optional(:tooltip)
32
- optional(:xaxis)
33
- optional(:yaxis)
34
-
35
- (HelperOptions.keys + ChartOptions.keys +
36
- StrokeOptions.keys + StatesOptions.keys).each do |key|
37
- optional(key)
38
- end
39
- end
40
- end
41
- end
42
- end
@@ -1,32 +0,0 @@
1
- require 'dry/schema'
2
-
3
- Dry::Schema.config.validate_keys = true
4
-
5
- module ApexCharts::Options
6
- module DrySchema
7
- class Schema < ::Dry::Schema::Params
8
- class << self
9
- def check(hash)
10
- return hash if production?
11
-
12
- schema = new[hash]
13
- if schema.failure?
14
- raise schema.errors.to_h.inspect
15
- else
16
- hash
17
- end
18
- end
19
-
20
- def keys
21
- definition.send(:key_map).map{|key| key.name.to_sym }
22
- end
23
-
24
- private
25
-
26
- def production?
27
- (ENV['APP_ENV'] || ENV['RAILS_ENV'] || ENV['RACK_ENV']) == "production"
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ApexCharts::Options
4
- module DrySchema
5
- Filter = ::Dry::Schema.Params do
6
- optional(:type) { str? }
7
- optional(:value) { int? | float? }
8
- end
9
- end
10
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'states_options/filter'
4
-
5
- module ApexCharts::Options
6
- module DrySchema
7
- class StatesOptions < Schema
8
- define do
9
- optional(:active).hash do
10
- optional(:allowMultipleDataPointsSelection) { bool? }
11
- optional(:filter).hash(Filter)
12
- end
13
- optional(:hover).hash do
14
- optional(:filter).hash(Filter)
15
- end
16
- optional(:normal).hash do
17
- optional(:filter).hash(Filter)
18
- end
19
- end
20
- end
21
- end
22
- end