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.
- scitex/__version__.py +1 -1
- scitex/dev/plt/__init__.py +0 -0
- scitex/dev/plt/plot_mpl_axhline.py +0 -0
- scitex/dev/plt/plot_mpl_axhspan.py +0 -0
- scitex/dev/plt/plot_mpl_axvline.py +0 -0
- scitex/dev/plt/plot_mpl_axvspan.py +0 -0
- scitex/dev/plt/plot_mpl_bar.py +0 -0
- scitex/dev/plt/plot_mpl_barh.py +0 -0
- scitex/dev/plt/plot_mpl_boxplot.py +0 -0
- scitex/dev/plt/plot_mpl_contour.py +0 -0
- scitex/dev/plt/plot_mpl_contourf.py +0 -0
- scitex/dev/plt/plot_mpl_errorbar.py +0 -0
- scitex/dev/plt/plot_mpl_eventplot.py +0 -0
- scitex/dev/plt/plot_mpl_fill.py +0 -0
- scitex/dev/plt/plot_mpl_fill_between.py +0 -0
- scitex/dev/plt/plot_mpl_hexbin.py +0 -0
- scitex/dev/plt/plot_mpl_hist.py +0 -0
- scitex/dev/plt/plot_mpl_hist2d.py +0 -0
- scitex/dev/plt/plot_mpl_imshow.py +0 -0
- scitex/dev/plt/plot_mpl_pcolormesh.py +0 -0
- scitex/dev/plt/plot_mpl_pie.py +0 -0
- scitex/dev/plt/plot_mpl_plot.py +0 -0
- scitex/dev/plt/plot_mpl_quiver.py +0 -0
- scitex/dev/plt/plot_mpl_scatter.py +0 -0
- scitex/dev/plt/plot_mpl_stackplot.py +0 -0
- scitex/dev/plt/plot_mpl_stem.py +0 -0
- scitex/dev/plt/plot_mpl_step.py +0 -0
- scitex/dev/plt/plot_mpl_violinplot.py +0 -0
- scitex/dev/plt/plot_sns_barplot.py +0 -0
- scitex/dev/plt/plot_sns_boxplot.py +0 -0
- scitex/dev/plt/plot_sns_heatmap.py +0 -0
- scitex/dev/plt/plot_sns_histplot.py +0 -0
- scitex/dev/plt/plot_sns_kdeplot.py +0 -0
- scitex/dev/plt/plot_sns_lineplot.py +0 -0
- scitex/dev/plt/plot_sns_scatterplot.py +0 -0
- scitex/dev/plt/plot_sns_stripplot.py +0 -0
- scitex/dev/plt/plot_sns_swarmplot.py +0 -0
- scitex/dev/plt/plot_sns_violinplot.py +0 -0
- scitex/dev/plt/plot_stx_bar.py +0 -0
- scitex/dev/plt/plot_stx_barh.py +0 -0
- scitex/dev/plt/plot_stx_box.py +0 -0
- scitex/dev/plt/plot_stx_boxplot.py +0 -0
- scitex/dev/plt/plot_stx_conf_mat.py +0 -0
- scitex/dev/plt/plot_stx_contour.py +0 -0
- scitex/dev/plt/plot_stx_ecdf.py +0 -0
- scitex/dev/plt/plot_stx_errorbar.py +0 -0
- scitex/dev/plt/plot_stx_fill_between.py +0 -0
- scitex/dev/plt/plot_stx_fillv.py +0 -0
- scitex/dev/plt/plot_stx_heatmap.py +0 -0
- scitex/dev/plt/plot_stx_image.py +0 -0
- scitex/dev/plt/plot_stx_imshow.py +0 -0
- scitex/dev/plt/plot_stx_joyplot.py +0 -0
- scitex/dev/plt/plot_stx_kde.py +0 -0
- scitex/dev/plt/plot_stx_line.py +0 -0
- scitex/dev/plt/plot_stx_mean_ci.py +0 -0
- scitex/dev/plt/plot_stx_mean_std.py +0 -0
- scitex/dev/plt/plot_stx_median_iqr.py +0 -0
- scitex/dev/plt/plot_stx_raster.py +0 -0
- scitex/dev/plt/plot_stx_rectangle.py +0 -0
- scitex/dev/plt/plot_stx_scatter.py +0 -0
- scitex/dev/plt/plot_stx_shaded_line.py +0 -0
- scitex/dev/plt/plot_stx_violin.py +0 -0
- scitex/dev/plt/plot_stx_violinplot.py +0 -0
- scitex/diagram/README.md +197 -0
- scitex/diagram/__init__.py +48 -0
- scitex/diagram/_compile.py +312 -0
- scitex/diagram/_diagram.py +355 -0
- scitex/diagram/_presets.py +173 -0
- scitex/diagram/_schema.py +182 -0
- scitex/diagram/_split.py +278 -0
- scitex/fig/editor/__init__.py +5 -2
- scitex/fig/editor/_dearpygui_editor.py +1 -1
- scitex/fig/editor/_mpl_editor.py +1 -1
- scitex/fig/editor/_qt_editor.py +1 -1
- scitex/fig/editor/_tkinter_editor.py +1 -1
- scitex/fig/editor/edit/__init__.py +50 -0
- scitex/fig/editor/edit/backend_detector.py +109 -0
- scitex/fig/editor/edit/bundle_resolver.py +240 -0
- scitex/fig/editor/edit/editor_launcher.py +239 -0
- scitex/fig/editor/edit/manual_handler.py +53 -0
- scitex/fig/editor/edit/panel_loader.py +232 -0
- scitex/fig/editor/edit/path_resolver.py +67 -0
- scitex/fig/editor/flask_editor/_bbox.py +23 -0
- scitex/fig/editor/flask_editor/_core.py +908 -103
- scitex/fig/editor/flask_editor/_renderer.py +74 -0
- scitex/fig/editor/flask_editor/static/css/base/reset.css +41 -0
- scitex/fig/editor/flask_editor/static/css/base/typography.css +16 -0
- scitex/fig/editor/flask_editor/static/css/base/variables.css +85 -0
- scitex/fig/editor/flask_editor/static/css/components/buttons.css +217 -0
- scitex/fig/editor/flask_editor/static/css/components/context-menu.css +93 -0
- scitex/fig/editor/flask_editor/static/css/components/dropdown.css +57 -0
- scitex/fig/editor/flask_editor/static/css/components/forms.css +112 -0
- scitex/fig/editor/flask_editor/static/css/components/modal.css +59 -0
- scitex/fig/editor/flask_editor/static/css/components/sections.css +212 -0
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +176 -0
- scitex/fig/editor/flask_editor/static/css/features/element-inspector.css +190 -0
- scitex/fig/editor/flask_editor/static/css/features/loading.css +59 -0
- scitex/fig/editor/flask_editor/static/css/features/overlay.css +45 -0
- scitex/fig/editor/flask_editor/static/css/features/panel-grid.css +95 -0
- scitex/fig/editor/flask_editor/static/css/features/selection.css +101 -0
- scitex/fig/editor/flask_editor/static/css/features/statistics.css +138 -0
- scitex/fig/editor/flask_editor/static/css/index.css +31 -0
- scitex/fig/editor/flask_editor/static/css/layout/container.css +7 -0
- scitex/fig/editor/flask_editor/static/css/layout/controls.css +56 -0
- scitex/fig/editor/flask_editor/static/css/layout/preview.css +78 -0
- scitex/fig/editor/flask_editor/static/js/alignment/axis.js +314 -0
- scitex/fig/editor/flask_editor/static/js/alignment/basic.js +107 -0
- scitex/fig/editor/flask_editor/static/js/alignment/distribute.js +54 -0
- scitex/fig/editor/flask_editor/static/js/canvas/canvas.js +172 -0
- scitex/fig/editor/flask_editor/static/js/canvas/dragging.js +258 -0
- scitex/fig/editor/flask_editor/static/js/canvas/resize.js +48 -0
- scitex/fig/editor/flask_editor/static/js/canvas/selection.js +71 -0
- scitex/fig/editor/flask_editor/static/js/core/api.js +288 -0
- scitex/fig/editor/flask_editor/static/js/core/state.js +143 -0
- scitex/fig/editor/flask_editor/static/js/core/utils.js +245 -0
- scitex/fig/editor/flask_editor/static/js/dev/element-inspector.js +992 -0
- scitex/fig/editor/flask_editor/static/js/editor/bbox.js +339 -0
- scitex/fig/editor/flask_editor/static/js/editor/element-drag.js +286 -0
- scitex/fig/editor/flask_editor/static/js/editor/overlay.js +371 -0
- scitex/fig/editor/flask_editor/static/js/editor/preview.js +293 -0
- scitex/fig/editor/flask_editor/static/js/main.js +426 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/context-menu.js +152 -0
- scitex/fig/editor/flask_editor/static/js/shortcuts/keyboard.js +265 -0
- scitex/fig/editor/flask_editor/static/js/ui/controls.js +184 -0
- scitex/fig/editor/flask_editor/static/js/ui/download.js +57 -0
- scitex/fig/editor/flask_editor/static/js/ui/help.js +100 -0
- scitex/fig/editor/flask_editor/static/js/ui/theme.js +34 -0
- scitex/fig/editor/flask_editor/templates/__init__.py +95 -5
- scitex/fig/editor/flask_editor/templates/_html.py +27 -9
- scitex/fig/editor/flask_editor/templates/_scripts.py +1928 -131
- scitex/fig/editor/flask_editor/templates/_styles.py +363 -51
- scitex/fig/io/_bundle.py +97 -12
- scitex/io/__init__.py +12 -0
- scitex/io/_bundle.py +69 -10
- scitex/io/_zip_bundle.py +439 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_labels.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_metadata.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_AdjustmentMixin/_visual.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_base.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_scientific.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_statistical.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/_stx_aliases.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_RawMatplotlibMixin.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/__init__.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_base.py +0 -0
- scitex/plt/_subplots/_AxisWrapperMixins/_SeabornMixin/_wrappers.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_bar.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_barh.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_errorbar.py +0 -0
- scitex/plt/_subplots/_export_as_csv_formatters/_format_stx_scatter.py +0 -0
- scitex/plt/io/_layered_bundle.py +0 -0
- scitex/schema/_plot.py +0 -0
- {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/METADATA +1 -1
- {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/RECORD +78 -22
- scitex/fig/editor/_edit.py +0 -751
- {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/WHEEL +0 -0
- {scitex-2.7.3.dist-info → scitex-2.8.1.dist-info}/entry_points.txt +0 -0
- {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
|
-
|
|
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
|
-
<
|
|
26
|
-
<button class="btn btn-sm" onclick="prevPanel()" id="prev-panel-btn">« Prev</button>
|
|
27
|
-
<span id="panel-indicator">1 / 6</span>
|
|
28
|
-
<button class="btn btn-sm" onclick="nextPanel()" id="next-panel-btn">Next »</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
|
|
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>
|