apexcharts 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +89 -33
  3. data/lib/apex_charts/charts.rb +1 -0
  4. data/lib/apex_charts/charts/box_plot_chart.rb +8 -0
  5. data/lib/apex_charts/config/schema.rb +20 -0
  6. data/lib/apex_charts/configuration.rb +2 -0
  7. data/lib/apex_charts/helper.rb +9 -11
  8. data/lib/apex_charts/options/default/annotations_options.rb +14 -0
  9. data/lib/apex_charts/options/default/chart_options.rb +33 -0
  10. data/lib/apex_charts/options/default/data_labels_options.rb +18 -0
  11. data/lib/apex_charts/options/default/fill_options.rb +14 -0
  12. data/lib/apex_charts/options/default/grid_options.rb +17 -0
  13. data/lib/apex_charts/options/default/helper_options.rb +22 -0
  14. data/lib/apex_charts/options/default/legend_options.rb +33 -0
  15. data/lib/apex_charts/options/default/markers_options.rb +26 -0
  16. data/lib/apex_charts/options/default/no_data_options.rb +14 -0
  17. data/lib/apex_charts/options/default/plot_options.rb +19 -0
  18. data/lib/apex_charts/options/default/root_options.rb +38 -0
  19. data/lib/apex_charts/options/default/states_options.rb +11 -0
  20. data/lib/apex_charts/options/default/stroke_options.rb +14 -0
  21. data/lib/apex_charts/options/default/theme_options.rb +11 -0
  22. data/lib/apex_charts/options/default/title_subtitle_options.rb +15 -0
  23. data/lib/apex_charts/options/default/tooltip_options.rb +25 -0
  24. data/lib/apex_charts/options/default/x_axis_options.rb +27 -0
  25. data/lib/apex_charts/options/default/y_axis_options.rb +28 -0
  26. data/lib/apex_charts/options/dry_schema/annotations_options.rb +22 -0
  27. data/lib/apex_charts/options/dry_schema/annotations_options/annotation_label.rb +24 -0
  28. data/lib/apex_charts/options/dry_schema/annotations_options/image_annotations.rb +15 -0
  29. data/lib/apex_charts/options/dry_schema/annotations_options/point_annotations.rb +33 -0
  30. data/lib/apex_charts/options/dry_schema/annotations_options/text_annotations.rb +26 -0
  31. data/lib/apex_charts/options/dry_schema/annotations_options/x_axis_annotations.rb +20 -0
  32. data/lib/apex_charts/options/dry_schema/annotations_options/y_axis_annotations.rb +21 -0
  33. data/lib/apex_charts/options/dry_schema/chart_options.rb +35 -0
  34. data/lib/apex_charts/options/dry_schema/data_labels_options.rb +37 -0
  35. data/lib/apex_charts/options/dry_schema/fill_options.rb +34 -0
  36. data/lib/apex_charts/options/dry_schema/general_schema/drop_shadow.rb +14 -0
  37. data/lib/apex_charts/options/dry_schema/general_schema/function.rb +12 -0
  38. data/lib/apex_charts/options/dry_schema/grid_options.rb +19 -0
  39. data/lib/apex_charts/options/dry_schema/helper_options.rb +22 -0
  40. data/lib/apex_charts/options/dry_schema/legend_options.rb +61 -0
  41. data/lib/apex_charts/options/dry_schema/markers_options.rb +34 -0
  42. data/lib/apex_charts/options/dry_schema/markers_options/discrete_point.rb +13 -0
  43. data/lib/apex_charts/options/dry_schema/no_data_options.rb +16 -0
  44. data/lib/apex_charts/options/dry_schema/plot_options.rb +231 -0
  45. data/lib/apex_charts/options/dry_schema/root_options.rb +42 -0
  46. data/lib/apex_charts/options/dry_schema/schema.rb +32 -0
  47. data/lib/apex_charts/options/dry_schema/states_options.rb +22 -0
  48. data/lib/apex_charts/options/dry_schema/states_options/filter.rb +10 -0
  49. data/lib/apex_charts/options/dry_schema/stroke_options.rb +21 -0
  50. data/lib/apex_charts/options/dry_schema/theme_options.rb +18 -0
  51. data/lib/apex_charts/options/dry_schema/title_subtitle_options.rb +22 -0
  52. data/lib/apex_charts/options/dry_schema/tooltip_options.rb +27 -0
  53. data/lib/apex_charts/options/dry_schema/x_axis_options.rb +30 -0
  54. data/lib/apex_charts/options/dry_schema/y_axis_options.rb +30 -0
  55. data/lib/apex_charts/options_builder.rb +51 -38
  56. data/lib/apex_charts/theme.rb +0 -16
  57. data/lib/apex_charts/version.rb +2 -2
  58. data/vendor/assets/javascripts/apexcharts.js +5 -5
  59. metadata +58 -27
  60. data/lib/apex_charts/options/annotations_options.rb +0 -15
  61. data/lib/apex_charts/options/chart_options.rb +0 -32
  62. data/lib/apex_charts/options/data_labels_options.rb +0 -18
  63. data/lib/apex_charts/options/div_attributes.rb +0 -11
  64. data/lib/apex_charts/options/fill_options.rb +0 -14
  65. data/lib/apex_charts/options/grid_options.rb +0 -17
  66. data/lib/apex_charts/options/legend_options.rb +0 -32
  67. data/lib/apex_charts/options/markers_options.rb +0 -24
  68. data/lib/apex_charts/options/no_data_options.rb +0 -14
  69. data/lib/apex_charts/options/plot_options.rb +0 -16
  70. data/lib/apex_charts/options/root_options.rb +0 -47
  71. data/lib/apex_charts/options/states_options.rb +0 -11
  72. data/lib/apex_charts/options/stroke_options.rb +0 -14
  73. data/lib/apex_charts/options/theme_options.rb +0 -11
  74. data/lib/apex_charts/options/title_subtitle_options.rb +0 -15
  75. data/lib/apex_charts/options/tooltip_options.rb +0 -25
  76. data/lib/apex_charts/options/x_axis_options.rb +0 -26
  77. data/lib/apex_charts/options/y_axis_options.rb +0 -28
@@ -0,0 +1,33 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class LegendOptions < ::SmartKv
4
+ optional *%i[
5
+ containerMargin
6
+ customLegendItems
7
+ floating
8
+ fontFamily
9
+ fontSize
10
+ fontWeight
11
+ formatter
12
+ height
13
+ horizontalAlign
14
+ inverseOrder
15
+ itemMargin
16
+ labels
17
+ markers
18
+ offsetX
19
+ offsetY
20
+ onItemClick
21
+ onItemHover
22
+ position
23
+ show
24
+ showForNullSeries
25
+ showForSingleSeries
26
+ showForZeroSeries
27
+ textAnchor
28
+ tooltipHoverFormatter
29
+ width
30
+ ]
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class MarkersOptions < ::SmartKv
4
+ optional *%i[
5
+ colors
6
+ discrete
7
+ fillOpacity
8
+ height
9
+ hover
10
+ offsetX
11
+ offsetY
12
+ onClick
13
+ onDblClick
14
+ radius
15
+ shape
16
+ showNullDataPoints
17
+ size
18
+ strokeColors
19
+ strokeDashArray
20
+ strokeOpacity
21
+ strokeWidth
22
+ width
23
+ ]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,14 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class NoDataOptions < ::SmartKv
4
+ optional *%i[
5
+ align
6
+ offsetX
7
+ offsetY
8
+ style
9
+ text
10
+ verticalAlign
11
+ ]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,19 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class PlotOptions < ::SmartKv
4
+ optional *%i[
5
+ area
6
+ bar
7
+ boxPlot
8
+ bubble
9
+ candlestick
10
+ heatmap
11
+ pie
12
+ polarArea
13
+ radar
14
+ radialBar
15
+ treemap
16
+ ]
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,38 @@
1
+ require_relative 'helper_options'
2
+ require_relative 'chart_options'
3
+ require_relative 'stroke_options'
4
+ require_relative 'states_options'
5
+
6
+ module ApexCharts::Options
7
+ module Default
8
+ class RootOptions < ::SmartKv
9
+ optional *%i[
10
+ annotations
11
+ chart
12
+ colors
13
+ dataLabels
14
+ fill
15
+ grid
16
+ labels
17
+ legend
18
+ markers
19
+ noData
20
+ plotOptions
21
+ responsive
22
+ series
23
+ states
24
+ stroke
25
+ subtitle
26
+ theme
27
+ title
28
+ tooltip
29
+ xaxis
30
+ yaxis
31
+ ],
32
+ *HelperOptions.optional_keys,
33
+ *ChartOptions.optional_keys,
34
+ *StrokeOptions.optional_keys,
35
+ *StatesOptions.optional_keys
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,11 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class StatesOptions < ::SmartKv
4
+ optional *%i[
5
+ active
6
+ hover
7
+ normal
8
+ ]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class StrokeOptions < ::SmartKv
4
+ optional *%i[
5
+ colors
6
+ curve
7
+ dashArray
8
+ lineCap
9
+ show
10
+ width
11
+ ]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class ThemeOptions < ::SmartKv
4
+ optional *%i[
5
+ mode
6
+ monochrome
7
+ palette
8
+ ]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class TitleSubtitleOptions < ::SmartKv
4
+ optional *%i[
5
+ align
6
+ floating
7
+ margin
8
+ offsetX
9
+ offsetY
10
+ style
11
+ text
12
+ ]
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class TooltipOptions < ::SmartKv
4
+ optional *%i[
5
+ custom
6
+ enabled
7
+ enabledOnSeries
8
+ fillSeriesColor
9
+ fixed
10
+ followCursor
11
+ intersect
12
+ inverseOrder
13
+ items
14
+ marker
15
+ onDatasetHover
16
+ shared
17
+ style
18
+ theme
19
+ x
20
+ y
21
+ z
22
+ ]
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class XAxisOptions < ::SmartKv
4
+ optional *%i[
5
+ axisBorder
6
+ axisTicks
7
+ categories
8
+ crosshairs
9
+ floating
10
+ labels
11
+ max
12
+ min
13
+ offsetX
14
+ offsetY
15
+ overwriteCategories
16
+ position
17
+ range
18
+ sorted
19
+ tickAmount
20
+ tickPlacement
21
+ title
22
+ tooltip
23
+ type
24
+ ]
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,28 @@
1
+ module ApexCharts::Options
2
+ module Default
3
+ class YAxisOptions < ::SmartKv
4
+ optional *%i[
5
+ axisBorder
6
+ axisTicks
7
+ crosshairs
8
+ decimalsInFloat
9
+ floating
10
+ forceNiceScale
11
+ labels
12
+ logarithmic
13
+ max
14
+ min
15
+ opposite
16
+ reversed
17
+ seriesName
18
+ show
19
+ showAlways
20
+ showForNullSeries
21
+ tickAmount
22
+ title
23
+ tooltip
24
+ type
25
+ ]
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,22 @@
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
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApexCharts::Options
4
+ module DrySchema
5
+ AnnotationLabel = ::Dry::Schema.Params do
6
+ optional(:backgroundColor) { str? }
7
+ optional(:borderColor) { str? }
8
+ optional(:borderRadius) { int? | float? }
9
+ optional(:borderWidth) { int? | float? }
10
+ optional(:fontFamily) { filled? > str? }
11
+ optional(:fontSize) { str? | int? | float? }
12
+ optional(:fontWeight) { str? | int? | float? }
13
+ optional(:foreColor) { str? }
14
+ optional(:paddingBottom) { int? | float? }
15
+ optional(:paddingLeft) { int? | float? }
16
+ optional(:paddingRight) { int? | float? }
17
+ optional(:paddingTop) { int? | float? }
18
+ optional(:text) { str? }
19
+ optional(:textAnchor) { str? }
20
+ optional(:x) { int? | float? }
21
+ optional(:y) { int? | float? }
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'annotation_label'
4
+
5
+ module ApexCharts::Options
6
+ module DrySchema
7
+ ImageAnnotations = ::Dry::Schema.Params do
8
+ optional(:height) { int? | float? }
9
+ optional(:path) { str? }
10
+ optional(:width) { int? | float? }
11
+ optional(:x) { int? | float? }
12
+ optional(:y) { int? | float? }
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'annotation_label'
4
+
5
+ module ApexCharts::Options
6
+ module DrySchema
7
+ PointAnnotations = ::Dry::Schema.Params do
8
+ optional(:x) { int? | float? | str? }
9
+ optional(:y) { filled? > int? | float? }
10
+ optional(:yAxisIndex) { int? | float? }
11
+ optional(:seriesIndex) { int? | float? }
12
+ optional(:marker).hash do
13
+ optional(:size) { int? | float? }
14
+ optional(:fillColor) { str? }
15
+ optional(:strokeColor) { str? }
16
+ optional(:strokeWidth) { int? | float? }
17
+ optional(:shape) { str? }
18
+ optional(:offsetX) { int? | float? }
19
+ optional(:offsetY) { int? | float? }
20
+ optional(:radius) { int? | float? }
21
+ optional(:cssClass) { str? }
22
+ end
23
+ optional(:label).hash(AnnotationLabel)
24
+ optional(:image).hash do
25
+ optional(:height) { int? | float? }
26
+ optional(:offsetX) { int? | float? }
27
+ optional(:offsetY) { int? | float? }
28
+ optional(:path) { str? }
29
+ optional(:width) { int? | float? }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'annotation_label'
4
+
5
+ module ApexCharts::Options
6
+ module DrySchema
7
+ TextAnnotations = ::Dry::Schema.Params do
8
+ optional(:backgroundColor) { str? }
9
+ optional(:borderColor) { str? }
10
+ optional(:borderRadius) { int? | float? }
11
+ optional(:borderWidth) { int? | float? }
12
+ optional(:fontFamily) { filled? > str? }
13
+ optional(:fontSize) { str? | int? | float? }
14
+ optional(:fontWeight) { str? | int? | float? }
15
+ optional(:foreColor) { str? }
16
+ optional(:paddingBottom) { int? | float? }
17
+ optional(:paddingLeft) { int? | float? }
18
+ optional(:paddingRight) { int? | float? }
19
+ optional(:paddingTop) { int? | float? }
20
+ optional(:text) { str? }
21
+ optional(:textAnchor) { str? }
22
+ optional(:x) { int? | float? }
23
+ optional(:y) { int? | float? }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'annotation_label'
4
+
5
+ module ApexCharts::Options
6
+ module DrySchema
7
+ XAxisAnnotations = ::Dry::Schema.Params do
8
+ optional(:borderColor) { str? }
9
+ optional(:borderWidth) { int? | float? }
10
+ optional(:fillColor) { str? }
11
+ optional(:label).hash(AnnotationLabel)
12
+ optional(:offsetX) { int? | float? }
13
+ optional(:offsetY) { int? | float? }
14
+ optional(:opacity) { int? | float? }
15
+ optional(:strokeDashArray) { int? | float? }
16
+ optional(:x) { filled? > int? | float? | str? }
17
+ optional(:x2) { filled? > int? | float? | str? }
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'annotation_label'
4
+
5
+ module ApexCharts::Options
6
+ module DrySchema
7
+ YAxisAnnotations = ::Dry::Schema.Params do
8
+ optional(:borderColor) { str? }
9
+ optional(:borderWidth) { int? | float? }
10
+ optional(:fillColor) { str? }
11
+ optional(:label).hash(AnnotationLabel)
12
+ optional(:offsetX) { int? | float? }
13
+ optional(:offsetY) { int? | float? }
14
+ optional(:opacity) { int? | float? }
15
+ optional(:strokeDashArray) { int? | float? }
16
+ optional(:y) { filled? > int? | float? | str? }
17
+ optional(:y2) { filled? > int? | float? | str? }
18
+ optional(:yAxisIndex) { int? | float? }
19
+ end
20
+ end
21
+ end