maidr 1.6.1__tar.gz → 1.7.0__tar.gz

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 (162) hide show
  1. {maidr-1.6.1 → maidr-1.7.0}/CHANGELOG.md +8 -0
  2. {maidr-1.6.1 → maidr-1.7.0}/PKG-INFO +1 -1
  3. maidr-1.7.0/example/candle_stick/test_data_daily_current_year.csv +11 -0
  4. maidr-1.7.0/example/candle_stick/test_data_daily_mixed_years.csv +11 -0
  5. maidr-1.7.0/example/candle_stick/test_data_hourly.csv +11 -0
  6. maidr-1.7.0/example/candle_stick/test_data_minute.csv +11 -0
  7. maidr-1.7.0/example/candle_stick/test_data_weekly.csv +11 -0
  8. {maidr-1.6.1 → maidr-1.7.0}/maidr/__init__.py +1 -1
  9. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/candlestick.py +58 -56
  10. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/mplfinance_barplot.py +18 -1
  11. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/mplfinance_lineplot.py +11 -3
  12. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/mplfinance.py +32 -2
  13. maidr-1.7.0/maidr/util/datetime_conversion.py +406 -0
  14. {maidr-1.6.1 → maidr-1.7.0}/pyproject.toml +1 -1
  15. {maidr-1.6.1 → maidr-1.7.0}/uv.lock +1 -1
  16. {maidr-1.6.1 → maidr-1.7.0}/.commitlintrc.cjs +0 -0
  17. {maidr-1.6.1 → maidr-1.7.0}/.editorconfig +0 -0
  18. {maidr-1.6.1 → maidr-1.7.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  19. {maidr-1.6.1 → maidr-1.7.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  20. {maidr-1.6.1 → maidr-1.7.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  21. {maidr-1.6.1 → maidr-1.7.0}/.github/copilot-instructions.md +0 -0
  22. {maidr-1.6.1 → maidr-1.7.0}/.github/workflows/ci.yml +0 -0
  23. {maidr-1.6.1 → maidr-1.7.0}/.github/workflows/docs.yml +0 -0
  24. {maidr-1.6.1 → maidr-1.7.0}/.github/workflows/release.yml +0 -0
  25. {maidr-1.6.1 → maidr-1.7.0}/.gitignore +0 -0
  26. {maidr-1.6.1 → maidr-1.7.0}/.pre-commit-config.yaml +0 -0
  27. {maidr-1.6.1 → maidr-1.7.0}/.vscode/extensions.json +0 -0
  28. {maidr-1.6.1 → maidr-1.7.0}/.vscode/settings.json +0 -0
  29. {maidr-1.6.1 → maidr-1.7.0}/CONDUCT.md +0 -0
  30. {maidr-1.6.1 → maidr-1.7.0}/CONTRIBUTING.md +0 -0
  31. {maidr-1.6.1 → maidr-1.7.0}/LICENSE +0 -0
  32. {maidr-1.6.1 → maidr-1.7.0}/README.md +0 -0
  33. {maidr-1.6.1 → maidr-1.7.0}/docs/.gitignore +0 -0
  34. {maidr-1.6.1 → maidr-1.7.0}/docs/CNAME +0 -0
  35. {maidr-1.6.1 → maidr-1.7.0}/docs/_environment +0 -0
  36. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/machow/interlinks/.gitignore +0 -0
  37. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/machow/interlinks/_extension.yml +0 -0
  38. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/machow/interlinks/interlinks.lua +0 -0
  39. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/shafayetShafee/line-highlight/_extension.yml +0 -0
  40. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/shafayetShafee/line-highlight/line-highlight.lua +0 -0
  41. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/shafayetShafee/line-highlight/resources/css/line-highlight.css +0 -0
  42. {maidr-1.6.1 → maidr-1.7.0}/docs/_extensions/shafayetShafee/line-highlight/resources/js/line-highlight.js +0 -0
  43. {maidr-1.6.1 → maidr-1.7.0}/docs/_quarto.yml +0 -0
  44. {maidr-1.6.1 → maidr-1.7.0}/docs/examples.qmd +0 -0
  45. {maidr-1.6.1 → maidr-1.7.0}/docs/index.qmd +0 -0
  46. {maidr-1.6.1 → maidr-1.7.0}/docs/styles.css +0 -0
  47. {maidr-1.6.1 → maidr-1.7.0}/example/bar/example_bar_plot.ipynb +0 -0
  48. {maidr-1.6.1 → maidr-1.7.0}/example/bar/matplotlib/example_mpl_bar_plot.py +0 -0
  49. {maidr-1.6.1 → maidr-1.7.0}/example/bar/seaborn/example_sns_bar_plot.py +0 -0
  50. {maidr-1.6.1 → maidr-1.7.0}/example/box/example_box_plot.ipynb +0 -0
  51. {maidr-1.6.1 → maidr-1.7.0}/example/box/matplotlib/example_mpl_box.py +0 -0
  52. {maidr-1.6.1 → maidr-1.7.0}/example/box/seaborn/example_sns_box.py +0 -0
  53. {maidr-1.6.1 → maidr-1.7.0}/example/candle_stick/legacy_candlestick_example.py +0 -0
  54. {maidr-1.6.1 → maidr-1.7.0}/example/candle_stick/mplfinance_candlestick_example.py +0 -0
  55. {maidr-1.6.1 → maidr-1.7.0}/example/candle_stick/volcandat.csv +0 -0
  56. {maidr-1.6.1 → maidr-1.7.0}/example/count/example_count_plot.ipynb +0 -0
  57. {maidr-1.6.1 → maidr-1.7.0}/example/count/seaborn/example_sns_count_plot.py +0 -0
  58. {maidr-1.6.1 → maidr-1.7.0}/example/dodged/matplotlib/example_mpl_dodged.py +0 -0
  59. {maidr-1.6.1 → maidr-1.7.0}/example/dodged/seaborn/example_sns_dodged.py +0 -0
  60. {maidr-1.6.1 → maidr-1.7.0}/example/facet-subplots/matplotlib/example_mpl_facet_bar_plot.py +0 -0
  61. {maidr-1.6.1 → maidr-1.7.0}/example/facet-subplots/matplotlib/example_mpl_facet_combined_plot.py +0 -0
  62. {maidr-1.6.1 → maidr-1.7.0}/example/facet-subplots/seaborn/example_sns_facet_bar_plot.py +0 -0
  63. {maidr-1.6.1 → maidr-1.7.0}/example/facet-subplots/seaborn/example_sns_facet_combined_plot.py +0 -0
  64. {maidr-1.6.1 → maidr-1.7.0}/example/flask/test_flask_app.py +0 -0
  65. {maidr-1.6.1 → maidr-1.7.0}/example/heatmap/example_heatmap_plot.ipynb +0 -0
  66. {maidr-1.6.1 → maidr-1.7.0}/example/heatmap/matplotlib/example_mpl_heatmap.py +0 -0
  67. {maidr-1.6.1 → maidr-1.7.0}/example/heatmap/seaborn/example_sns_heatmap.py +0 -0
  68. {maidr-1.6.1 → maidr-1.7.0}/example/histogram/example_histogram_plot.ipynb +0 -0
  69. {maidr-1.6.1 → maidr-1.7.0}/example/histogram/matplotlib/example_mpl_hist.py +0 -0
  70. {maidr-1.6.1 → maidr-1.7.0}/example/histogram/matplotlib/histogram_with_kde_matplotlib.py +0 -0
  71. {maidr-1.6.1 → maidr-1.7.0}/example/histogram/seaborn/example_sns_hist.py +0 -0
  72. {maidr-1.6.1 → maidr-1.7.0}/example/histogram/seaborn/histogram_with_kde_seaborn.py +0 -0
  73. {maidr-1.6.1 → maidr-1.7.0}/example/kde/example_kde_plots.ipynb +0 -0
  74. {maidr-1.6.1 → maidr-1.7.0}/example/kde/matplotlib/multiple_kde_matplotlib.py +0 -0
  75. {maidr-1.6.1 → maidr-1.7.0}/example/kde/matplotlib/single_kde_matplotlib.py +0 -0
  76. {maidr-1.6.1 → maidr-1.7.0}/example/kde/seaborn/multiple_kde_seaborn.py +0 -0
  77. {maidr-1.6.1 → maidr-1.7.0}/example/kde/seaborn/single_kde_seaborn.py +0 -0
  78. {maidr-1.6.1 → maidr-1.7.0}/example/line/example_line_plot.ipynb +0 -0
  79. {maidr-1.6.1 → maidr-1.7.0}/example/line/matplotlib/example_mpl_line.py +0 -0
  80. {maidr-1.6.1 → maidr-1.7.0}/example/line/seaborn/example_sns_line.py +0 -0
  81. {maidr-1.6.1 → maidr-1.7.0}/example/multilayer/example_mpl_multilayer.py +0 -0
  82. {maidr-1.6.1 → maidr-1.7.0}/example/multilayer/example_multilayer_plot.ipynb +0 -0
  83. {maidr-1.6.1 → maidr-1.7.0}/example/multiline/example_multiline_plot.ipynb +0 -0
  84. {maidr-1.6.1 → maidr-1.7.0}/example/multiline/matplotlib/example_mpl_multiline.py +0 -0
  85. {maidr-1.6.1 → maidr-1.7.0}/example/multiline/seaborn/example_sns_multiline.py +0 -0
  86. {maidr-1.6.1 → maidr-1.7.0}/example/multipanel/example_multipanel_plot.ipynb +0 -0
  87. {maidr-1.6.1 → maidr-1.7.0}/example/multipanel/matplotlib/example_mpl_multipanel.py +0 -0
  88. {maidr-1.6.1 → maidr-1.7.0}/example/multipanel/seaborn/example_sns_multipanel.py +0 -0
  89. {maidr-1.6.1 → maidr-1.7.0}/example/quarto/demo.qmd +0 -0
  90. {maidr-1.6.1 → maidr-1.7.0}/example/reg/example_reg_plots.ipynb +0 -0
  91. {maidr-1.6.1 → maidr-1.7.0}/example/reg/matplotlib/example_matplotlib_smooth_plot.py +0 -0
  92. {maidr-1.6.1 → maidr-1.7.0}/example/reg/seaborn/example_sns_reg.py +0 -0
  93. {maidr-1.6.1 → maidr-1.7.0}/example/scatter/example_scatter_plot.ipynb +0 -0
  94. {maidr-1.6.1 → maidr-1.7.0}/example/scatter/matplotlib/example_mpl_scatter.py +0 -0
  95. {maidr-1.6.1 → maidr-1.7.0}/example/scatter/seaborn/example_sns_scatter.py +0 -0
  96. {maidr-1.6.1 → maidr-1.7.0}/example/shiny/example_shiny_scatter.py +0 -0
  97. {maidr-1.6.1 → maidr-1.7.0}/example/stacked/matplotlib/example_mpl_stacked.html +0 -0
  98. {maidr-1.6.1 → maidr-1.7.0}/example/stacked/matplotlib/example_mpl_stacked.py +0 -0
  99. {maidr-1.6.1 → maidr-1.7.0}/example/stacked/seaborn/example_sns_stacked.html +0 -0
  100. {maidr-1.6.1 → maidr-1.7.0}/example/stacked/seaborn/example_sns_stacked.py +0 -0
  101. {maidr-1.6.1 → maidr-1.7.0}/example/streamlit/example_streamlit_app.py +0 -0
  102. {maidr-1.6.1 → maidr-1.7.0}/maidr/api.py +0 -0
  103. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/__init__.py +0 -0
  104. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/context_manager.py +0 -0
  105. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/enum/__init__.py +0 -0
  106. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/enum/library.py +0 -0
  107. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/enum/maidr_key.py +0 -0
  108. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/enum/plot_type.py +0 -0
  109. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/enum/smooth_keywords.py +0 -0
  110. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/figure_manager.py +0 -0
  111. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/maidr.py +0 -0
  112. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/__init__.py +0 -0
  113. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/barplot.py +0 -0
  114. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/boxplot.py +0 -0
  115. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/grouped_barplot.py +0 -0
  116. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/heatmap.py +0 -0
  117. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/histogram.py +0 -0
  118. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/lineplot.py +0 -0
  119. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/maidr_plot.py +0 -0
  120. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/maidr_plot_factory.py +0 -0
  121. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/regplot.py +0 -0
  122. {maidr-1.6.1 → maidr-1.7.0}/maidr/core/plot/scatterplot.py +0 -0
  123. {maidr-1.6.1 → maidr-1.7.0}/maidr/exception/__init__.py +0 -0
  124. {maidr-1.6.1 → maidr-1.7.0}/maidr/exception/extraction_error.py +0 -0
  125. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/__init__.py +0 -0
  126. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/barplot.py +0 -0
  127. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/boxplot.py +0 -0
  128. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/candlestick.py +0 -0
  129. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/clear.py +0 -0
  130. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/common.py +0 -0
  131. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/heatmap.py +0 -0
  132. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/highlight.py +0 -0
  133. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/histogram.py +0 -0
  134. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/kdeplot.py +0 -0
  135. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/lineplot.py +0 -0
  136. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/regplot.py +0 -0
  137. {maidr-1.6.1 → maidr-1.7.0}/maidr/patch/scatterplot.py +0 -0
  138. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/__init__.py +0 -0
  139. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/dedup_utils.py +0 -0
  140. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/environment.py +0 -0
  141. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/mixin/__init__.py +0 -0
  142. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/mixin/extractor_mixin.py +0 -0
  143. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/mixin/merger_mixin.py +0 -0
  144. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/mplfinance_utils.py +0 -0
  145. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/plot_detection.py +0 -0
  146. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/regression_line_utils.py +0 -0
  147. {maidr-1.6.1 → maidr-1.7.0}/maidr/util/svg_utils.py +0 -0
  148. {maidr-1.6.1 → maidr-1.7.0}/maidr/widget/__init__.py +0 -0
  149. {maidr-1.6.1 → maidr-1.7.0}/maidr/widget/shiny.py +0 -0
  150. {maidr-1.6.1 → maidr-1.7.0}/tests/__init__.py +0 -0
  151. {maidr-1.6.1 → maidr-1.7.0}/tests/conftest.py +0 -0
  152. {maidr-1.6.1 → maidr-1.7.0}/tests/core/__init__.py +0 -0
  153. {maidr-1.6.1 → maidr-1.7.0}/tests/core/enum/__init__.py +0 -0
  154. {maidr-1.6.1 → maidr-1.7.0}/tests/core/plot/__init__.py +0 -0
  155. {maidr-1.6.1 → maidr-1.7.0}/tests/core/test_figure_manager.py +0 -0
  156. {maidr-1.6.1 → maidr-1.7.0}/tests/core/test_maidr_plot.py +0 -0
  157. {maidr-1.6.1 → maidr-1.7.0}/tests/core/test_maidr_plot_factory.py +0 -0
  158. {maidr-1.6.1 → maidr-1.7.0}/tests/fixture/__init__.py +0 -0
  159. {maidr-1.6.1 → maidr-1.7.0}/tests/fixture/library_factory.py +0 -0
  160. {maidr-1.6.1 → maidr-1.7.0}/tests/fixture/matplotlib_factory.py +0 -0
  161. {maidr-1.6.1 → maidr-1.7.0}/tests/fixture/seaborn_factory.py +0 -0
  162. {maidr-1.6.1 → maidr-1.7.0}/tox.ini +0 -0
@@ -1,6 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v1.7.0 (2025-08-21)
5
+
6
+ ### Features
7
+
8
+ - Format date in candlestick ([#234](https://github.com/xability/py-maidr/pull/234),
9
+ [`ffe03f7`](https://github.com/xability/py-maidr/commit/ffe03f7a2368ef33a4266692e7b652daafa14a30))
10
+
11
+
4
12
  ## v1.6.1 (2025-08-13)
5
13
 
6
14
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maidr
3
- Version: 1.6.1
3
+ Version: 1.7.0
4
4
  Summary: Multimodal Access and Interactive Data Representations
5
5
  Project-URL: Homepage, https://xability.github.io/py-maidr
6
6
  Project-URL: Repository, https://github.com/xability/py-maidr
@@ -0,0 +1,11 @@
1
+ Date,Open,High,Low,Close,Volume
2
+ 2024-01-15,3050.72,3066.95,3050.72,3066.91,510301237
3
+ 2024-01-16,3078.96,3085.20,3074.87,3078.27,524848878
4
+ 2024-01-17,3080.80,3083.95,3072.15,3074.62,585634570
5
+ 2024-01-18,3075.10,3078.34,3065.89,3076.78,544288522
6
+ 2024-01-19,3087.02,3097.77,3080.23,3085.18,566117910
7
+ 2024-01-22,3081.25,3093.09,3073.58,3093.08,460757054
8
+ 2024-01-23,3080.33,3088.33,3075.82,3087.01,366044400
9
+ 2024-01-24,3089.28,3102.61,3084.73,3091.84,434953689
10
+ 2024-01-25,3084.18,3098.06,3078.80,3094.04,454607412
11
+ 2024-01-26,3090.75,3098.20,3083.26,3096.63,408390424
@@ -0,0 +1,11 @@
1
+ Date,Open,High,Low,Close,Volume
2
+ 2023-12-15,3050.72,3066.95,3050.72,3066.91,510301237
3
+ 2023-12-18,3078.96,3085.20,3074.87,3078.27,524848878
4
+ 2023-12-19,3080.80,3083.95,3072.15,3074.62,585634570
5
+ 2023-12-20,3075.10,3078.34,3065.89,3076.78,544288522
6
+ 2023-12-21,3087.02,3097.77,3080.23,3085.18,566117910
7
+ 2023-12-22,3081.25,3093.09,3073.58,3093.08,460757054
8
+ 2024-01-02,3080.33,3088.33,3075.82,3087.01,366044400
9
+ 2024-01-03,3089.28,3102.61,3084.73,3091.84,434953689
10
+ 2024-01-04,3084.18,3098.06,3078.80,3094.04,454607412
11
+ 2024-01-05,3090.75,3098.20,3083.26,3096.63,408390424
@@ -0,0 +1,11 @@
1
+ Date,Open,High,Low,Close,Volume
2
+ 2024-01-15 09:00:00,3050.72,3066.95,3050.72,3066.91,510301237
3
+ 2024-01-15 10:00:00,3078.96,3085.20,3074.87,3078.27,524848878
4
+ 2024-01-15 11:00:00,3080.80,3083.95,3072.15,3074.62,585634570
5
+ 2024-01-15 12:00:00,3075.10,3078.34,3065.89,3076.78,544288522
6
+ 2024-01-15 13:00:00,3087.02,3097.77,3080.23,3085.18,566117910
7
+ 2024-01-15 14:00:00,3081.25,3093.09,3073.58,3093.08,460757054
8
+ 2024-01-15 15:00:00,3080.33,3088.33,3075.82,3087.01,366044400
9
+ 2024-01-15 16:00:00,3089.28,3102.61,3084.73,3091.84,434953689
10
+ 2024-01-16 09:00:00,3084.18,3098.06,3078.80,3094.04,454607412
11
+ 2024-01-16 10:00:00,3090.75,3098.20,3083.26,3096.63,408390424
@@ -0,0 +1,11 @@
1
+ Date,Open,High,Low,Close,Volume
2
+ 2024-01-15 09:30:00,3050.72,3066.95,3050.72,3066.91,510301237
3
+ 2024-01-15 09:31:00,3078.96,3085.20,3074.87,3078.27,524848878
4
+ 2024-01-15 09:32:00,3080.80,3083.95,3072.15,3074.62,585634570
5
+ 2024-01-15 09:33:00,3075.10,3078.34,3065.89,3076.78,544288522
6
+ 2024-01-15 09:34:00,3087.02,3097.77,3080.23,3085.18,566117910
7
+ 2024-01-15 09:35:00,3081.25,3093.09,3073.58,3093.08,460757054
8
+ 2024-01-15 09:36:00,3080.33,3088.33,3075.82,3087.01,366044400
9
+ 2024-01-15 09:37:00,3089.28,3102.61,3084.73,3091.84,434953689
10
+ 2024-01-15 09:38:00,3084.18,3098.06,3078.80,3094.04,454607412
11
+ 2024-01-15 09:39:00,3090.75,3098.20,3083.26,3096.63,408390424
@@ -0,0 +1,11 @@
1
+ Date,Open,High,Low,Close,Volume
2
+ 2024-01-01,3050.72,3066.95,3050.72,3066.91,510301237
3
+ 2024-01-08,3078.96,3085.20,3074.87,3078.27,524848878
4
+ 2024-01-15,3080.80,3083.95,3072.15,3074.62,585634570
5
+ 2024-01-22,3075.10,3078.34,3065.89,3076.78,544288522
6
+ 2024-01-29,3087.02,3097.77,3080.23,3085.18,566117910
7
+ 2024-02-05,3081.25,3093.09,3073.58,3093.08,460757054
8
+ 2024-02-12,3080.33,3088.33,3075.82,3087.01,366044400
9
+ 2024-02-19,3089.28,3102.61,3084.73,3091.84,434953689
10
+ 2024-02-26,3084.18,3098.06,3078.80,3094.04,454607412
11
+ 2024-03-04,3090.75,3098.20,3083.26,3096.63,408390424
@@ -1,4 +1,4 @@
1
- __version__ = "1.6.1"
1
+ __version__ = "1.7.0"
2
2
 
3
3
  from .api import close, render, save_html, show, stacked
4
4
  from .core import Maidr
@@ -44,6 +44,7 @@ class CandlestickPlot(MaidrPlot):
44
44
  self._maidr_body_collection = kwargs.get("_maidr_body_collection", None)
45
45
  self._maidr_date_nums = kwargs.get("_maidr_date_nums", None)
46
46
  self._maidr_original_data = kwargs.get("_maidr_original_data", None) # Store original data
47
+ self._maidr_datetime_converter = kwargs.get("_maidr_datetime_converter", None)
47
48
 
48
49
  # Store the GID for proper selector generation (legacy/shared)
49
50
  self._maidr_gid = None
@@ -91,63 +92,64 @@ class CandlestickPlot(MaidrPlot):
91
92
  # Use the original collections for highlighting
92
93
  self._elements = [body_collection, wick_collection]
93
94
 
94
- # Use the utility class to extract data
95
- data = MplfinanceDataExtractor.extract_candlestick_data(
96
- body_collection, wick_collection, self._maidr_date_nums, self._maidr_original_data
97
- )
98
- return data
99
-
100
- # Fallback to original detection method
101
- if not self.axes:
102
- return []
103
-
104
- ax_ohlc = self.axes[0]
105
-
106
- # Look for Rectangle patches (original_flavor candlestick)
107
- body_rectangles = []
108
- for patch in ax_ohlc.patches:
109
- if isinstance(patch, Rectangle):
110
- body_rectangles.append(patch)
111
-
112
- if body_rectangles:
113
- # Set elements for highlighting
114
- self._elements = body_rectangles
115
-
116
- # Generate a GID for highlighting if none exists
117
- if not self._maidr_gid:
118
- self._maidr_gid = f"maidr-{uuid.uuid4()}"
119
- # Set GID on all rectangles
120
- for rect in body_rectangles:
121
- rect.set_gid(self._maidr_gid)
122
- # Keep a dedicated body gid for legacy dict selectors
123
- self._maidr_body_gid = getattr(self, "_maidr_body_gid", None) or self._maidr_gid
124
-
125
- # Assign a shared gid to wick Line2D (vertical 2-point lines) on the same axis
126
- wick_lines = []
127
- for line in ax_ohlc.get_lines():
128
- try:
129
- xydata = line.get_xydata()
130
- if xydata is None:
95
+ # Use datetime converter for enhanced data extraction
96
+ if self._maidr_datetime_converter is not None:
97
+ data = self._maidr_datetime_converter.extract_candlestick_data(
98
+ self.axes[0], wick_collection, body_collection
99
+ )
100
+ return data
101
+
102
+ # Fallback to original detection method
103
+ if not self.axes:
104
+ return []
105
+
106
+ ax_ohlc = self.axes[0]
107
+
108
+ # Look for Rectangle patches (original_flavor candlestick)
109
+ body_rectangles = []
110
+ for patch in ax_ohlc.patches:
111
+ if isinstance(patch, Rectangle):
112
+ body_rectangles.append(patch)
113
+
114
+ if body_rectangles:
115
+ # Set elements for highlighting
116
+ self._elements = body_rectangles
117
+
118
+ # Generate a GID for highlighting if none exists
119
+ if not self._maidr_gid:
120
+ self._maidr_gid = f"maidr-{uuid.uuid4()}"
121
+ # Set GID on all rectangles
122
+ for rect in body_rectangles:
123
+ rect.set_gid(self._maidr_gid)
124
+ # Keep a dedicated body gid for legacy dict selectors
125
+ self._maidr_body_gid = getattr(self, "_maidr_body_gid", None) or self._maidr_gid
126
+
127
+ # Assign a shared gid to wick Line2D (vertical 2-point lines) on the same axis
128
+ wick_lines = []
129
+ for line in ax_ohlc.get_lines():
130
+ try:
131
+ xydata = line.get_xydata()
132
+ if xydata is None:
133
+ continue
134
+ xy_arr = np.asarray(xydata)
135
+ if xy_arr.ndim == 2 and xy_arr.shape[0] == 2 and xy_arr.shape[1] >= 2:
136
+ x0 = float(xy_arr[0, 0])
137
+ x1 = float(xy_arr[1, 0])
138
+ if abs(x0 - x1) < 1e-10:
139
+ wick_lines.append(line)
140
+ except Exception:
131
141
  continue
132
- xy_arr = np.asarray(xydata)
133
- if xy_arr.ndim == 2 and xy_arr.shape[0] == 2 and xy_arr.shape[1] >= 2:
134
- x0 = float(xy_arr[0, 0])
135
- x1 = float(xy_arr[1, 0])
136
- if abs(x0 - x1) < 1e-10:
137
- wick_lines.append(line)
138
- except Exception:
139
- continue
140
- if wick_lines:
141
- if not getattr(self, "_maidr_wick_gid", None):
142
- self._maidr_wick_gid = f"maidr-{uuid.uuid4()}"
143
- for line in wick_lines:
144
- line.set_gid(self._maidr_wick_gid)
145
-
146
- # Use the utility class to extract data
147
- data = MplfinanceDataExtractor.extract_rectangle_candlestick_data(
148
- body_rectangles, self._maidr_date_nums, self._maidr_original_data
149
- )
150
- return data
142
+ if wick_lines:
143
+ if not getattr(self, "_maidr_wick_gid", None):
144
+ self._maidr_wick_gid = f"maidr-{uuid.uuid4()}"
145
+ for line in wick_lines:
146
+ line.set_gid(self._maidr_wick_gid)
147
+
148
+ # Use the utility class to extract data
149
+ data = MplfinanceDataExtractor.extract_rectangle_candlestick_data(
150
+ body_rectangles, self._maidr_date_nums, self._maidr_original_data
151
+ )
152
+ return data
151
153
 
152
154
  return []
153
155
 
@@ -31,6 +31,10 @@ class MplfinanceBarPlot(
31
31
  self._custom_patches = kwargs.get("_maidr_patches", None)
32
32
  # Store date numbers for volume bars (from mplfinance)
33
33
  self._maidr_date_nums = kwargs.get("_maidr_date_nums", None)
34
+
35
+ # Store datetime converter if available
36
+ self._maidr_datetime_converter = kwargs.get("_maidr_datetime_converter", None)
37
+
34
38
  # Store custom title
35
39
 
36
40
  def set_title(self, title: str) -> None:
@@ -48,6 +52,13 @@ class MplfinanceBarPlot(
48
52
  )
49
53
  data = self._extract_bar_container_data(plot)
50
54
  levels = self.extract_level(self.ax)
55
+
56
+ # Ensure we have valid data and levels before processing
57
+ if data is None or levels is None:
58
+ if data is None:
59
+ raise ExtractionError(self.type, plot)
60
+ return []
61
+
51
62
  formatted_data = []
52
63
  combined_data = list(
53
64
  zip(levels, data)
@@ -78,7 +89,13 @@ class MplfinanceBarPlot(
78
89
  # Set elements for highlighting (use the patches directly)
79
90
  self._elements = sorted_patches
80
91
 
81
- # Use the utility class to extract data
92
+ # Use datetime converter for enhanced data extraction
93
+ if self._maidr_datetime_converter is not None:
94
+ data = self._maidr_datetime_converter.extract_volume_data(self.ax)
95
+ if data: # Only use if successful
96
+ return [{"x": item[0], "y": item[1]} for item in data]
97
+
98
+ # Fallback to existing logic
82
99
  return MplfinanceDataExtractor.extract_volume_data(
83
100
  sorted_patches, self._maidr_date_nums
84
101
  )
@@ -23,6 +23,9 @@ class MplfinanceLinePlot(MaidrPlot, LineExtractorMixin):
23
23
  def __init__(self, ax: Axes, **kwargs):
24
24
  super().__init__(ax, PlotType.LINE)
25
25
 
26
+ # Store datetime converter if available
27
+ self._maidr_datetime_converter = kwargs.get("_maidr_datetime_converter", None)
28
+
26
29
  def _get_selector(self) -> Union[str, List[str]]:
27
30
  """Return selectors for all lines that have data."""
28
31
  all_lines = self.ax.get_lines()
@@ -101,10 +104,15 @@ class MplfinanceLinePlot(MaidrPlot, LineExtractorMixin):
101
104
  if np.isnan(x) or np.isnan(y) or np.isinf(x) or np.isinf(y):
102
105
  continue
103
106
 
104
- # Handle x-value conversion - could be string (date) or numeric
105
- if isinstance(x, str):
106
- x_value = x # Keep string as-is (for dates)
107
+ # Use datetime converter for enhanced data extraction
108
+ datetime_converter = getattr(line, "_maidr_datetime_converter", None) or self._maidr_datetime_converter
109
+ if datetime_converter is not None:
110
+ # Convert x-coordinate (matplotlib index) to formatted datetime
111
+ x_value = datetime_converter.get_formatted_datetime(int(round(x)))
112
+ if x_value is None:
113
+ x_value = float(x) # Fallback to numeric
107
114
  else:
115
+ # Fallback to existing logic
108
116
  # Check if we have date numbers from mplfinance
109
117
  if date_nums is not None and i < len(date_nums):
110
118
  # Use the date number to convert to date string
@@ -8,6 +8,7 @@ from matplotlib.lines import Line2D
8
8
  from maidr.core.enum import PlotType
9
9
  from maidr.patch.common import common
10
10
  from maidr.core.context_manager import ContextManager
11
+ from maidr.util.datetime_conversion import create_datetime_converter
11
12
 
12
13
 
13
14
  def mplfinance_plot_patch(wrapped, instance, args, kwargs):
@@ -53,26 +54,37 @@ def mplfinance_plot_patch(wrapped, instance, args, kwargs):
53
54
  elif volume_ax is None and "volume" in ax.get_ylabel().lower():
54
55
  volume_ax = ax
55
56
 
56
- # Try to extract date numbers from the data
57
+ # Try to extract date numbers from the data (existing logic preserved)
57
58
  date_nums = None
58
59
  data = None
60
+ datetime_converter = None
61
+
59
62
  if len(args) > 0:
60
63
  data = args[0]
61
64
  elif "data" in kwargs:
62
65
  data = kwargs["data"]
63
66
 
64
67
  if data is not None:
68
+ # Existing date_nums logic (preserved)
65
69
  if hasattr(data, "Date_num"):
66
70
  date_nums = list(data["Date_num"])
67
71
  elif hasattr(data, "index"):
68
72
  # fallback: use index if it's a DatetimeIndex
69
73
  try:
70
74
  import matplotlib.dates as mdates
71
-
72
75
  date_nums = [mdates.date2num(d) for d in data.index]
73
76
  except Exception:
74
77
  pass
75
78
 
79
+ # Create datetime converter for DatetimeIndex data
80
+ if hasattr(data, "index") and hasattr(data.index, "dtype"):
81
+ if "datetime" in str(data.index.dtype).lower():
82
+ datetime_converter = create_datetime_converter(data)
83
+
84
+ # Use enhanced converter's date_nums for mplfinance compatibility
85
+ if date_nums is None and hasattr(datetime_converter, 'date_nums'):
86
+ date_nums = datetime_converter.date_nums
87
+
76
88
  # Process and register the Candlestick plot
77
89
  if price_ax:
78
90
  wick_collection = next(
@@ -97,6 +109,10 @@ def mplfinance_plot_patch(wrapped, instance, args, kwargs):
97
109
  _maidr_wick_gid=wick_gid,
98
110
  _maidr_body_gid=body_gid,
99
111
  )
112
+
113
+ # Add datetime converter
114
+ if datetime_converter is not None:
115
+ candlestick_kwargs["_maidr_datetime_converter"] = datetime_converter
100
116
  common(
101
117
  PlotType.CANDLESTICK,
102
118
  lambda *a, **k: price_ax,
@@ -129,6 +145,11 @@ def mplfinance_plot_patch(wrapped, instance, args, kwargs):
129
145
  _maidr_patches=volume_patches,
130
146
  _maidr_date_nums=date_nums,
131
147
  )
148
+
149
+ # Add datetime converter
150
+ if datetime_converter is not None:
151
+ bar_kwargs["_maidr_datetime_converter"] = datetime_converter # type: ignore
152
+
132
153
  common(PlotType.BAR, lambda *a, **k: volume_ax, instance, args, bar_kwargs)
133
154
 
134
155
  # Process and register Moving Averages as LINE plots
@@ -196,6 +217,10 @@ def mplfinance_plot_patch(wrapped, instance, args, kwargs):
196
217
  if date_nums is not None:
197
218
  setattr(line, "_maidr_date_nums", date_nums)
198
219
 
220
+ # Store datetime converter
221
+ if datetime_converter is not None:
222
+ setattr(line, "_maidr_datetime_converter", datetime_converter)
223
+
199
224
  # Ensure GID is set for highlighting
200
225
  if line.get_gid() is None:
201
226
  gid = f"maidr-{uuid.uuid4()}"
@@ -207,6 +232,11 @@ def mplfinance_plot_patch(wrapped, instance, args, kwargs):
207
232
  # Register all valid lines as a single LINE plot
208
233
  if valid_lines:
209
234
  line_kwargs = dict(kwargs)
235
+
236
+ # Add datetime converter
237
+ if datetime_converter is not None:
238
+ line_kwargs["_maidr_datetime_converter"] = datetime_converter
239
+
210
240
  common(PlotType.LINE, lambda *a, **k: price_ax, instance, args, line_kwargs)
211
241
 
212
242
  if not original_returnfig: