scitex 2.10.2__py3-none-any.whl → 2.11.0__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/__init__.py +1 -4
- scitex/__version__.py +1 -1
- scitex/_install_guide.py +14 -2
- scitex/bridge/_figrecipe.py +1 -1
- scitex/bridge/_helpers.py +1 -1
- scitex/bridge/_plt_vis.py +1 -1
- scitex/bridge/_stats_plt.py +1 -1
- scitex/bridge/_stats_vis.py +2 -2
- scitex/{fig → canvas}/__init__.py +84 -96
- scitex/{fig → canvas}/backend/_parser.py +1 -1
- scitex/{fig → canvas}/canvas.py +13 -14
- scitex/{fts/_fig/_editor → canvas/editor}/_defaults.py +2 -2
- scitex/{fig → canvas}/editor/edit/__init__.py +11 -14
- scitex/{fig → canvas}/editor/edit/bundle_resolver.py +56 -48
- scitex/{fig → canvas}/editor/edit/editor_launcher.py +79 -26
- scitex/{fts/_fig/_editor/_cui/_panel_loader.py → canvas/editor/edit/panel_loader.py} +8 -8
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_bbox.py +2 -1
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_core.py +84 -84
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/_renderer.py +7 -6
- scitex/{fts/_fig/_editor/_gui/_flask_editor → canvas/editor/flask_editor}/static/css/features/canvas.css +2 -2
- scitex/{fig → canvas}/editor/flask_editor/static/css/features/panel-grid.css +1 -1
- scitex/{fig → canvas}/editor/flask_editor/static/js/core/api.js +3 -4
- scitex/{fig → canvas}/editor/flask_editor/static/js/editor/preview.js +5 -5
- scitex/{fig → canvas}/editor/flask_editor/templates/_html.py +3 -3
- scitex/{fig → canvas}/editor/flask_editor/templates/_scripts.py +10 -10
- scitex/{fig → canvas}/editor/flask_editor/templates/_styles.py +3 -3
- scitex/{fig → canvas}/io/__init__.py +32 -38
- scitex/{fig → canvas}/io/_bundle.py +217 -154
- scitex/{fig → canvas}/io/_canvas.py +1 -1
- scitex/{fig → canvas}/io/_data.py +1 -1
- scitex/{fig → canvas}/io/_export.py +1 -1
- scitex/{fig → canvas}/io/_load.py +1 -1
- scitex/{fig → canvas}/io/_panel.py +1 -1
- scitex/{fig → canvas}/io/_save.py +1 -1
- scitex/{fig → canvas}/model/__init__.py +1 -1
- scitex/{fig → canvas}/model/_annotations.py +1 -1
- scitex/{fig → canvas}/model/_axes.py +1 -1
- scitex/{fig → canvas}/model/_figure.py +1 -1
- scitex/{fig → canvas}/model/_guides.py +1 -1
- scitex/{fig → canvas}/model/_plot.py +1 -1
- scitex/{fig → canvas}/model/_styles.py +1 -1
- scitex/{fig → canvas}/utils/__init__.py +1 -1
- scitex/cli/convert.py +10 -6
- scitex/diagram/README.md +7 -7
- scitex/io/__init__.py +7 -19
- scitex/io/_load.py +15 -19
- scitex/io/_load_modules/_canvas.py +2 -2
- scitex/io/_load_modules/_con.py +5 -5
- scitex/io/_load_modules/_eeg.py +16 -12
- scitex/io/_save.py +11 -16
- scitex/io/_save_modules/__init__.py +6 -10
- scitex/io/_save_modules/_canvas.py +3 -3
- scitex/io/_save_modules/_plot_bundle.py +112 -0
- scitex/io/_save_modules/{_pltz_stx.py → _plot_scitex.py} +7 -7
- scitex/io/_save_modules/_stx_bundle.py +16 -16
- scitex/io/bundle/README.md +89 -80
- scitex/{fts/_bundle/_FTS.py → io/bundle/_Bundle.py} +197 -95
- scitex/io/bundle/__init__.py +67 -35
- scitex/{fts/_bundle → io/bundle}/_children.py +32 -40
- scitex/io/bundle/_core.py +184 -97
- scitex/{fts/_bundle/_dataclasses/_Node.py → io/bundle/_dataclasses/_Spec.py} +29 -23
- scitex/{fts/_bundle/_dataclasses/_NodeRefs.py → io/bundle/_dataclasses/_SpecRefs.py} +6 -6
- scitex/{fts/_bundle → io/bundle}/_dataclasses/__init__.py +4 -4
- scitex/{fts/_bundle → io/bundle}/_loader.py +19 -19
- scitex/io/bundle/_manifest.py +99 -0
- scitex/{fts/_bundle → io/bundle}/_mpl_helpers.py +119 -28
- scitex/io/bundle/_nested.py +113 -100
- scitex/{fts/_bundle → io/bundle}/_saver.py +13 -14
- scitex/{fts/_bundle → io/bundle}/_storage.py +3 -3
- scitex/io/bundle/_types.py +41 -16
- scitex/{fts/_bundle → io/bundle}/_validation.py +20 -18
- scitex/io/bundle/_zip.py +21 -31
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_backend/_parser.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Annotations.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Axes.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Figure.py +1 -1
- scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Guides.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_models/_Plot.py +1 -1
- scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_Styles.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_plot/_utils/_plot_layout.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/__init__.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/_app.py +1 -1
- scitex/{fts/_tables → io/bundle/kinds/_table}/_latex/_export.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_figure_exporter.py +1 -1
- scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_table_exporter.py +1 -1
- scitex/io/bundle/schemas/__init__.py +30 -0
- scitex/parallel/_run.py +5 -4
- scitex/path/_find.py +60 -83
- scitex/path/_get_module_path.py +23 -21
- scitex/path/_get_spath.py +6 -27
- scitex/path/_getsize.py +23 -9
- scitex/path/_increment_version.py +31 -38
- scitex/path/_mk_spath.py +26 -29
- scitex/path/_path.py +5 -12
- scitex/path/_split.py +27 -15
- scitex/path/_this_path.py +23 -9
- scitex/plt/_subplots/_AxisWrapperMixins/_MatplotlibPlotMixin/__init__.py +2 -1
- scitex/plt/_subplots/_AxisWrapperMixins/__init__.py +2 -2
- scitex/plt/gallery/_generate.py +76 -50
- scitex/plt/io/__init__.py +17 -19
- scitex/plt/io/_bundle.py +99 -52
- scitex/plt/io/_layered_bundle.py +303 -168
- scitex/plt/utils/_csv_column_naming.py +250 -118
- scitex/schema/__init__.py +69 -73
- scitex/schema/_canvas.py +1 -1
- scitex/schema/_stats.py +2 -2
- scitex/stats/__init__.py +30 -33
- scitex/stats/_schema.py +1 -1
- scitex/stats/io/__init__.py +10 -11
- scitex/stats/io/_bundle.py +16 -16
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/METADATA +191 -72
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/RECORD +237 -360
- scitex/fig/editor/_defaults.py +0 -300
- scitex/fig/editor/edit/panel_loader.py +0 -232
- scitex/fig/editor/flask_editor/_bbox.py +0 -1299
- scitex/fig/editor/flask_editor/_core.py +0 -1429
- scitex/fig/editor/flask_editor/_renderer.py +0 -813
- scitex/fig/editor/flask_editor/static/css/features/canvas.css +0 -176
- scitex/fts/README.md +0 -262
- scitex/fts/TODO.md +0 -66
- scitex/fts/__init__.py +0 -90
- scitex/fts/_bundle/README_IN_BUNDLE.md +0 -102
- scitex/fts/_bundle/__init__.py +0 -38
- scitex/fts/_bundle/_utils/__init__.py +0 -55
- scitex/fts/_bundle/_utils/_const.py +0 -26
- scitex/fts/_bundle/_utils/_errors.py +0 -73
- scitex/fts/_bundle/_utils/_generate.py +0 -21
- scitex/fts/_bundle/_utils/_types.py +0 -76
- scitex/fts/_bundle/_zipbundle.py +0 -165
- scitex/fts/_fig/__init__.py +0 -22
- scitex/fts/_fig/_backend/_parser.py +0 -188
- scitex/fts/_fig/_editor/__init__.py +0 -14
- scitex/fts/_fig/_editor/_cui/__init__.py +0 -33
- scitex/fts/_fig/_editor/_cui/_backend_detector.py +0 -39
- scitex/fts/_fig/_editor/_cui/_bundle_resolver.py +0 -366
- scitex/fts/_fig/_editor/_cui/_editor_launcher.py +0 -175
- scitex/fts/_fig/_editor/_cui/_manual_handler.py +0 -52
- scitex/fts/_fig/_editor/_cui/_path_resolver.py +0 -66
- scitex/fts/_fig/_editor/_gui/__init__.py +0 -11
- scitex/fts/_fig/_editor/_gui/_flask_editor/__init__.py +0 -20
- scitex/fts/_fig/_editor/_gui/_flask_editor/_plotter.py +0 -664
- scitex/fts/_fig/_editor/_gui/_flask_editor/_utils.py +0 -79
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/reset.css +0 -41
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/typography.css +0 -16
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/base/variables.css +0 -85
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/buttons.css +0 -217
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/context-menu.css +0 -93
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/dropdown.css +0 -57
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/forms.css +0 -112
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/modal.css +0 -59
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/components/sections.css +0 -212
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/element-inspector.css +0 -190
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/loading.css +0 -59
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/overlay.css +0 -45
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/panel-grid.css +0 -95
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/selection.css +0 -101
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/features/statistics.css +0 -138
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/index.css +0 -31
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/container.css +0 -7
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/controls.css +0 -56
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/css/layout/preview.css +0 -78
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/axis.js +0 -314
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/basic.js +0 -107
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/alignment/distribute.js +0 -54
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/canvas.js +0 -172
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/dragging.js +0 -258
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/resize.js +0 -48
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/canvas/selection.js +0 -71
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/api.js +0 -288
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/state.js +0 -143
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/core/utils.js +0 -245
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/dev/element-inspector.js +0 -992
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/bbox.js +0 -339
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/element-drag.js +0 -286
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/overlay.js +0 -371
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/editor/preview.js +0 -293
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/main.js +0 -426
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/context-menu.js +0 -152
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/shortcuts/keyboard.js +0 -265
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/controls.js +0 -184
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/download.js +0 -57
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/help.js +0 -100
- scitex/fts/_fig/_editor/_gui/_flask_editor/static/js/ui/theme.js +0 -34
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/__init__.py +0 -124
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_html.py +0 -851
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_scripts.py +0 -4932
- scitex/fts/_fig/_editor/_gui/_flask_editor/templates/_styles.py +0 -1657
- scitex/fts/_fig/_editor/_gui/_flask_editor.py +0 -36
- scitex/fts/_fig/_models/_Annotations.py +0 -115
- scitex/fts/_fig/_models/_Axes.py +0 -152
- scitex/fts/_fig/_models/_Figure.py +0 -138
- scitex/fts/_fig/_models/_Plot.py +0 -123
- scitex/fts/_fig/_utils/_plot_layout.py +0 -397
- scitex/fts/_kinds/_figure/_composite.py +0 -345
- scitex/fts/_kinds/_plot/_backend/__init__.py +0 -53
- scitex/fts/_kinds/_plot/_backend/_export.py +0 -165
- scitex/fts/_kinds/_plot/_backend/_render.py +0 -538
- scitex/fts/_kinds/_plot/_dataclasses/_ChannelEncoding.py +0 -46
- scitex/fts/_kinds/_plot/_dataclasses/_Encoding.py +0 -82
- scitex/fts/_kinds/_plot/_dataclasses/_Theme.py +0 -441
- scitex/fts/_kinds/_plot/_dataclasses/_TraceEncoding.py +0 -52
- scitex/fts/_kinds/_plot/_dataclasses/__init__.py +0 -47
- scitex/fts/_kinds/_plot/_models/_Guides.py +0 -104
- scitex/fts/_kinds/_plot/_models/_Styles.py +0 -245
- scitex/fts/_kinds/_plot/_models/__init__.py +0 -80
- scitex/fts/_kinds/_plot/_models/_plot_types/__init__.py +0 -156
- scitex/fts/_kinds/_plot/_models/_plot_types/_bar.py +0 -43
- scitex/fts/_kinds/_plot/_models/_plot_types/_box.py +0 -38
- scitex/fts/_kinds/_plot/_models/_plot_types/_distribution.py +0 -36
- scitex/fts/_kinds/_plot/_models/_plot_types/_errorbar.py +0 -60
- scitex/fts/_kinds/_plot/_models/_plot_types/_histogram.py +0 -30
- scitex/fts/_kinds/_plot/_models/_plot_types/_image.py +0 -61
- scitex/fts/_kinds/_plot/_models/_plot_types/_line.py +0 -57
- scitex/fts/_kinds/_plot/_models/_plot_types/_scatter.py +0 -30
- scitex/fts/_kinds/_plot/_models/_plot_types/_seaborn.py +0 -121
- scitex/fts/_kinds/_plot/_models/_plot_types/_violin.py +0 -36
- scitex/fts/_kinds/_plot/_utils/__init__.py +0 -129
- scitex/fts/_kinds/_plot/_utils/_auto_layout.py +0 -127
- scitex/fts/_kinds/_plot/_utils/_calc_bounds.py +0 -111
- scitex/fts/_kinds/_plot/_utils/_const_sizes.py +0 -48
- scitex/fts/_kinds/_plot/_utils/_convert_coords.py +0 -77
- scitex/fts/_kinds/_plot/_utils/_get_template.py +0 -178
- scitex/fts/_kinds/_plot/_utils/_normalize.py +0 -73
- scitex/fts/_kinds/_plot/_utils/_validate.py +0 -197
- scitex/fts/_kinds/_table/_latex/_export.py +0 -279
- scitex/fts/_stats/__init__.py +0 -48
- scitex/fts/_stats/_dataclasses/_Stats.py +0 -423
- scitex/fts/_stats/_dataclasses/__init__.py +0 -48
- scitex/fts/_tables/__init__.py +0 -65
- scitex/fts/_tables/_latex/__init__.py +0 -93
- scitex/fts/_tables/_latex/_editor/__init__.py +0 -11
- scitex/fts/_tables/_latex/_editor/_app.py +0 -725
- scitex/fts/_tables/_latex/_figure_exporter.py +0 -153
- scitex/fts/_tables/_latex/_stats_formatter.py +0 -274
- scitex/fts/_tables/_latex/_table_exporter.py +0 -362
- scitex/fts/_tables/_latex/_utils.py +0 -369
- scitex/fts/_tables/_latex/_validator.py +0 -445
- scitex/io/_save_modules/_pltz_bundle.py +0 -356
- /scitex/{fig → canvas}/README.md +0 -0
- /scitex/{fig → canvas}/backend/__init__.py +0 -0
- /scitex/{fig → canvas}/backend/_export.py +0 -0
- /scitex/{fig → canvas}/backend/_render.py +0 -0
- /scitex/{fig → canvas}/docs/CANVAS_ARCHITECTURE.md +0 -0
- /scitex/{fig → canvas}/editor/__init__.py +0 -0
- /scitex/{fig → canvas}/editor/_dearpygui_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_flask_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_mpl_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_qt_editor.py +0 -0
- /scitex/{fig → canvas}/editor/_tkinter_editor.py +0 -0
- /scitex/{fig → canvas}/editor/edit/backend_detector.py +0 -0
- /scitex/{fig → canvas}/editor/edit/manual_handler.py +0 -0
- /scitex/{fig → canvas}/editor/edit/path_resolver.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/__init__.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/_plotter.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/_utils.py +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/reset.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/typography.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/base/variables.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/buttons.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/context-menu.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/dropdown.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/forms.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/modal.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/components/sections.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/element-inspector.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/loading.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/overlay.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/selection.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/features/statistics.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/index.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/container.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/controls.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/css/layout/preview.css +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/axis.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/basic.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/alignment/distribute.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/canvas.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/dragging.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/resize.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/canvas/selection.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/core/state.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/core/utils.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/dev/element-inspector.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/bbox.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/element-drag.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/editor/overlay.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/main.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/context-menu.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/shortcuts/keyboard.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/controls.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/download.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/help.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/static/js/ui/theme.js +0 -0
- /scitex/{fig → canvas}/editor/flask_editor/templates/__init__.py +0 -0
- /scitex/{fig → canvas}/io/_directory.py +0 -0
- /scitex/{fig → canvas}/model/_plot_types.py +0 -0
- /scitex/{fig → canvas}/utils/_defaults.py +0 -0
- /scitex/{fig → canvas}/utils/_validate.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/__init__.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/_bundle2dict.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_conversion/_dict2bundle.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_Axes.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_BBox.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_ColumnDef.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataFormat.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataInfo.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_DataSource.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_dataclasses/_SizeMM.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/__init__.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_bar.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_line.py +0 -0
- /scitex/{fts/_bundle → io/bundle}/_extractors/_extract_scatter.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_figure/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_figure}/_composite.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_plot/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_export.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_backend/_render.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_ChannelEncoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Encoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_Theme.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/_TraceEncoding.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_dataclasses/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_bar.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_box.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_distribution.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_errorbar.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_histogram.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_image.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_line.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_scatter.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_seaborn.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_models/_plot_types/_violin.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/__init__.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_auto_layout.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_calc_bounds.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_const_sizes.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_convert_coords.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_get_template.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_normalize.py +0 -0
- /scitex/{fts/_fig → io/bundle/kinds/_plot}/_utils/_validate.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_shape/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/_Stats.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_stats/_dataclasses/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_editor/__init__.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_stats_formatter.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_utils.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_table/_latex/_validator.py +0 -0
- /scitex/{fts/_kinds → io/bundle/kinds}/_text/__init__.py +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/data_info.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/encoding.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/node.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/render_manifest.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/stats.schema.json +0 -0
- /scitex/{fts/_schemas → io/bundle/schemas}/theme.schema.json +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/WHEEL +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/entry_points.txt +0 -0
- {scitex-2.10.2.dist-info → scitex-2.11.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
# Timestamp: 2025-12-20
|
|
3
|
-
# File: /home/ywatanabe/proj/scitex-code/src/scitex/fsb/_fig/_utils/_plot_layout.py
|
|
4
|
-
|
|
5
|
-
"""Blueprint-style visualization for FTS layout and coordinate system.
|
|
6
|
-
|
|
7
|
-
Provides architectural drawing style visualizations with:
|
|
8
|
-
- Canvas boundaries with dimension annotations
|
|
9
|
-
- Element bounding boxes with labels
|
|
10
|
-
- Rulers (horizontal and vertical)
|
|
11
|
-
- Grid lines
|
|
12
|
-
- Before/after comparison for auto-crop
|
|
13
|
-
|
|
14
|
-
Usage:
|
|
15
|
-
from scitex.fts._fig._utils import plot_layout, plot_auto_crop_comparison
|
|
16
|
-
|
|
17
|
-
# Single layout visualization
|
|
18
|
-
fig, ax = plot_layout(elements, canvas_size, title="My Figure")
|
|
19
|
-
|
|
20
|
-
# Before/after auto-crop comparison
|
|
21
|
-
fig = plot_auto_crop_comparison(elements_before, elements_after,
|
|
22
|
-
size_before, size_after)
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
from typing import Any, Dict, List, Optional, Tuple
|
|
26
|
-
|
|
27
|
-
import matplotlib.patches as mpatches
|
|
28
|
-
import matplotlib.pyplot as plt
|
|
29
|
-
from matplotlib.axes import Axes
|
|
30
|
-
from matplotlib.figure import Figure
|
|
31
|
-
|
|
32
|
-
from ._calc_bounds import element_bounds
|
|
33
|
-
from ._normalize import normalize_size
|
|
34
|
-
|
|
35
|
-
__all__ = [
|
|
36
|
-
"plot_layout",
|
|
37
|
-
"plot_auto_crop_comparison",
|
|
38
|
-
"BLUEPRINT_STYLE",
|
|
39
|
-
]
|
|
40
|
-
|
|
41
|
-
# Blueprint color scheme
|
|
42
|
-
BLUEPRINT_STYLE = {
|
|
43
|
-
"bg_color": "#1a2744", # Dark blue background
|
|
44
|
-
"grid_color": "#2a3f5f", # Subtle grid
|
|
45
|
-
"canvas_color": "#ffffff", # White canvas
|
|
46
|
-
"canvas_edge": "#4a90d9", # Blue canvas border
|
|
47
|
-
"element_fill": "#e8f4fc", # Light blue element fill
|
|
48
|
-
"element_edge": "#2171b5", # Blue element border
|
|
49
|
-
"ruler_color": "#ff6b35", # Orange rulers
|
|
50
|
-
"text_color": "#333333", # Dark text
|
|
51
|
-
"dimension_color": "#d62728", # Red dimensions
|
|
52
|
-
"origin_color": "#2ca02c", # Green origin marker
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def plot_layout(
|
|
57
|
-
elements: List[Dict[str, Any]],
|
|
58
|
-
canvas_size: Dict[str, float],
|
|
59
|
-
title: str = "Layout",
|
|
60
|
-
ax: Optional[Axes] = None,
|
|
61
|
-
show_rulers: bool = True,
|
|
62
|
-
show_grid: bool = True,
|
|
63
|
-
show_dimensions: bool = True,
|
|
64
|
-
show_origin: bool = True,
|
|
65
|
-
style: Optional[Dict[str, str]] = None,
|
|
66
|
-
) -> Tuple[Figure, Axes]:
|
|
67
|
-
"""Plot layout with blueprint-style visualization.
|
|
68
|
-
|
|
69
|
-
Args:
|
|
70
|
-
elements: List of element specifications
|
|
71
|
-
canvas_size: Canvas size {"width_mm", "height_mm"}
|
|
72
|
-
title: Plot title
|
|
73
|
-
ax: Existing axes to plot on (creates new if None)
|
|
74
|
-
show_rulers: Show ruler markings
|
|
75
|
-
show_grid: Show background grid
|
|
76
|
-
show_dimensions: Show dimension annotations
|
|
77
|
-
show_origin: Show origin marker
|
|
78
|
-
style: Custom style dict (uses BLUEPRINT_STYLE if None)
|
|
79
|
-
|
|
80
|
-
Returns:
|
|
81
|
-
Tuple of (Figure, Axes)
|
|
82
|
-
"""
|
|
83
|
-
s = style or BLUEPRINT_STYLE
|
|
84
|
-
size = normalize_size(canvas_size)
|
|
85
|
-
w, h = size["width_mm"], size["height_mm"]
|
|
86
|
-
|
|
87
|
-
# Create figure if needed
|
|
88
|
-
if ax is None:
|
|
89
|
-
# Add space for rulers
|
|
90
|
-
ruler_margin = 15 if show_rulers else 5
|
|
91
|
-
fig_w = (w + ruler_margin * 2) / 25.4 # Convert mm to inches
|
|
92
|
-
fig_h = (h + ruler_margin * 2) / 25.4
|
|
93
|
-
fig, ax = plt.subplots(figsize=(fig_w * 1.5, fig_h * 1.5))
|
|
94
|
-
else:
|
|
95
|
-
fig = ax.figure
|
|
96
|
-
|
|
97
|
-
# Set background
|
|
98
|
-
ax.set_facecolor(s["bg_color"])
|
|
99
|
-
|
|
100
|
-
# Draw grid
|
|
101
|
-
if show_grid:
|
|
102
|
-
_draw_grid(ax, w, h, s)
|
|
103
|
-
|
|
104
|
-
# Draw canvas
|
|
105
|
-
_draw_canvas(ax, w, h, s)
|
|
106
|
-
|
|
107
|
-
# Draw origin marker
|
|
108
|
-
if show_origin:
|
|
109
|
-
_draw_origin(ax, s)
|
|
110
|
-
|
|
111
|
-
# Draw elements
|
|
112
|
-
for i, elem in enumerate(elements):
|
|
113
|
-
_draw_element(ax, elem, i, s, show_dimensions)
|
|
114
|
-
|
|
115
|
-
# Draw rulers
|
|
116
|
-
if show_rulers:
|
|
117
|
-
_draw_rulers(ax, w, h, s)
|
|
118
|
-
|
|
119
|
-
# Draw canvas dimensions
|
|
120
|
-
if show_dimensions:
|
|
121
|
-
_draw_canvas_dimensions(ax, w, h, s)
|
|
122
|
-
|
|
123
|
-
# Set axis properties
|
|
124
|
-
margin = 20 if show_rulers else 5
|
|
125
|
-
ax.set_xlim(-margin, w + margin)
|
|
126
|
-
ax.set_ylim(h + margin, -margin) # Inverted Y (origin at top-left)
|
|
127
|
-
ax.set_aspect("equal")
|
|
128
|
-
ax.set_title(title, fontsize=12, fontweight="bold", color=s["text_color"])
|
|
129
|
-
ax.axis("off")
|
|
130
|
-
|
|
131
|
-
return fig, ax
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
def plot_auto_crop_comparison(
|
|
135
|
-
elements_before: List[Dict[str, Any]],
|
|
136
|
-
elements_after: List[Dict[str, Any]],
|
|
137
|
-
size_before: Dict[str, float],
|
|
138
|
-
size_after: Dict[str, float],
|
|
139
|
-
title: str = "Auto-Crop Comparison",
|
|
140
|
-
style: Optional[Dict[str, str]] = None,
|
|
141
|
-
) -> Figure:
|
|
142
|
-
"""Plot before/after comparison for auto-crop.
|
|
143
|
-
|
|
144
|
-
Args:
|
|
145
|
-
elements_before: Elements before auto-crop
|
|
146
|
-
elements_after: Elements after auto-crop
|
|
147
|
-
size_before: Canvas size before
|
|
148
|
-
size_after: Canvas size after
|
|
149
|
-
title: Overall title
|
|
150
|
-
style: Custom style dict
|
|
151
|
-
|
|
152
|
-
Returns:
|
|
153
|
-
Figure with side-by-side comparison
|
|
154
|
-
"""
|
|
155
|
-
s = style or BLUEPRINT_STYLE
|
|
156
|
-
|
|
157
|
-
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 8))
|
|
158
|
-
fig.suptitle(title, fontsize=14, fontweight="bold")
|
|
159
|
-
|
|
160
|
-
# Before
|
|
161
|
-
plot_layout(
|
|
162
|
-
elements_before,
|
|
163
|
-
size_before,
|
|
164
|
-
title="Before Auto-Crop",
|
|
165
|
-
ax=ax1,
|
|
166
|
-
style=s,
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
# After
|
|
170
|
-
plot_layout(
|
|
171
|
-
elements_after,
|
|
172
|
-
size_after,
|
|
173
|
-
title="After Auto-Crop",
|
|
174
|
-
ax=ax2,
|
|
175
|
-
style=s,
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
# Add size annotations
|
|
179
|
-
sb = normalize_size(size_before)
|
|
180
|
-
sa = normalize_size(size_after)
|
|
181
|
-
ax1.text(
|
|
182
|
-
0.5,
|
|
183
|
-
-0.05,
|
|
184
|
-
f"Canvas: {sb['width_mm']:.1f} x {sb['height_mm']:.1f} mm",
|
|
185
|
-
transform=ax1.transAxes,
|
|
186
|
-
ha="center",
|
|
187
|
-
fontsize=10,
|
|
188
|
-
)
|
|
189
|
-
ax2.text(
|
|
190
|
-
0.5,
|
|
191
|
-
-0.05,
|
|
192
|
-
f"Canvas: {sa['width_mm']:.1f} x {sa['height_mm']:.1f} mm",
|
|
193
|
-
transform=ax2.transAxes,
|
|
194
|
-
ha="center",
|
|
195
|
-
fontsize=10,
|
|
196
|
-
)
|
|
197
|
-
|
|
198
|
-
plt.tight_layout()
|
|
199
|
-
return fig
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
def _draw_grid(ax: Axes, w: float, h: float, s: Dict[str, str]) -> None:
|
|
203
|
-
"""Draw background grid."""
|
|
204
|
-
# Major grid every 10mm
|
|
205
|
-
for x in range(0, int(w) + 1, 10):
|
|
206
|
-
ax.axvline(x, color=s["grid_color"], linewidth=0.5, alpha=0.5)
|
|
207
|
-
for y in range(0, int(h) + 1, 10):
|
|
208
|
-
ax.axhline(y, color=s["grid_color"], linewidth=0.5, alpha=0.5)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def _draw_canvas(ax: Axes, w: float, h: float, s: Dict[str, str]) -> None:
|
|
212
|
-
"""Draw canvas rectangle."""
|
|
213
|
-
rect = mpatches.Rectangle(
|
|
214
|
-
(0, 0),
|
|
215
|
-
w,
|
|
216
|
-
h,
|
|
217
|
-
linewidth=2,
|
|
218
|
-
edgecolor=s["canvas_edge"],
|
|
219
|
-
facecolor=s["canvas_color"],
|
|
220
|
-
alpha=0.95,
|
|
221
|
-
zorder=1,
|
|
222
|
-
)
|
|
223
|
-
ax.add_patch(rect)
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
def _draw_origin(ax: Axes, s: Dict[str, str]) -> None:
|
|
227
|
-
"""Draw origin marker at (0,0)."""
|
|
228
|
-
# Origin cross
|
|
229
|
-
ax.plot([-3, 3], [0, 0], color=s["origin_color"], linewidth=2, zorder=10)
|
|
230
|
-
ax.plot([0, 0], [-3, 3], color=s["origin_color"], linewidth=2, zorder=10)
|
|
231
|
-
# Origin label
|
|
232
|
-
ax.text(
|
|
233
|
-
-5,
|
|
234
|
-
-5,
|
|
235
|
-
"(0,0)",
|
|
236
|
-
fontsize=8,
|
|
237
|
-
color=s["origin_color"],
|
|
238
|
-
ha="right",
|
|
239
|
-
va="bottom",
|
|
240
|
-
fontweight="bold",
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
def _draw_element(
|
|
245
|
-
ax: Axes,
|
|
246
|
-
elem: Dict[str, Any],
|
|
247
|
-
index: int,
|
|
248
|
-
s: Dict[str, str],
|
|
249
|
-
show_dimensions: bool,
|
|
250
|
-
) -> None:
|
|
251
|
-
"""Draw a single element with bounding box."""
|
|
252
|
-
bounds = element_bounds(elem)
|
|
253
|
-
x, y = bounds["x_mm"], bounds["y_mm"]
|
|
254
|
-
w, h = bounds["width_mm"], bounds["height_mm"]
|
|
255
|
-
|
|
256
|
-
# Element rectangle
|
|
257
|
-
rect = mpatches.Rectangle(
|
|
258
|
-
(x, y),
|
|
259
|
-
w,
|
|
260
|
-
h,
|
|
261
|
-
linewidth=1.5,
|
|
262
|
-
edgecolor=s["element_edge"],
|
|
263
|
-
facecolor=s["element_fill"],
|
|
264
|
-
alpha=0.8,
|
|
265
|
-
zorder=5,
|
|
266
|
-
)
|
|
267
|
-
ax.add_patch(rect)
|
|
268
|
-
|
|
269
|
-
# Element label
|
|
270
|
-
elem_id = elem.get("id", f"E{index}")
|
|
271
|
-
elem_type = elem.get("type", "unknown")
|
|
272
|
-
label = f"{elem_id}\n({elem_type})"
|
|
273
|
-
ax.text(
|
|
274
|
-
x + w / 2,
|
|
275
|
-
y + h / 2,
|
|
276
|
-
label,
|
|
277
|
-
ha="center",
|
|
278
|
-
va="center",
|
|
279
|
-
fontsize=9,
|
|
280
|
-
color=s["text_color"],
|
|
281
|
-
fontweight="bold",
|
|
282
|
-
zorder=6,
|
|
283
|
-
)
|
|
284
|
-
|
|
285
|
-
# Position annotation
|
|
286
|
-
if show_dimensions:
|
|
287
|
-
ax.text(
|
|
288
|
-
x,
|
|
289
|
-
y - 2,
|
|
290
|
-
f"({x:.0f}, {y:.0f})",
|
|
291
|
-
fontsize=7,
|
|
292
|
-
color=s["dimension_color"],
|
|
293
|
-
ha="left",
|
|
294
|
-
va="bottom",
|
|
295
|
-
)
|
|
296
|
-
# Size annotation
|
|
297
|
-
ax.text(
|
|
298
|
-
x + w,
|
|
299
|
-
y + h + 2,
|
|
300
|
-
f"{w:.0f}x{h:.0f}",
|
|
301
|
-
fontsize=7,
|
|
302
|
-
color=s["dimension_color"],
|
|
303
|
-
ha="right",
|
|
304
|
-
va="top",
|
|
305
|
-
)
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
def _draw_rulers(ax: Axes, w: float, h: float, s: Dict[str, str]) -> None:
|
|
309
|
-
"""Draw rulers along edges."""
|
|
310
|
-
ruler_offset = -12
|
|
311
|
-
|
|
312
|
-
# Horizontal ruler (top)
|
|
313
|
-
ax.plot([0, w], [ruler_offset, ruler_offset], color=s["ruler_color"], linewidth=1)
|
|
314
|
-
for x in range(0, int(w) + 1, 10):
|
|
315
|
-
tick_len = 3 if x % 50 == 0 else 1.5
|
|
316
|
-
ax.plot(
|
|
317
|
-
[x, x],
|
|
318
|
-
[ruler_offset, ruler_offset + tick_len],
|
|
319
|
-
color=s["ruler_color"],
|
|
320
|
-
linewidth=1,
|
|
321
|
-
)
|
|
322
|
-
if x % 50 == 0:
|
|
323
|
-
ax.text(
|
|
324
|
-
x,
|
|
325
|
-
ruler_offset - 2,
|
|
326
|
-
str(x),
|
|
327
|
-
fontsize=7,
|
|
328
|
-
ha="center",
|
|
329
|
-
va="bottom",
|
|
330
|
-
color=s["ruler_color"],
|
|
331
|
-
)
|
|
332
|
-
|
|
333
|
-
# Vertical ruler (left)
|
|
334
|
-
ax.plot([ruler_offset, ruler_offset], [0, h], color=s["ruler_color"], linewidth=1)
|
|
335
|
-
for y in range(0, int(h) + 1, 10):
|
|
336
|
-
tick_len = 3 if y % 50 == 0 else 1.5
|
|
337
|
-
ax.plot(
|
|
338
|
-
[ruler_offset, ruler_offset + tick_len],
|
|
339
|
-
[y, y],
|
|
340
|
-
color=s["ruler_color"],
|
|
341
|
-
linewidth=1,
|
|
342
|
-
)
|
|
343
|
-
if y % 50 == 0:
|
|
344
|
-
ax.text(
|
|
345
|
-
ruler_offset - 2,
|
|
346
|
-
y,
|
|
347
|
-
str(y),
|
|
348
|
-
fontsize=7,
|
|
349
|
-
ha="right",
|
|
350
|
-
va="center",
|
|
351
|
-
color=s["ruler_color"],
|
|
352
|
-
)
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
def _draw_canvas_dimensions(ax: Axes, w: float, h: float, s: Dict[str, str]) -> None:
|
|
356
|
-
"""Draw canvas dimension annotations."""
|
|
357
|
-
# Width dimension (bottom)
|
|
358
|
-
y_pos = h + 8
|
|
359
|
-
ax.annotate(
|
|
360
|
-
"",
|
|
361
|
-
xy=(w, y_pos),
|
|
362
|
-
xytext=(0, y_pos),
|
|
363
|
-
arrowprops=dict(arrowstyle="<->", color=s["dimension_color"], lw=1.5),
|
|
364
|
-
)
|
|
365
|
-
ax.text(
|
|
366
|
-
w / 2,
|
|
367
|
-
y_pos + 3,
|
|
368
|
-
f"{w:.0f} mm",
|
|
369
|
-
ha="center",
|
|
370
|
-
va="bottom",
|
|
371
|
-
fontsize=9,
|
|
372
|
-
color=s["dimension_color"],
|
|
373
|
-
fontweight="bold",
|
|
374
|
-
)
|
|
375
|
-
|
|
376
|
-
# Height dimension (right)
|
|
377
|
-
x_pos = w + 8
|
|
378
|
-
ax.annotate(
|
|
379
|
-
"",
|
|
380
|
-
xy=(x_pos, h),
|
|
381
|
-
xytext=(x_pos, 0),
|
|
382
|
-
arrowprops=dict(arrowstyle="<->", color=s["dimension_color"], lw=1.5),
|
|
383
|
-
)
|
|
384
|
-
ax.text(
|
|
385
|
-
x_pos + 3,
|
|
386
|
-
h / 2,
|
|
387
|
-
f"{h:.0f} mm",
|
|
388
|
-
ha="left",
|
|
389
|
-
va="center",
|
|
390
|
-
fontsize=9,
|
|
391
|
-
color=s["dimension_color"],
|
|
392
|
-
fontweight="bold",
|
|
393
|
-
rotation=90,
|
|
394
|
-
)
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
# EOF
|