scitex 2.7.3__py3-none-any.whl → 2.8.1__py3-none-any.whl

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 (160) hide show
  1. scitex/__version__.py +1 -1
  2. scitex/dev/plt/__init__.py +0 -0
  3. scitex/dev/plt/plot_mpl_axhline.py +0 -0
  4. scitex/dev/plt/plot_mpl_axhspan.py +0 -0
  5. scitex/dev/plt/plot_mpl_axvline.py +0 -0
  6. scitex/dev/plt/plot_mpl_axvspan.py +0 -0
  7. scitex/dev/plt/plot_mpl_bar.py +0 -0
  8. scitex/dev/plt/plot_mpl_barh.py +0 -0
  9. scitex/dev/plt/plot_mpl_boxplot.py +0 -0
  10. scitex/dev/plt/plot_mpl_contour.py +0 -0
  11. scitex/dev/plt/plot_mpl_contourf.py +0 -0
  12. scitex/dev/plt/plot_mpl_errorbar.py +0 -0
  13. scitex/dev/plt/plot_mpl_eventplot.py +0 -0
  14. scitex/dev/plt/plot_mpl_fill.py +0 -0
  15. scitex/dev/plt/plot_mpl_fill_between.py +0 -0
  16. scitex/dev/plt/plot_mpl_hexbin.py +0 -0
  17. scitex/dev/plt/plot_mpl_hist.py +0 -0
  18. scitex/dev/plt/plot_mpl_hist2d.py +0 -0
  19. scitex/dev/plt/plot_mpl_imshow.py +0 -0
  20. scitex/dev/plt/plot_mpl_pcolormesh.py +0 -0
  21. scitex/dev/plt/plot_mpl_pie.py +0 -0
  22. scitex/dev/plt/plot_mpl_plot.py +0 -0
  23. scitex/dev/plt/plot_mpl_quiver.py +0 -0
  24. scitex/dev/plt/plot_mpl_scatter.py +0 -0
  25. scitex/dev/plt/plot_mpl_stackplot.py +0 -0
  26. scitex/dev/plt/plot_mpl_stem.py +0 -0
  27. scitex/dev/plt/plot_mpl_step.py +0 -0
  28. scitex/dev/plt/plot_mpl_violinplot.py +0 -0
  29. scitex/dev/plt/plot_sns_barplot.py +0 -0
  30. scitex/dev/plt/plot_sns_boxplot.py +0 -0
  31. scitex/dev/plt/plot_sns_heatmap.py +0 -0
  32. scitex/dev/plt/plot_sns_histplot.py +0 -0
  33. scitex/dev/plt/plot_sns_kdeplot.py +0 -0
  34. scitex/dev/plt/plot_sns_lineplot.py +0 -0
  35. scitex/dev/plt/plot_sns_scatterplot.py +0 -0
  36. scitex/dev/plt/plot_sns_stripplot.py +0 -0
  37. scitex/dev/plt/plot_sns_swarmplot.py +0 -0
  38. scitex/dev/plt/plot_sns_violinplot.py +0 -0
  39. scitex/dev/plt/plot_stx_bar.py +0 -0
  40. scitex/dev/plt/plot_stx_barh.py +0 -0
  41. scitex/dev/plt/plot_stx_box.py +0 -0
  42. scitex/dev/plt/plot_stx_boxplot.py +0 -0
  43. scitex/dev/plt/plot_stx_conf_mat.py +0 -0
  44. scitex/dev/plt/plot_stx_contour.py +0 -0
  45. scitex/dev/plt/plot_stx_ecdf.py +0 -0
  46. scitex/dev/plt/plot_stx_errorbar.py +0 -0
  47. scitex/dev/plt/plot_stx_fill_between.py +0 -0
  48. scitex/dev/plt/plot_stx_fillv.py +0 -0
  49. scitex/dev/plt/plot_stx_heatmap.py +0 -0
  50. scitex/dev/plt/plot_stx_image.py +0 -0
  51. scitex/dev/plt/plot_stx_imshow.py +0 -0
  52. scitex/dev/plt/plot_stx_joyplot.py +0 -0
  53. scitex/dev/plt/plot_stx_kde.py +0 -0
  54. scitex/dev/plt/plot_stx_line.py +0 -0
  55. scitex/dev/plt/plot_stx_mean_ci.py +0 -0
  56. scitex/dev/plt/plot_stx_mean_std.py +0 -0
  57. scitex/dev/plt/plot_stx_median_iqr.py +0 -0
  58. scitex/dev/plt/plot_stx_raster.py +0 -0
  59. scitex/dev/plt/plot_stx_rectangle.py +0 -0
  60. scitex/dev/plt/plot_stx_scatter.py +0 -0
  61. scitex/dev/plt/plot_stx_shaded_line.py +0 -0
  62. scitex/dev/plt/plot_stx_violin.py +0 -0
  63. scitex/dev/plt/plot_stx_violinplot.py +0 -0
  64. scitex/diagram/README.md +197 -0
  65. scitex/diagram/__init__.py +48 -0
  66. scitex/diagram/_compile.py +312 -0
  67. scitex/diagram/_diagram.py +355 -0
  68. scitex/diagram/_presets.py +173 -0
  69. scitex/diagram/_schema.py +182 -0
  70. scitex/diagram/_split.py +278 -0
  71. scitex/fig/editor/__init__.py +5 -2
  72. scitex/fig/editor/_dearpygui_editor.py +1 -1
  73. scitex/fig/editor/_mpl_editor.py +1 -1
  74. scitex/fig/editor/_qt_editor.py +1 -1
  75. scitex/fig/editor/_tkinter_editor.py +1 -1
  76. scitex/fig/editor/edit/__init__.py +50 -0
  77. scitex/fig/editor/edit/backend_detector.py +109 -0
  78. scitex/fig/editor/edit/bundle_resolver.py +240 -0
  79. scitex/fig/editor/edit/editor_launcher.py +239 -0
  80. scitex/fig/editor/edit/manual_handler.py +53 -0
  81. scitex/fig/editor/edit/panel_loader.py +232 -0
  82. scitex/fig/editor/edit/path_resolver.py +67 -0
  83. scitex/fig/editor/flask_editor/_bbox.py +23 -0
  84. scitex/fig/editor/flask_editor/_core.py +908 -103
  85. scitex/fig/editor/flask_editor/_renderer.py +74 -0
  86. scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
  87. scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
  88. scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
  89. scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
  90. scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
  91. scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
  92. scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
  93. scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
  94. scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
  95. scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
  96. scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
  97. scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
  98. scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
  99. scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
  100. scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
  101. scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
  102. scitex/fig/editor/flask_editor/static/css/index.css +31 -0
  103. scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
  104. scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
  105. scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
  106. scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
  107. scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
  108. scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
  109. scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
  110. scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
  111. scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
  112. scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
  113. scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
  114. scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
  115. scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
  116. scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
  117. scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
  118. scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
  119. scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
  120. scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
  121. scitex/fig/editor/flask_editor/static/js/main.js +426 -0
  122. scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
  123. scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
  124. scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
  125. scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
  126. scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
  127. scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
  128. scitex/fig/editor/flask_editor/templates/__init__.py +95 -5
  129. scitex/fig/editor/flask_editor/templates/_html.py +27 -9
  130. scitex/fig/editor/flask_editor/templates/_scripts.py +1928 -131
  131. scitex/fig/editor/flask_editor/templates/_styles.py +363 -51
  132. scitex/fig/io/_bundle.py +97 -12
  133. scitex/io/__init__.py +12 -0
  134. scitex/io/_bundle.py +69 -10
  135. scitex/io/_zip_bundle.py +439 -0
  136. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +0 -0
  137. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +0 -0
  138. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +0 -0
  139. scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +0 -0
  140. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +0 -0
  141. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +0 -0
  142. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +0 -0
  143. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +0 -0
  144. scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +0 -0
  145. scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +0 -0
  146. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +0 -0
  147. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +0 -0
  148. scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +0 -0
  149. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +0 -0
  150. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +0 -0
  151. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +0 -0
  152. scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +0 -0
  153. scitex/plt/io/_layered_bundle.py +0 -0
  154. scitex/schema/_plot.py +0 -0
  155. {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/METADATA +1 -1
  156. {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/RECORD +78 -22
  157. scitex/fig/editor/_edit.py +0 -751
  158. {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/WHEEL +0 -0
  159. {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/entry_points.txt +0 -0
  160. {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/licenses/LICENSE +0 -0
@@ -1,15 +1,105 @@
1
1
  #!/usr/bin/env python3
2
2
  # -*- coding: utf-8 -*-
3
3
  # File: ./src/scitex/vis/editor/flask_editor/templates/__init__.py
4
- """Template components for Flask editor."""
4
+ """Template components for Flask editor.
5
+
6
+ Supports two modes:
7
+ - Static files mode (default): Uses external CSS/JS files from static/
8
+ - Inline mode (fallback): Embeds CSS/JS directly in HTML
9
+ """
5
10
 
6
- from ._styles import CSS_STYLES
7
- from ._scripts import JS_SCRIPTS
8
11
  from ._html import HTML_BODY
9
12
 
13
+ # Configuration flag - set to False to use inline mode for debugging
14
+ USE_STATIC_FILES = True
15
+
16
+
17
+ def build_html_template(use_static: bool = None) -> str:
18
+ """Build the complete HTML template from components.
19
+
20
+ Args:
21
+ use_static: Override static file usage. If None, uses USE_STATIC_FILES.
22
+
23
+ Returns:
24
+ Complete HTML template string.
25
+ """
26
+ if use_static is None:
27
+ use_static = USE_STATIC_FILES
28
+
29
+ if use_static:
30
+ return _build_static_template()
31
+ else:
32
+ return _build_inline_template()
33
+
34
+
35
+ def _build_static_template() -> str:
36
+ """Build template using external static CSS/JS files."""
37
+ # Get list of JS files in correct load order
38
+ js_files = [
39
+ # Dev tools (load first to capture console logs)
40
+ 'js/dev/element-inspector.js',
41
+ # Core modules first (dependencies)
42
+ 'js/core/state.js',
43
+ 'js/core/utils.js',
44
+ 'js/core/api.js',
45
+ # Editor modules
46
+ 'js/editor/bbox.js',
47
+ 'js/editor/overlay.js',
48
+ 'js/editor/preview.js',
49
+ 'js/editor/element-drag.js',
50
+ # Canvas modules
51
+ 'js/canvas/selection.js',
52
+ 'js/canvas/resize.js',
53
+ 'js/canvas/dragging.js',
54
+ 'js/canvas/canvas.js',
55
+ # Alignment modules
56
+ 'js/alignment/basic.js',
57
+ 'js/alignment/axis.js',
58
+ 'js/alignment/distribute.js',
59
+ # UI modules
60
+ 'js/ui/theme.js',
61
+ 'js/ui/help.js',
62
+ 'js/ui/download.js',
63
+ 'js/ui/controls.js',
64
+ # Shortcuts
65
+ 'js/shortcuts/context-menu.js',
66
+ 'js/shortcuts/keyboard.js',
67
+ # Main entry (last)
68
+ 'js/main.js',
69
+ ]
70
+
71
+ # Generate script tags
72
+ script_tags = '\n '.join([
73
+ f'<script src="{{{{ url_for(\'static\', filename=\'{f}\') }}}}"></script>'
74
+ for f in js_files
75
+ ])
76
+
77
+ return f"""<!DOCTYPE html>
78
+ <html lang="en" data-theme="dark">
79
+ <head>
80
+ <meta charset="UTF-8">
81
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
82
+ <title>SciTeX Figure Editor - {{{{ filename }}}}</title>
83
+ <link rel="stylesheet" href="{{{{ url_for('static', filename='css/index.css') }}}}">
84
+ </head>
85
+ <body>
86
+ {HTML_BODY}
87
+ <!-- Initial data injection (must be before module scripts) -->
88
+ <script>
89
+ // Flask injects overrides data here
90
+ var overrides = {{{{ overrides|safe }}}};
91
+ </script>
92
+ {script_tags}
93
+ </body>
94
+ </html>
95
+ """
96
+
97
+
98
+ def _build_inline_template() -> str:
99
+ """Build template with inline CSS/JS (fallback mode)."""
100
+ from ._styles import CSS_STYLES
101
+ from ._scripts import JS_SCRIPTS
10
102
 
11
- def build_html_template() -> str:
12
- """Build the complete HTML template from components."""
13
103
  return f"""<!DOCTYPE html>
14
104
  <html lang="en" data-theme="dark">
15
105
  <head>
@@ -5,13 +5,35 @@
5
5
 
6
6
  HTML_BODY = """
7
7
  <div class="container">
8
+ <!-- Global Loading Overlay (visible for both single and multi-panel views) -->
9
+ <div id="global-loading-overlay" class="global-loading-overlay" style="display: none;">
10
+ <div class="spinner"></div>
11
+ <span class="loading-text">Updating...</span>
12
+ </div>
8
13
  <div class="preview">
9
14
  <!-- Panel Grid View (for multi-panel figz bundles) -->
10
15
  <div class="panel-grid-section" id="panel-grid-section" style="display: none;">
11
16
  <div class="panel-grid-header">
12
- <h3>All Panels</h3>
13
17
  <div class="canvas-controls">
14
18
  <button class="btn btn-secondary btn-sm" id="panel-debug-btn" onclick="togglePanelDebugMode()">Show Hit Regions</button>
19
+ <div class="toolbar-separator"></div>
20
+ <div class="download-dropdown">
21
+ <button class="btn btn-primary btn-sm" onclick="toggleDownloadMenu()" id="download-btn">
22
+ ⬇ Download
23
+ </button>
24
+ <div id="download-menu" class="download-menu">
25
+ <a href="/download/png" class="download-item">PNG (300 DPI)</a>
26
+ <a href="/download/svg" class="download-item">SVG (Vector)</a>
27
+ <a href="/download/pdf" class="download-item">PDF</a>
28
+ <div class="download-divider"></div>
29
+ <a href="/download/jpeg" class="download-item">JPEG</a>
30
+ <a href="/download_figz" class="download-item">FIGZ Bundle</a>
31
+ </div>
32
+ </div>
33
+ <div class="toolbar-separator"></div>
34
+ <button class="btn btn-secondary btn-sm" onclick="showShortcutHelp()" title="Keyboard Shortcuts (? or F1)">
35
+ ⌨ Shortcuts
36
+ </button>
15
37
  </div>
16
38
  </div>
17
39
  <div class="panel-canvas" id="panel-canvas">
@@ -19,18 +41,14 @@ HTML_BODY = """
19
41
  </div>
20
42
  </div>
21
43
 
22
- <div class="preview-wrapper">
44
+ <!-- Single-panel preview (hidden for multi-panel figz bundles) -->
45
+ <div class="preview-wrapper" id="preview-wrapper">
23
46
  <div class="preview-header" id="preview-header" style="display: none;">
24
47
  <span id="current-panel-name">Panel A</span>
25
- <div class="panel-nav">
26
- <button class="btn btn-sm" onclick="prevPanel()" id="prev-panel-btn">&laquo; Prev</button>
27
- <span id="panel-indicator">1 / 6</span>
28
- <button class="btn btn-sm" onclick="nextPanel()" id="next-panel-btn">Next &raquo;</button>
29
- <button class="btn btn-secondary btn-sm" onclick="togglePanelGrid()" id="show-grid-btn">Show All</button>
30
- </div>
48
+ <span id="panel-indicator"></span>
31
49
  </div>
32
50
  <div class="preview-container" id="preview-container">
33
- <img id="preview-img" src="" alt="Figure Preview">
51
+ <img id="preview" src="" alt="Figure Preview">
34
52
  <svg id="hover-overlay" class="hover-overlay"></svg>
35
53
  <div id="loading-overlay" class="loading-overlay" style="display: none;">
36
54
  <div class="spinner"></div>