apexify.js 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) hide show
  1. package/CHANGELOG.md +263 -38
  2. package/README.md +248 -1109
  3. package/dist/cjs/Canvas/ApexPainter.d.ts +182 -204
  4. package/dist/cjs/Canvas/ApexPainter.d.ts.map +1 -1
  5. package/dist/cjs/Canvas/ApexPainter.js +482 -1286
  6. package/dist/cjs/Canvas/ApexPainter.js.map +1 -1
  7. package/dist/cjs/Canvas/extended/CanvasCreator.d.ts +33 -0
  8. package/dist/cjs/Canvas/extended/CanvasCreator.d.ts.map +1 -0
  9. package/dist/cjs/Canvas/extended/CanvasCreator.js +223 -0
  10. package/dist/cjs/Canvas/extended/CanvasCreator.js.map +1 -0
  11. package/dist/cjs/Canvas/extended/ChartCreator.d.ts +26 -0
  12. package/dist/cjs/Canvas/extended/ChartCreator.d.ts.map +1 -0
  13. package/dist/cjs/Canvas/extended/ChartCreator.js +50 -0
  14. package/dist/cjs/Canvas/extended/ChartCreator.js.map +1 -0
  15. package/dist/cjs/Canvas/extended/GIFCreator.d.ts +43 -0
  16. package/dist/cjs/Canvas/extended/GIFCreator.d.ts.map +1 -0
  17. package/dist/cjs/Canvas/extended/GIFCreator.js +157 -0
  18. package/dist/cjs/Canvas/extended/GIFCreator.js.map +1 -0
  19. package/dist/cjs/Canvas/extended/ImageCreator.d.ts +83 -0
  20. package/dist/cjs/Canvas/extended/ImageCreator.d.ts.map +1 -0
  21. package/dist/cjs/Canvas/extended/ImageCreator.js +479 -0
  22. package/dist/cjs/Canvas/extended/ImageCreator.js.map +1 -0
  23. package/dist/cjs/Canvas/extended/TextCreator.d.ts +35 -0
  24. package/dist/cjs/Canvas/extended/TextCreator.d.ts.map +1 -0
  25. package/dist/cjs/Canvas/extended/TextCreator.js +98 -0
  26. package/dist/cjs/Canvas/extended/TextCreator.js.map +1 -0
  27. package/dist/cjs/Canvas/extended/VideoCreator.d.ts +370 -0
  28. package/dist/cjs/Canvas/extended/VideoCreator.d.ts.map +1 -0
  29. package/dist/cjs/Canvas/extended/VideoCreator.js +478 -0
  30. package/dist/cjs/Canvas/extended/VideoCreator.js.map +1 -0
  31. package/dist/cjs/Canvas/utils/Background/bg.d.ts +1 -1
  32. package/dist/cjs/Canvas/utils/Background/bg.d.ts.map +1 -1
  33. package/dist/cjs/Canvas/utils/Background/bg.js +43 -7
  34. package/dist/cjs/Canvas/utils/Background/bg.js.map +1 -1
  35. package/dist/cjs/Canvas/utils/Charts/barchart.d.ts +230 -0
  36. package/dist/cjs/Canvas/utils/Charts/barchart.d.ts.map +1 -0
  37. package/dist/cjs/Canvas/utils/Charts/barchart.js +1891 -0
  38. package/dist/cjs/Canvas/utils/Charts/barchart.js.map +1 -0
  39. package/dist/cjs/Canvas/utils/Charts/comparisonchart.d.ts +103 -0
  40. package/dist/cjs/Canvas/utils/Charts/comparisonchart.d.ts.map +1 -0
  41. package/dist/cjs/Canvas/utils/Charts/comparisonchart.js +368 -0
  42. package/dist/cjs/Canvas/utils/Charts/comparisonchart.js.map +1 -0
  43. package/dist/cjs/Canvas/utils/Charts/horizontalbarchart.d.ts +178 -0
  44. package/dist/cjs/Canvas/utils/Charts/horizontalbarchart.d.ts.map +1 -0
  45. package/dist/cjs/Canvas/utils/Charts/horizontalbarchart.js +1389 -0
  46. package/dist/cjs/Canvas/utils/Charts/horizontalbarchart.js.map +1 -0
  47. package/dist/cjs/Canvas/utils/Charts/index.d.ts +45 -0
  48. package/dist/cjs/Canvas/utils/Charts/index.d.ts.map +1 -0
  49. package/dist/cjs/Canvas/utils/Charts/index.js +17 -0
  50. package/dist/cjs/Canvas/utils/Charts/index.js.map +1 -0
  51. package/dist/cjs/Canvas/utils/Charts/linechart.d.ts +216 -0
  52. package/dist/cjs/Canvas/utils/Charts/linechart.d.ts.map +1 -0
  53. package/dist/cjs/Canvas/utils/Charts/linechart.js +1761 -0
  54. package/dist/cjs/Canvas/utils/Charts/linechart.js.map +1 -0
  55. package/dist/cjs/Canvas/utils/Charts/piechart.d.ts +167 -0
  56. package/dist/cjs/Canvas/utils/Charts/piechart.d.ts.map +1 -0
  57. package/dist/cjs/Canvas/utils/Charts/piechart.js +794 -0
  58. package/dist/cjs/Canvas/utils/Charts/piechart.js.map +1 -0
  59. package/dist/cjs/Canvas/utils/General/batchOperations.d.ts.map +1 -1
  60. package/dist/cjs/Canvas/utils/General/batchOperations.js +3 -4
  61. package/dist/cjs/Canvas/utils/General/batchOperations.js.map +1 -1
  62. package/dist/cjs/Canvas/utils/General/general functions.d.ts.map +1 -1
  63. package/dist/cjs/Canvas/utils/General/general functions.js +62 -33
  64. package/dist/cjs/Canvas/utils/General/general functions.js.map +1 -1
  65. package/dist/cjs/Canvas/utils/General/imageStitching.d.ts.map +1 -1
  66. package/dist/cjs/Canvas/utils/General/imageStitching.js +3 -6
  67. package/dist/cjs/Canvas/utils/General/imageStitching.js.map +1 -1
  68. package/dist/cjs/Canvas/utils/Image/imageMasking.d.ts.map +1 -1
  69. package/dist/cjs/Canvas/utils/Image/imageMasking.js +5 -12
  70. package/dist/cjs/Canvas/utils/Image/imageMasking.js.map +1 -1
  71. package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts +4 -4
  72. package/dist/cjs/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
  73. package/dist/cjs/Canvas/utils/Image/imageProperties.js +44 -9
  74. package/dist/cjs/Canvas/utils/Image/imageProperties.js.map +1 -1
  75. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts +5 -0
  76. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
  77. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js +48 -5
  78. package/dist/cjs/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
  79. package/dist/cjs/Canvas/utils/Texts/textProperties.d.ts +1 -1
  80. package/dist/cjs/Canvas/utils/Texts/textProperties.d.ts.map +1 -1
  81. package/dist/cjs/Canvas/utils/Texts/textProperties.js +48 -5
  82. package/dist/cjs/Canvas/utils/Texts/textProperties.js.map +1 -1
  83. package/dist/cjs/Canvas/utils/Video/videoHelpers.d.ts +489 -0
  84. package/dist/cjs/Canvas/utils/Video/videoHelpers.d.ts.map +1 -0
  85. package/dist/cjs/Canvas/utils/Video/videoHelpers.js +1835 -0
  86. package/dist/cjs/Canvas/utils/Video/videoHelpers.js.map +1 -0
  87. package/dist/cjs/Canvas/utils/errorUtils.d.ts +15 -0
  88. package/dist/cjs/Canvas/utils/errorUtils.d.ts.map +1 -0
  89. package/dist/cjs/Canvas/utils/errorUtils.js +26 -0
  90. package/dist/cjs/Canvas/utils/errorUtils.js.map +1 -0
  91. package/dist/cjs/Canvas/utils/types.d.ts +17 -178
  92. package/dist/cjs/Canvas/utils/types.d.ts.map +1 -1
  93. package/dist/cjs/Canvas/utils/types.js.map +1 -1
  94. package/dist/cjs/Canvas/utils/utils.d.ts +4 -3
  95. package/dist/cjs/Canvas/utils/utils.d.ts.map +1 -1
  96. package/dist/cjs/Canvas/utils/utils.js +40 -6
  97. package/dist/cjs/Canvas/utils/utils.js.map +1 -1
  98. package/dist/cjs/index.d.ts +1 -8
  99. package/dist/cjs/index.d.ts.map +1 -1
  100. package/dist/cjs/index.js +14 -45
  101. package/dist/cjs/index.js.map +1 -1
  102. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  103. package/dist/esm/Canvas/ApexPainter.d.ts +182 -204
  104. package/dist/esm/Canvas/ApexPainter.d.ts.map +1 -1
  105. package/dist/esm/Canvas/ApexPainter.js +482 -1286
  106. package/dist/esm/Canvas/ApexPainter.js.map +1 -1
  107. package/dist/esm/Canvas/extended/CanvasCreator.d.ts +33 -0
  108. package/dist/esm/Canvas/extended/CanvasCreator.d.ts.map +1 -0
  109. package/dist/esm/Canvas/extended/CanvasCreator.js +223 -0
  110. package/dist/esm/Canvas/extended/CanvasCreator.js.map +1 -0
  111. package/dist/esm/Canvas/extended/ChartCreator.d.ts +26 -0
  112. package/dist/esm/Canvas/extended/ChartCreator.d.ts.map +1 -0
  113. package/dist/esm/Canvas/extended/ChartCreator.js +50 -0
  114. package/dist/esm/Canvas/extended/ChartCreator.js.map +1 -0
  115. package/dist/esm/Canvas/extended/GIFCreator.d.ts +43 -0
  116. package/dist/esm/Canvas/extended/GIFCreator.d.ts.map +1 -0
  117. package/dist/esm/Canvas/extended/GIFCreator.js +157 -0
  118. package/dist/esm/Canvas/extended/GIFCreator.js.map +1 -0
  119. package/dist/esm/Canvas/extended/ImageCreator.d.ts +83 -0
  120. package/dist/esm/Canvas/extended/ImageCreator.d.ts.map +1 -0
  121. package/dist/esm/Canvas/extended/ImageCreator.js +479 -0
  122. package/dist/esm/Canvas/extended/ImageCreator.js.map +1 -0
  123. package/dist/esm/Canvas/extended/TextCreator.d.ts +35 -0
  124. package/dist/esm/Canvas/extended/TextCreator.d.ts.map +1 -0
  125. package/dist/esm/Canvas/extended/TextCreator.js +98 -0
  126. package/dist/esm/Canvas/extended/TextCreator.js.map +1 -0
  127. package/dist/esm/Canvas/extended/VideoCreator.d.ts +370 -0
  128. package/dist/esm/Canvas/extended/VideoCreator.d.ts.map +1 -0
  129. package/dist/esm/Canvas/extended/VideoCreator.js +478 -0
  130. package/dist/esm/Canvas/extended/VideoCreator.js.map +1 -0
  131. package/dist/esm/Canvas/utils/Background/bg.d.ts +1 -1
  132. package/dist/esm/Canvas/utils/Background/bg.d.ts.map +1 -1
  133. package/dist/esm/Canvas/utils/Background/bg.js +43 -7
  134. package/dist/esm/Canvas/utils/Background/bg.js.map +1 -1
  135. package/dist/esm/Canvas/utils/Charts/barchart.d.ts +230 -0
  136. package/dist/esm/Canvas/utils/Charts/barchart.d.ts.map +1 -0
  137. package/dist/esm/Canvas/utils/Charts/barchart.js +1891 -0
  138. package/dist/esm/Canvas/utils/Charts/barchart.js.map +1 -0
  139. package/dist/esm/Canvas/utils/Charts/comparisonchart.d.ts +103 -0
  140. package/dist/esm/Canvas/utils/Charts/comparisonchart.d.ts.map +1 -0
  141. package/dist/esm/Canvas/utils/Charts/comparisonchart.js +368 -0
  142. package/dist/esm/Canvas/utils/Charts/comparisonchart.js.map +1 -0
  143. package/dist/esm/Canvas/utils/Charts/horizontalbarchart.d.ts +178 -0
  144. package/dist/esm/Canvas/utils/Charts/horizontalbarchart.d.ts.map +1 -0
  145. package/dist/esm/Canvas/utils/Charts/horizontalbarchart.js +1389 -0
  146. package/dist/esm/Canvas/utils/Charts/horizontalbarchart.js.map +1 -0
  147. package/dist/esm/Canvas/utils/Charts/index.d.ts +45 -0
  148. package/dist/esm/Canvas/utils/Charts/index.d.ts.map +1 -0
  149. package/dist/esm/Canvas/utils/Charts/index.js +17 -0
  150. package/dist/esm/Canvas/utils/Charts/index.js.map +1 -0
  151. package/dist/esm/Canvas/utils/Charts/linechart.d.ts +216 -0
  152. package/dist/esm/Canvas/utils/Charts/linechart.d.ts.map +1 -0
  153. package/dist/esm/Canvas/utils/Charts/linechart.js +1761 -0
  154. package/dist/esm/Canvas/utils/Charts/linechart.js.map +1 -0
  155. package/dist/esm/Canvas/utils/Charts/piechart.d.ts +167 -0
  156. package/dist/esm/Canvas/utils/Charts/piechart.d.ts.map +1 -0
  157. package/dist/esm/Canvas/utils/Charts/piechart.js +794 -0
  158. package/dist/esm/Canvas/utils/Charts/piechart.js.map +1 -0
  159. package/dist/esm/Canvas/utils/General/batchOperations.d.ts.map +1 -1
  160. package/dist/esm/Canvas/utils/General/batchOperations.js +3 -4
  161. package/dist/esm/Canvas/utils/General/batchOperations.js.map +1 -1
  162. package/dist/esm/Canvas/utils/General/general functions.d.ts.map +1 -1
  163. package/dist/esm/Canvas/utils/General/general functions.js +62 -33
  164. package/dist/esm/Canvas/utils/General/general functions.js.map +1 -1
  165. package/dist/esm/Canvas/utils/General/imageStitching.d.ts.map +1 -1
  166. package/dist/esm/Canvas/utils/General/imageStitching.js +3 -6
  167. package/dist/esm/Canvas/utils/General/imageStitching.js.map +1 -1
  168. package/dist/esm/Canvas/utils/Image/imageMasking.d.ts.map +1 -1
  169. package/dist/esm/Canvas/utils/Image/imageMasking.js +5 -12
  170. package/dist/esm/Canvas/utils/Image/imageMasking.js.map +1 -1
  171. package/dist/esm/Canvas/utils/Image/imageProperties.d.ts +4 -4
  172. package/dist/esm/Canvas/utils/Image/imageProperties.d.ts.map +1 -1
  173. package/dist/esm/Canvas/utils/Image/imageProperties.js +44 -9
  174. package/dist/esm/Canvas/utils/Image/imageProperties.js.map +1 -1
  175. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts +5 -0
  176. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.d.ts.map +1 -1
  177. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js +48 -5
  178. package/dist/esm/Canvas/utils/Texts/enhancedTextRenderer.js.map +1 -1
  179. package/dist/esm/Canvas/utils/Texts/textProperties.d.ts +1 -1
  180. package/dist/esm/Canvas/utils/Texts/textProperties.d.ts.map +1 -1
  181. package/dist/esm/Canvas/utils/Texts/textProperties.js +48 -5
  182. package/dist/esm/Canvas/utils/Texts/textProperties.js.map +1 -1
  183. package/dist/esm/Canvas/utils/Video/videoHelpers.d.ts +489 -0
  184. package/dist/esm/Canvas/utils/Video/videoHelpers.d.ts.map +1 -0
  185. package/dist/esm/Canvas/utils/Video/videoHelpers.js +1835 -0
  186. package/dist/esm/Canvas/utils/Video/videoHelpers.js.map +1 -0
  187. package/dist/esm/Canvas/utils/errorUtils.d.ts +15 -0
  188. package/dist/esm/Canvas/utils/errorUtils.d.ts.map +1 -0
  189. package/dist/esm/Canvas/utils/errorUtils.js +26 -0
  190. package/dist/esm/Canvas/utils/errorUtils.js.map +1 -0
  191. package/dist/esm/Canvas/utils/types.d.ts +17 -178
  192. package/dist/esm/Canvas/utils/types.d.ts.map +1 -1
  193. package/dist/esm/Canvas/utils/types.js.map +1 -1
  194. package/dist/esm/Canvas/utils/utils.d.ts +4 -3
  195. package/dist/esm/Canvas/utils/utils.d.ts.map +1 -1
  196. package/dist/esm/Canvas/utils/utils.js +40 -6
  197. package/dist/esm/Canvas/utils/utils.js.map +1 -1
  198. package/dist/esm/index.d.ts +1 -8
  199. package/dist/esm/index.d.ts.map +1 -1
  200. package/dist/esm/index.js +14 -45
  201. package/dist/esm/index.js.map +1 -1
  202. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  203. package/package.json +118 -82
  204. package/dist/cjs/Canvas/utils/Charts/charts.d.ts +0 -13
  205. package/dist/cjs/Canvas/utils/Charts/charts.d.ts.map +0 -1
  206. package/dist/cjs/Canvas/utils/Charts/charts.js +0 -466
  207. package/dist/cjs/Canvas/utils/Charts/charts.js.map +0 -1
  208. package/dist/esm/Canvas/utils/Charts/charts.d.ts +0 -13
  209. package/dist/esm/Canvas/utils/Charts/charts.d.ts.map +0 -1
  210. package/dist/esm/Canvas/utils/Charts/charts.js +0 -466
  211. package/dist/esm/Canvas/utils/Charts/charts.js.map +0 -1
  212. package/lib/Canvas/ApexPainter.ts +0 -5414
  213. package/lib/Canvas/utils/Background/bg.ts +0 -285
  214. package/lib/Canvas/utils/Charts/charts.ts +0 -548
  215. package/lib/Canvas/utils/Custom/advancedLines.ts +0 -387
  216. package/lib/Canvas/utils/Custom/customLines.ts +0 -206
  217. package/lib/Canvas/utils/General/batchOperations.ts +0 -103
  218. package/lib/Canvas/utils/General/conversion.ts +0 -34
  219. package/lib/Canvas/utils/General/general functions.ts +0 -726
  220. package/lib/Canvas/utils/General/imageCompression.ts +0 -316
  221. package/lib/Canvas/utils/General/imageStitching.ts +0 -252
  222. package/lib/Canvas/utils/Image/imageEffects.ts +0 -175
  223. package/lib/Canvas/utils/Image/imageFilters.ts +0 -356
  224. package/lib/Canvas/utils/Image/imageMasking.ts +0 -335
  225. package/lib/Canvas/utils/Image/imageProperties.ts +0 -587
  226. package/lib/Canvas/utils/Image/professionalImageFilters.ts +0 -391
  227. package/lib/Canvas/utils/Image/simpleProfessionalFilters.ts +0 -229
  228. package/lib/Canvas/utils/Patterns/enhancedPatternRenderer.ts +0 -455
  229. package/lib/Canvas/utils/Shapes/shapes.ts +0 -528
  230. package/lib/Canvas/utils/Texts/enhancedTextRenderer.ts +0 -716
  231. package/lib/Canvas/utils/Texts/textPathRenderer.ts +0 -320
  232. package/lib/Canvas/utils/Texts/textProperties.ts +0 -231
  233. package/lib/Canvas/utils/types.ts +0 -983
  234. package/lib/Canvas/utils/utils.ts +0 -135
  235. package/lib/index.ts +0 -81
  236. package/lib/utils.ts +0 -5
package/CHANGELOG.md CHANGED
@@ -5,10 +5,256 @@ All notable changes to Apexify.js will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [5.2.0] - 2024-12-20
9
+
10
+ ### ✨ Added
11
+
12
+ ##### Chart System Enhancements (Complete Rewrite & Major Upgrades!)
13
+
14
+ - **Gradient Support for All Charts**: Professional gradient fills throughout
15
+ - **Background Gradients**: Apply linear, radial, or conic gradients to chart backgrounds
16
+ - **Bar/Line Gradients**: Individual bars and lines can use gradient fills
17
+ - **Title Gradients**: Chart titles support gradient text colors
18
+ - **Label Gradients**: Bar labels, value labels, and point labels support gradients
19
+ - **Legend Gradients**: Legend boxes and legend text support gradient fills
20
+ - Full gradient control with custom color stops and positioning
21
+
22
+ - **Enhanced Text Styling for All Charts**: Professional typography
23
+ - **Custom Fonts**: Support for custom font files (`.ttf`, `.otf`, `.woff`)
24
+ - **Text Effects**: Shadows, strokes, glows for all text elements
25
+ - **Text Decorations**: Bold, italic, underline, strikethrough support
26
+ - **Advanced Styling**: Custom font families, sizes, and spacing
27
+ - Applied to titles, labels, legends, and all chart text elements
28
+
29
+ - **Enhanced Pie Charts**:
30
+ - Gradient slice fills
31
+ - Enhanced title and label styling
32
+ - Gradient legend backgrounds and text
33
+ - Connected legend with gradient support
34
+ - Small slice label positioning improvements
35
+
36
+ - **Enhanced Bar Charts**:
37
+ - Gradient bar fills (standard, grouped, stacked charts)
38
+ - Enhanced title, bar label, and value label styling
39
+ - Gradient legend backgrounds and text
40
+ - Support for gradient bars in all chart types (standard, grouped, stacked, waterfall, lollipop)
41
+
42
+ - **Enhanced Horizontal Bar Charts**:
43
+ - Gradient bar fills (standard, grouped, stacked charts)
44
+ - Enhanced title, bar label, and value label styling
45
+ - Gradient legend backgrounds and text
46
+ - Support for gradient bars in all chart types
47
+
48
+ - **Enhanced Line Charts**:
49
+ - Gradient line fills
50
+ - Enhanced title and point label styling
51
+ - Gradient legend backgrounds and text
52
+ - Support for gradient lines in all series
53
+
54
+ - **Comparison Charts** (`createComparisonChart`): Compare any two chart types side by side
55
+ - Compare any combination: pie/bar, line/bar, pie/line, line/line, bar/bar, pie/pie, pie/donut, horizontal/bar, horizontal/horizontal, horizontal/line, horizontal/pie
56
+ - Side-by-side or top-bottom layouts
57
+ - Shared background with gradient/image support
58
+ - General top title with gradient and enhanced text styling
59
+ - Individual chart titles, data, configs, and legends
60
+ - Full feature support: gradients for all elements, custom fonts, enhanced text styling
61
+ - Each chart maintains its own legend with full customization
62
+ - Configurable spacing between charts
63
+
64
+ - **Comprehensive Test Suite**:
65
+ - Enhanced test files for all chart types
66
+ - Tests for gradients, custom fonts, and advanced styling
67
+ - 11+ tests per chart type covering all new features
68
+ - Comparison chart tests with full feature demonstrations
69
+ - Organized test structure with dedicated output folders
70
+
71
+ ### 🔧 Improved
72
+
73
+ ##### Major Architectural Restructuring (Complete Refactor!)
74
+ - **Modular Architecture Implementation**: Complete restructure of `ApexPainter` into specialized Creator classes
75
+ - Created `extended/` folder with dedicated Creator classes:
76
+ - `CanvasCreator.ts` - Handles all canvas creation logic
77
+ - `ImageCreator.ts` - Handles all image and shape drawing logic
78
+ - `TextCreator.ts` - Handles all text rendering logic
79
+ - `GIFCreator.ts` - Handles all GIF creation logic
80
+ - `ChartCreator.ts` - Handles all chart generation logic
81
+ - `VideoCreator.ts` - Handles all video processing operations
82
+ - **ApexPainter as Facade Pattern**: Refactored `ApexPainter` to act as a facade/delegator
83
+ - All `create*` methods now delegate to corresponding Creator classes
84
+ - Clean separation of concerns between orchestration and implementation
85
+ - Better maintainability and testability
86
+ - Reduced `ApexPainter.ts` from monolithic to clean orchestrator
87
+
88
+ - **Video Helpers Modularization**: Moved all video processing helper methods to dedicated `VideoHelpers` class
89
+ - Extracted 33+ video helper methods from `ApexPainter.ts` to `utils/Video/videoHelpers.ts`
90
+ - Moved `executeFFmpegWithProgress` method to `VideoHelpers` where it belongs
91
+ - Improved code organization and maintainability
92
+ - Reduced `ApexPainter.ts` size by ~2300+ lines
93
+
94
+ - **Error Handling Standardization**: Created centralized error utility functions
95
+ - Added `getErrorMessage()` utility function to standardize error message extraction
96
+ - Added `getCanvasContext()` utility function for consistent canvas context handling
97
+ - Replaced 36+ duplicate error handling patterns across all files
98
+ - Replaced 23+ duplicate context error patterns
99
+ - Consistent error handling throughout the codebase
100
+
101
+ - **Code Duplication Removal**: Removed redundant code and methods
102
+ - Removed duplicate `CanvasResults` interface (now imported from `CanvasCreator`)
103
+ - Removed redundant validation methods from `ApexPainter.ts`:
104
+ - `#validateImageProperties`, `#validateTextProperties`, `#validateCanvasConfig`, `#validateGIFOptions`
105
+ - `#validateImageArray`, `#validateTextArray`, `#renderEnhancedText`
106
+ - Removed redundant shape drawing methods (~500+ lines):
107
+ - `#drawImageBitmap`, `#drawShape`, `#isComplexShape`
108
+ - `#applyShapeShadow`, `#applyShapeStroke`, `#applyShapeStrokeStyle`
109
+ - `#applyComplexShapeStroke`, `#darkenColor`, `#lightenColor`
110
+ - All functionality properly delegated to Creator classes
111
+
112
+ - **Improved Code Organization**:
113
+ - **Modular File Structure**: Organized code into logical modules:
114
+ - `extended/` - Specialized Creator classes for each feature type
115
+ - `utils/` - Shared utilities organized by category (Video, Image, Text, Charts, etc.)
116
+ - Clear separation between core functionality and utilities
117
+ - Better separation of concerns between `ApexPainter` and specialized Creator classes
118
+ - Cleaner `ApexPainter.ts` acting as a facade/delegator (reduced from ~6000+ lines to ~4300 lines)
119
+ - Video-specific functionality properly isolated in `VideoHelpers`
120
+ - Consistent import patterns and type definitions
121
+ - **Dependency Injection**: Creator classes use dependency injection for shared functionality
122
+ - **Type Safety**: Improved TypeScript types with proper interface exports from Creator classes
123
+
124
+ ##### Chart Architecture
125
+ - **Code Organization**: Charts moved to dedicated `lib/Canvas/utils/Charts/` directory
126
+ - **Unified API**: All charts accessible through single `ApexPainter.createChart()` method
127
+ - **Type Safety**: Enhanced TypeScript types for all chart options
128
+ - **Modularity**: Better code organization with shared utilities
129
+
130
+ ##### Chart Rendering
131
+ - **Gradient Integration**: Full integration of ApexPainter's gradient system into all charts
132
+ - **Text Rendering**: Enhanced text renderer used throughout all chart types
133
+ - **Legend Styling**: Consistent legend styling across all chart types
134
+ - **Background Support**: Unified background gradient/image/color support
135
+
136
+ ##### Chart Features
137
+ - **Flexible Legend Positioning**: All charts support top, bottom, left, right legend positions
138
+ - **Enhanced Label Styling**: All labels (titles, bar labels, value labels, point labels) support gradients and enhanced styling
139
+ - **Consistent API**: Same styling options available across all chart types
140
+
141
+ ### 🐛 Fixed
142
+
143
+ ##### Chart Fixes
144
+ - Fixed legend positioning issues when legend is at top with title
145
+ - Fixed Y-axis label overlap with left-positioned legends in bar and horizontal bar charts
146
+ - Fixed horizontal bar chart bars not showing when legend is at top
147
+ - Improved legend spacing calculations to account for axis labels
148
+ - Fixed async/await handling in legend rendering functions
149
+
150
+ ##### Code Quality Fixes
151
+ - Fixed TypeScript compilation errors from duplicate interfaces
152
+ - Resolved import path issues for `CanvasResults` interface
153
+ - Fixed error handling inconsistencies across Creator classes
154
+ - Improved type safety by removing redundant type definitions
155
+
156
+ ##### Professional Video Editing Features (10 Major Features!)
157
+
158
+ - **Freeze Frame** (`freezeFrame`): Hold a frame for dramatic effect
159
+ - Freeze video at any specific time
160
+ - Configurable freeze duration
161
+ - Perfect for highlighting moments or creating photo-like effects
162
+ - Seamlessly merges with video before and after
163
+
164
+ - **Export Presets** (`exportPreset`): Quick export with platform-optimized settings
165
+ - 10 pre-configured presets: YouTube, Instagram, TikTok, Twitter, Facebook, 4K, 1080p, 720p, Mobile, Web
166
+ - Automatic resolution, FPS, and bitrate optimization per platform
167
+ - One-command export for social media platforms
168
+ - Web-optimized formats (WebM for web preset)
169
+
170
+ - **Progress Callbacks** (`onProgress`): Real-time progress tracking
171
+ - Track processing progress for all video operations
172
+ - Provides percent complete, elapsed time, and processing speed
173
+ - Perfect for progress bars and user feedback
174
+ - Works with all video operations (compress, convert, transitions, etc.)
175
+
176
+ - **Audio Normalization** (`normalizeAudio`): Professional audio leveling
177
+ - Three normalization methods: LUFS (broadcast standard), Peak, RMS
178
+ - Configurable target levels
179
+ - Broadcast-compliant audio (-23 LUFS default)
180
+ - Consistent audio levels across videos
181
+
182
+ - **LUT Support** (`applyLUT`): Cinematic color grading
183
+ - Apply Look-Up Tables (.cube files) for professional color grades
184
+ - Intensity control (0-1) for subtle or full application
185
+ - Film emulation and cinematic looks
186
+ - Consistent color grading across videos
187
+
188
+ - **Video Transitions** (`addTransition`): Professional transitions between videos
189
+ - 9 transition types: fade, wipe, slide, zoom, rotate, dissolve, blur, circle, pixelize
190
+ - Direction support for wipe, slide, and zoom transitions
191
+ - Single-video fade in/out support
192
+ - Configurable transition duration
193
+ - Automatic video resolution matching
194
+
195
+ - **Animated Text** (`addAnimatedText`): Advanced text animations with custom fonts
196
+ - 8 animation types: fadeIn, fadeOut, slideIn, slideOut, zoom, bounce, rotate, typewriter
197
+ - Custom font support (reuses `createText` font system)
198
+ - Font file loading (`.ttf`, `.otf`, `.woff`)
199
+ - Font name and family support
200
+ - Time-based text visibility
201
+ - Position control (coordinates or preset positions)
202
+ - Background color and styling options
203
+
204
+ - **Create Video from Frames** (`createFromFrames`): Compile frames into video
205
+ - Create videos from edited frames/images
206
+ - Supports Buffers and file paths
207
+ - Configurable FPS, format, quality, and resolution
208
+ - Automatic dimension detection from first frame
209
+ - Perfect for frame-by-frame editing workflows
210
+
211
+ - **Replace Video Segments** (`replaceSegment`): Replace video segments
212
+ - Replace segments with video from another source
213
+ - Replace segments with edited frames
214
+ - Precise time range control
215
+ - Flexible replacement duration
216
+ - Seamless merging with original video
217
+
218
+ - **Partial Audio Muting** (`mute.ranges`): Mute specific time ranges
219
+ - Mute audio for specific time segments (e.g., 7-13 seconds)
220
+ - Multiple mute ranges support
221
+ - Full mute still supported (backward compatible)
222
+ - Professional audio editing capabilities
223
+
224
+ ### 🔧 Improved
225
+
226
+ ##### Enhanced Video Processing
227
+ - **Progress Tracking**: All video operations now support progress callbacks
228
+ - **Better Error Messages**: More descriptive errors with context
229
+ - **Resource Management**: Improved cleanup of temporary files
230
+ - **Font System Integration**: Animated text uses same font system as `createText`
231
+ - **Transition Quality**: Optimized transition rendering with proper video scaling
232
+
233
+ ##### Video Workflow Enhancements
234
+ - **Frame-to-Video Pipeline**: Complete workflow from frame extraction → editing → compilation
235
+ - **Segment Replacement**: Advanced video editing with frame or video replacement
236
+ - **Audio Control**: Fine-grained audio control with partial muting
237
+ - **Export Optimization**: Platform-specific optimizations for better quality and file sizes
238
+
239
+ ### 🐛 Fixed
240
+
241
+ - Fixed type definitions for `replaceSegment` to support both video and frame replacement
242
+ - Improved error handling in transition operations
243
+ - Better path resolution for LUT files
244
+ - Fixed font path handling in animated text (consistent with `createText`)
245
+
246
+ ---
247
+
8
248
  ## [5.1.0] - 2024-12-20
9
249
 
10
250
  ### ✨ Added
11
251
 
252
+ ##### New Video Methods
253
+ - **`createVideo()`**: New method to create canvas with video frame as background
254
+ - Extract frames at specific time or frame number
255
+ - Custom canvas dimensions or auto-use video dimensions
256
+ - Returns `CanvasResults` compatible with other ApexPainter methods
257
+
12
258
  ##### Comprehensive Video Processing Features (18 New Features!)
13
259
  - **Video Effects/Filters** (`applyEffects`): Apply professional filters to entire videos
14
260
  - Blur, brightness, contrast, saturation adjustments
@@ -123,7 +369,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
123
369
  - **Timeout Handling**: Appropriate timeouts for different operation types
124
370
  - **Buffer Management**: Optimized buffer sizes for different operations
125
371
 
126
- ---
372
+ ##### Video Processing Enhancements
373
+ - **Better Path Resolution**: Relative video paths are now properly resolved
374
+ - Automatically resolves paths relative to `process.cwd()`
375
+ - Consistent with how `customBg` handles image paths
376
+ - Better error messages when video files are not found
377
+
378
+ - **Enhanced Error Handling**: More informative error messages
379
+ - Detailed FFmpeg installation instructions in error messages
380
+ - OS-specific installation guides (Windows, macOS, Linux)
381
+ - Clear error messages when frame extraction fails
382
+ - Validation for empty buffers and invalid dimensions
383
+
384
+ - **Improved Frame Loading**: Better compatibility with `loadImage`
385
+ - Fallback to file-based loading if buffer loading fails
386
+ - Automatic cleanup of temporary files
387
+ - Better handling of different pixel formats
388
+
127
389
 
128
390
  ### 🐛 Fixed
129
391
 
@@ -145,43 +407,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
145
407
  - Force PNG format for `videoBg` to ensure compatibility with `loadImage`
146
408
  - Proper pixel format handling for color accuracy
147
409
 
148
- ### ✨ Added
149
-
150
- ##### New Video Methods
151
- - **`createVideo()`**: New method to create canvas with video frame as background
152
- - Extract frames at specific time or frame number
153
- - Custom canvas dimensions or auto-use video dimensions
154
- - Returns `CanvasResults` compatible with other ApexPainter methods
155
-
156
- - **`extractFrameByNumber()`**: Extract frames by frame number (1-based)
157
- - Automatically converts frame number to time using video FPS
158
- - More intuitive API for frame-based extraction
159
- - Handles FPS detection and conversion automatically
160
-
161
- - **`extractAllFrames()`**: Extract ALL frames from a video
162
- - Extracts every frame from video as PNG/JPEG files
163
- - Configurable output directory and file naming
164
- - Optional time range (startTime/endTime) for partial extraction
165
- - Returns array of frame file paths with metadata
166
-
167
- ### 🔧 Improved
168
-
169
- ##### Video Processing Enhancements
170
- - **Better Path Resolution**: Relative video paths are now properly resolved
171
- - Automatically resolves paths relative to `process.cwd()`
172
- - Consistent with how `customBg` handles image paths
173
- - Better error messages when video files are not found
174
-
175
- - **Enhanced Error Handling**: More informative error messages
176
- - Detailed FFmpeg installation instructions in error messages
177
- - OS-specific installation guides (Windows, macOS, Linux)
178
- - Clear error messages when frame extraction fails
179
- - Validation for empty buffers and invalid dimensions
180
-
181
- - **Improved Frame Loading**: Better compatibility with `loadImage`
182
- - Fallback to file-based loading if buffer loading fails
183
- - Automatic cleanup of temporary files
184
- - Better handling of different pixel formats
185
410
 
186
411
  ---
187
412