figrecipe 0.5.0__py3-none-any.whl → 0.7.4__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 (189) hide show
  1. figrecipe/__init__.py +220 -819
  2. figrecipe/_api/__init__.py +48 -0
  3. figrecipe/_api/_extract.py +108 -0
  4. figrecipe/_api/_notebook.py +61 -0
  5. figrecipe/_api/_panel.py +46 -0
  6. figrecipe/_api/_save.py +191 -0
  7. figrecipe/_api/_seaborn_proxy.py +34 -0
  8. figrecipe/_api/_style_manager.py +153 -0
  9. figrecipe/_api/_subplots.py +333 -0
  10. figrecipe/_api/_validate.py +82 -0
  11. figrecipe/_dev/__init__.py +29 -0
  12. figrecipe/_dev/_plotters.py +76 -0
  13. figrecipe/_dev/_run_demos.py +56 -0
  14. figrecipe/_dev/demo_plotters/__init__.py +64 -0
  15. figrecipe/_dev/demo_plotters/_categories.py +81 -0
  16. figrecipe/_dev/demo_plotters/_figure_creators.py +119 -0
  17. figrecipe/_dev/demo_plotters/_helpers.py +31 -0
  18. figrecipe/_dev/demo_plotters/_registry.py +50 -0
  19. figrecipe/_dev/demo_plotters/bar_categorical/__init__.py +4 -0
  20. figrecipe/_dev/demo_plotters/bar_categorical/plot_bar.py +25 -0
  21. figrecipe/_dev/demo_plotters/bar_categorical/plot_barh.py +25 -0
  22. figrecipe/_dev/demo_plotters/contour_surface/__init__.py +4 -0
  23. figrecipe/_dev/demo_plotters/contour_surface/plot_contour.py +30 -0
  24. figrecipe/_dev/demo_plotters/contour_surface/plot_contourf.py +29 -0
  25. figrecipe/_dev/demo_plotters/contour_surface/plot_tricontour.py +28 -0
  26. figrecipe/_dev/demo_plotters/contour_surface/plot_tricontourf.py +28 -0
  27. figrecipe/_dev/demo_plotters/contour_surface/plot_tripcolor.py +29 -0
  28. figrecipe/_dev/demo_plotters/contour_surface/plot_triplot.py +25 -0
  29. figrecipe/_dev/demo_plotters/distribution/__init__.py +4 -0
  30. figrecipe/_dev/demo_plotters/distribution/plot_boxplot.py +24 -0
  31. figrecipe/_dev/demo_plotters/distribution/plot_ecdf.py +24 -0
  32. figrecipe/_dev/demo_plotters/distribution/plot_hist.py +24 -0
  33. figrecipe/_dev/demo_plotters/distribution/plot_hist2d.py +25 -0
  34. figrecipe/_dev/demo_plotters/distribution/plot_violinplot.py +25 -0
  35. figrecipe/_dev/demo_plotters/image_matrix/__init__.py +4 -0
  36. figrecipe/_dev/demo_plotters/image_matrix/plot_hexbin.py +25 -0
  37. figrecipe/_dev/demo_plotters/image_matrix/plot_imshow.py +23 -0
  38. figrecipe/_dev/demo_plotters/image_matrix/plot_matshow.py +23 -0
  39. figrecipe/_dev/demo_plotters/image_matrix/plot_pcolor.py +29 -0
  40. figrecipe/_dev/demo_plotters/image_matrix/plot_pcolormesh.py +29 -0
  41. figrecipe/_dev/demo_plotters/image_matrix/plot_spy.py +29 -0
  42. figrecipe/_dev/demo_plotters/line_curve/__init__.py +4 -0
  43. figrecipe/_dev/demo_plotters/line_curve/plot_errorbar.py +28 -0
  44. figrecipe/_dev/demo_plotters/line_curve/plot_fill.py +29 -0
  45. figrecipe/_dev/demo_plotters/line_curve/plot_fill_between.py +30 -0
  46. figrecipe/_dev/demo_plotters/line_curve/plot_fill_betweenx.py +28 -0
  47. figrecipe/_dev/demo_plotters/line_curve/plot_plot.py +28 -0
  48. figrecipe/_dev/demo_plotters/line_curve/plot_stackplot.py +29 -0
  49. figrecipe/_dev/demo_plotters/line_curve/plot_stairs.py +27 -0
  50. figrecipe/_dev/demo_plotters/line_curve/plot_step.py +27 -0
  51. figrecipe/_dev/demo_plotters/scatter_points/__init__.py +4 -0
  52. figrecipe/_dev/demo_plotters/scatter_points/plot_scatter.py +24 -0
  53. figrecipe/_dev/demo_plotters/special/__init__.py +4 -0
  54. figrecipe/_dev/demo_plotters/special/plot_eventplot.py +25 -0
  55. figrecipe/_dev/demo_plotters/special/plot_loglog.py +27 -0
  56. figrecipe/_dev/demo_plotters/special/plot_pie.py +27 -0
  57. figrecipe/_dev/demo_plotters/special/plot_semilogx.py +27 -0
  58. figrecipe/_dev/demo_plotters/special/plot_semilogy.py +27 -0
  59. figrecipe/_dev/demo_plotters/special/plot_stem.py +27 -0
  60. figrecipe/_dev/demo_plotters/spectral_signal/__init__.py +4 -0
  61. figrecipe/_dev/demo_plotters/spectral_signal/plot_acorr.py +24 -0
  62. figrecipe/_dev/demo_plotters/spectral_signal/plot_angle_spectrum.py +28 -0
  63. figrecipe/_dev/demo_plotters/spectral_signal/plot_cohere.py +29 -0
  64. figrecipe/_dev/demo_plotters/spectral_signal/plot_csd.py +29 -0
  65. figrecipe/_dev/demo_plotters/spectral_signal/plot_magnitude_spectrum.py +28 -0
  66. figrecipe/_dev/demo_plotters/spectral_signal/plot_phase_spectrum.py +28 -0
  67. figrecipe/_dev/demo_plotters/spectral_signal/plot_psd.py +29 -0
  68. figrecipe/_dev/demo_plotters/spectral_signal/plot_specgram.py +30 -0
  69. figrecipe/_dev/demo_plotters/spectral_signal/plot_xcorr.py +25 -0
  70. figrecipe/_dev/demo_plotters/vector_flow/__init__.py +4 -0
  71. figrecipe/_dev/demo_plotters/vector_flow/plot_barbs.py +30 -0
  72. figrecipe/_dev/demo_plotters/vector_flow/plot_quiver.py +30 -0
  73. figrecipe/_dev/demo_plotters/vector_flow/plot_streamplot.py +30 -0
  74. figrecipe/_editor/__init__.py +278 -0
  75. figrecipe/_editor/_bbox/__init__.py +43 -0
  76. figrecipe/_editor/_bbox/_collections.py +177 -0
  77. figrecipe/_editor/_bbox/_elements.py +159 -0
  78. figrecipe/_editor/_bbox/_extract.py +256 -0
  79. figrecipe/_editor/_bbox/_extract_axes.py +370 -0
  80. figrecipe/_editor/_bbox/_extract_text.py +342 -0
  81. figrecipe/_editor/_bbox/_lines.py +173 -0
  82. figrecipe/_editor/_bbox/_transforms.py +146 -0
  83. figrecipe/_editor/_flask_app.py +258 -0
  84. figrecipe/_editor/_helpers.py +242 -0
  85. figrecipe/_editor/_hitmap/__init__.py +76 -0
  86. figrecipe/_editor/_hitmap/_artists/__init__.py +21 -0
  87. figrecipe/_editor/_hitmap/_artists/_collections.py +345 -0
  88. figrecipe/_editor/_hitmap/_artists/_images.py +68 -0
  89. figrecipe/_editor/_hitmap/_artists/_lines.py +107 -0
  90. figrecipe/_editor/_hitmap/_artists/_patches.py +163 -0
  91. figrecipe/_editor/_hitmap/_artists/_text.py +190 -0
  92. figrecipe/_editor/_hitmap/_colors.py +181 -0
  93. figrecipe/_editor/_hitmap/_detect.py +137 -0
  94. figrecipe/_editor/_hitmap/_restore.py +154 -0
  95. figrecipe/_editor/_hitmap_main.py +182 -0
  96. figrecipe/_editor/_overrides.py +318 -0
  97. figrecipe/_editor/_preferences.py +135 -0
  98. figrecipe/_editor/_render_overrides.py +480 -0
  99. figrecipe/_editor/_renderer.py +199 -0
  100. figrecipe/_editor/_routes_axis.py +453 -0
  101. figrecipe/_editor/_routes_core.py +284 -0
  102. figrecipe/_editor/_routes_element.py +317 -0
  103. figrecipe/_editor/_routes_style.py +223 -0
  104. figrecipe/_editor/_templates/__init__.py +152 -0
  105. figrecipe/_editor/_templates/_html.py +502 -0
  106. figrecipe/_editor/_templates/_scripts/__init__.py +120 -0
  107. figrecipe/_editor/_templates/_scripts/_api.py +228 -0
  108. figrecipe/_editor/_templates/_scripts/_colors.py +485 -0
  109. figrecipe/_editor/_templates/_scripts/_core.py +436 -0
  110. figrecipe/_editor/_templates/_scripts/_debug_snapshot.py +186 -0
  111. figrecipe/_editor/_templates/_scripts/_element_editor.py +310 -0
  112. figrecipe/_editor/_templates/_scripts/_files.py +195 -0
  113. figrecipe/_editor/_templates/_scripts/_hitmap.py +509 -0
  114. figrecipe/_editor/_templates/_scripts/_inspector.py +315 -0
  115. figrecipe/_editor/_templates/_scripts/_labels.py +464 -0
  116. figrecipe/_editor/_templates/_scripts/_legend_drag.py +265 -0
  117. figrecipe/_editor/_templates/_scripts/_modals.py +226 -0
  118. figrecipe/_editor/_templates/_scripts/_overlays.py +292 -0
  119. figrecipe/_editor/_templates/_scripts/_panel_drag.py +334 -0
  120. figrecipe/_editor/_templates/_scripts/_panel_position.py +279 -0
  121. figrecipe/_editor/_templates/_scripts/_selection.py +237 -0
  122. figrecipe/_editor/_templates/_scripts/_tabs.py +89 -0
  123. figrecipe/_editor/_templates/_scripts/_view_mode.py +107 -0
  124. figrecipe/_editor/_templates/_scripts/_zoom.py +179 -0
  125. figrecipe/_editor/_templates/_styles/__init__.py +69 -0
  126. figrecipe/_editor/_templates/_styles/_base.py +64 -0
  127. figrecipe/_editor/_templates/_styles/_buttons.py +206 -0
  128. figrecipe/_editor/_templates/_styles/_color_input.py +123 -0
  129. figrecipe/_editor/_templates/_styles/_controls.py +265 -0
  130. figrecipe/_editor/_templates/_styles/_dynamic_props.py +144 -0
  131. figrecipe/_editor/_templates/_styles/_forms.py +126 -0
  132. figrecipe/_editor/_templates/_styles/_hitmap.py +184 -0
  133. figrecipe/_editor/_templates/_styles/_inspector.py +90 -0
  134. figrecipe/_editor/_templates/_styles/_labels.py +118 -0
  135. figrecipe/_editor/_templates/_styles/_modals.py +98 -0
  136. figrecipe/_editor/_templates/_styles/_overlays.py +130 -0
  137. figrecipe/_editor/_templates/_styles/_preview.py +225 -0
  138. figrecipe/_editor/_templates/_styles/_selection.py +73 -0
  139. figrecipe/_params/_DECORATION_METHODS.py +33 -0
  140. figrecipe/_params/_PLOTTING_METHODS.py +58 -0
  141. figrecipe/_params/__init__.py +9 -0
  142. figrecipe/_recorder.py +92 -110
  143. figrecipe/_recorder_utils.py +124 -0
  144. figrecipe/_reproducer/__init__.py +18 -0
  145. figrecipe/_reproducer/_core.py +498 -0
  146. figrecipe/_reproducer/_custom_plots.py +279 -0
  147. figrecipe/_reproducer/_seaborn.py +100 -0
  148. figrecipe/_reproducer/_violin.py +186 -0
  149. figrecipe/_seaborn.py +14 -9
  150. figrecipe/_serializer.py +2 -2
  151. figrecipe/_signatures/README.md +68 -0
  152. figrecipe/_signatures/__init__.py +12 -2
  153. figrecipe/_signatures/_kwargs.py +273 -0
  154. figrecipe/_signatures/_loader.py +114 -57
  155. figrecipe/_signatures/_parsing.py +147 -0
  156. figrecipe/_utils/__init__.py +6 -4
  157. figrecipe/_utils/_crop.py +10 -4
  158. figrecipe/_utils/_image_diff.py +37 -33
  159. figrecipe/_utils/_numpy_io.py +0 -1
  160. figrecipe/_utils/_units.py +11 -3
  161. figrecipe/_validator.py +12 -3
  162. figrecipe/_wrappers/_axes.py +193 -170
  163. figrecipe/_wrappers/_axes_helpers.py +136 -0
  164. figrecipe/_wrappers/_axes_plots.py +418 -0
  165. figrecipe/_wrappers/_axes_seaborn.py +157 -0
  166. figrecipe/_wrappers/_figure.py +277 -18
  167. figrecipe/_wrappers/_panel_labels.py +127 -0
  168. figrecipe/_wrappers/_plot_helpers.py +143 -0
  169. figrecipe/_wrappers/_violin_helpers.py +180 -0
  170. figrecipe/plt.py +0 -1
  171. figrecipe/pyplot.py +2 -1
  172. figrecipe/styles/__init__.py +12 -11
  173. figrecipe/styles/_dotdict.py +72 -0
  174. figrecipe/styles/_finalize.py +134 -0
  175. figrecipe/styles/_fonts.py +77 -0
  176. figrecipe/styles/_kwargs_converter.py +178 -0
  177. figrecipe/styles/_plot_styles.py +209 -0
  178. figrecipe/styles/_style_applier.py +60 -202
  179. figrecipe/styles/_style_loader.py +73 -121
  180. figrecipe/styles/_themes.py +151 -0
  181. figrecipe/styles/presets/MATPLOTLIB.yaml +95 -0
  182. figrecipe/styles/presets/SCITEX.yaml +181 -0
  183. figrecipe-0.7.4.dist-info/METADATA +429 -0
  184. figrecipe-0.7.4.dist-info/RECORD +188 -0
  185. figrecipe/_reproducer.py +0 -358
  186. figrecipe-0.5.0.dist-info/METADATA +0 -336
  187. figrecipe-0.5.0.dist-info/RECORD +0 -26
  188. {figrecipe-0.5.0.dist-info → figrecipe-0.7.4.dist-info}/WHEEL +0 -0
  189. {figrecipe-0.5.0.dist-info → figrecipe-0.7.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Hitmap overlay CSS styles for the figure editor.
4
+
5
+ This module contains CSS for:
6
+ - Hitregion overlay and visibility modes
7
+ - Hitregion rectangles, polylines, circles
8
+ - Scatter groups and labels
9
+ - Group hover highlights
10
+ """
11
+
12
+ STYLES_HITMAP = """
13
+ /* Hit Region Overlay */
14
+ .hitregion-overlay {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ width: 100%;
19
+ height: 100%;
20
+ pointer-events: auto; /* Allow clicks on empty areas to deselect */
21
+ z-index: 10; /* Above the preview image */
22
+ }
23
+
24
+ /* Always display overlay for hover detection, but control visibility via children */
25
+ .hitregion-overlay.visible .hitregion-rect,
26
+ .hitregion-overlay.visible .hitregion-polyline {
27
+ opacity: 1;
28
+ stroke: rgba(128, 128, 128, 0.3); /* Slight visible stroke in visible mode */
29
+ }
30
+
31
+ .hitregion-overlay.visible .hitregion-polyline {
32
+ stroke: rgba(128, 128, 128, 0.2);
33
+ stroke-width: 6;
34
+ }
35
+
36
+ /* Hover-only mode: invisible until hovered */
37
+ .hitregion-overlay.hover-mode .hitregion-rect,
38
+ .hitregion-overlay.hover-mode .hitregion-polyline {
39
+ opacity: 0;
40
+ }
41
+
42
+ .hitregion-overlay.hover-mode .hitregion-rect:hover,
43
+ .hitregion-overlay.hover-mode .hitregion-polyline:hover {
44
+ opacity: 1;
45
+ }
46
+
47
+ .hitregion-rect {
48
+ --element-color: #888888; /* Default fallback */
49
+ fill: transparent;
50
+ stroke: transparent;
51
+ stroke-width: 2;
52
+ stroke-dasharray: 6, 3;
53
+ pointer-events: all;
54
+ cursor: pointer;
55
+ transition: fill 0.2s, stroke 0.2s, filter 0.2s, opacity 0.15s;
56
+ }
57
+
58
+ .hitregion-rect:hover {
59
+ fill: var(--element-color);
60
+ fill-opacity: 0.2;
61
+ stroke: var(--element-color);
62
+ stroke-opacity: 0.8;
63
+ stroke-width: 3;
64
+ stroke-dasharray: none;
65
+ filter: none;
66
+ }
67
+
68
+ .hitregion-polyline {
69
+ --element-color: #888888; /* Default fallback */
70
+ fill: none !important;
71
+ stroke: transparent;
72
+ stroke-width: 8;
73
+ stroke-linecap: round;
74
+ stroke-linejoin: round;
75
+ pointer-events: stroke;
76
+ cursor: pointer;
77
+ transition: stroke 0.15s, opacity 0.15s;
78
+ }
79
+
80
+ .hitregion-polyline:hover {
81
+ fill: none !important;
82
+ stroke: var(--element-color);
83
+ stroke-width: 8;
84
+ stroke-opacity: 0.4;
85
+ filter: none;
86
+ }
87
+
88
+ /* Scatter point circles */
89
+ .scatter-group {
90
+ --element-color: #888888; /* Default fallback */
91
+ pointer-events: all;
92
+ }
93
+
94
+ .hitregion-circle {
95
+ fill: transparent;
96
+ stroke: transparent;
97
+ stroke-width: 1;
98
+ pointer-events: all;
99
+ cursor: pointer;
100
+ opacity: 1; /* Explicit default */
101
+ transition: fill 0.15s, stroke 0.15s, opacity 0.15s;
102
+ }
103
+
104
+ .hitregion-circle:hover,
105
+ .hitregion-circle.hovered {
106
+ fill: var(--element-color);
107
+ fill-opacity: 0.2;
108
+ stroke: var(--element-color);
109
+ stroke-opacity: 0.5;
110
+ stroke-width: 1;
111
+ filter: none;
112
+ }
113
+
114
+ /* When any circle in the group is hovered, highlight ALL circles in the group */
115
+ .scatter-group:hover .hitregion-circle,
116
+ .scatter-group.hovered .hitregion-circle {
117
+ fill: var(--element-color);
118
+ fill-opacity: 0.15;
119
+ stroke: var(--element-color);
120
+ stroke-opacity: 0.4;
121
+ stroke-width: 1;
122
+ filter: none;
123
+ }
124
+
125
+ /* Scatter circles visibility modes */
126
+ .hitregion-overlay.visible .hitregion-circle,
127
+ .hitregion-overlay.visible .scatter-group {
128
+ opacity: 1;
129
+ }
130
+
131
+ .hitregion-overlay.hover-mode .hitregion-circle {
132
+ opacity: 0;
133
+ }
134
+
135
+ .hitregion-overlay.hover-mode .scatter-group:hover .hitregion-circle,
136
+ .hitregion-overlay.hover-mode .hitregion-circle:hover {
137
+ opacity: 1;
138
+ }
139
+
140
+ .hitregion-label {
141
+ font-size: 10px;
142
+ fill: var(--text-primary);
143
+ pointer-events: none;
144
+ opacity: 0;
145
+ transition: opacity 0.15s;
146
+ }
147
+
148
+ .hitregion-rect:hover + .hitregion-label,
149
+ .hitregion-group:hover .hitregion-label,
150
+ .hitregion-group.hovered .hitregion-label,
151
+ .scatter-group:hover ~ .hitregion-label,
152
+ .scatter-group.hovered ~ .hitregion-label,
153
+ .hitregion-polyline:hover + .hitregion-label {
154
+ opacity: 1;
155
+ }
156
+
157
+ #btn-show-hitmap.active {
158
+ background: var(--accent-color);
159
+ color: white;
160
+ border-color: var(--accent-color);
161
+ }
162
+
163
+ /* Group hover highlight - all elements in same logical group */
164
+ .group-hovered {
165
+ opacity: 1 !important;
166
+ }
167
+
168
+ .group-hovered .hitregion-polyline,
169
+ .group-hovered .hitregion-rect,
170
+ .group-hovered .hitregion-circle {
171
+ stroke: var(--accent-color) !important;
172
+ stroke-width: 3 !important;
173
+ fill: var(--selection-color) !important;
174
+ }
175
+
176
+ .hitregion-group.group-hovered .hitregion-label {
177
+ opacity: 1 !important;
178
+ font-weight: bold;
179
+ }
180
+ """
181
+
182
+ __all__ = ["STYLES_HITMAP"]
183
+
184
+ # EOF
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Element inspector CSS styles for the figure editor.
4
+
5
+ This module contains CSS for:
6
+ - Element inspector overlay
7
+ - Inspector box hover states
8
+ - Inspector labels and notifications
9
+ """
10
+
11
+ STYLES_INSPECTOR = """
12
+ /* ==================== ELEMENT INSPECTOR ==================== */
13
+ .element-inspector-overlay {
14
+ position: fixed;
15
+ top: 0;
16
+ left: 0;
17
+ width: 100%;
18
+ height: 100%;
19
+ pointer-events: none;
20
+ z-index: 999999;
21
+ }
22
+
23
+ .element-inspector-box {
24
+ position: absolute;
25
+ border: 2px solid;
26
+ box-sizing: border-box;
27
+ pointer-events: auto;
28
+ cursor: pointer;
29
+ transition: all 0.15s;
30
+ background: rgba(255, 255, 255, 0.01);
31
+ }
32
+
33
+ .element-inspector-box:hover {
34
+ border-width: 3px;
35
+ background: rgba(59, 130, 246, 0.15);
36
+ box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6), 0 0 12px rgba(59, 130, 246, 0.4);
37
+ }
38
+
39
+ .element-inspector-label {
40
+ position: absolute;
41
+ background: rgba(0, 0, 0, 0.9);
42
+ color: white;
43
+ padding: 2px 6px;
44
+ font-size: 10px;
45
+ font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
46
+ border-radius: 3px;
47
+ white-space: nowrap;
48
+ pointer-events: auto;
49
+ cursor: pointer;
50
+ z-index: 1000000;
51
+ box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
52
+ line-height: 1.4;
53
+ max-width: 300px;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ }
57
+
58
+ .element-inspector-label:hover {
59
+ background: rgba(40, 40, 40, 0.95);
60
+ transform: scale(1.05);
61
+ }
62
+
63
+ .element-inspector-label .tag { color: #CE9178; }
64
+ .element-inspector-label .id { color: #4EC9B0; font-weight: bold; }
65
+ .element-inspector-label .class { color: #9CDCFE; }
66
+
67
+ .element-inspector-notification {
68
+ position: fixed;
69
+ bottom: 20px;
70
+ right: 20px;
71
+ background: linear-gradient(135deg, #10b981 0%, #059669 100%);
72
+ color: white;
73
+ padding: 12px 20px;
74
+ border-radius: 8px;
75
+ font-size: 14px;
76
+ font-weight: 500;
77
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
78
+ z-index: 10000000;
79
+ animation: slideInRight 0.3s ease;
80
+ }
81
+
82
+ @keyframes slideInRight {
83
+ from { transform: translateX(100px); opacity: 0; }
84
+ to { transform: translateX(0); opacity: 1; }
85
+ }
86
+ """
87
+
88
+ __all__ = ["STYLES_INSPECTOR"]
89
+
90
+ # EOF
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Label and legend CSS styles for the figure editor.
4
+
5
+ This module contains CSS for:
6
+ - Axis type toggle buttons
7
+ - Label input fields
8
+ - Legend position and label styling
9
+ """
10
+
11
+ STYLES_LABELS = """
12
+ /* Axis Type Toggle */
13
+ .axis-type-toggle {
14
+ display: flex;
15
+ gap: 0;
16
+ border: 1px solid var(--border-color);
17
+ border-radius: 4px;
18
+ overflow: hidden;
19
+ flex: 1;
20
+ }
21
+
22
+ .axis-type-btn {
23
+ flex: 1;
24
+ padding: 6px 12px;
25
+ font-size: 12px;
26
+ border: none;
27
+ background: var(--bg-primary);
28
+ color: var(--text-secondary);
29
+ cursor: pointer;
30
+ transition: all 0.15s;
31
+ border-radius: 0;
32
+ }
33
+
34
+ .axis-type-btn:first-child {
35
+ border-right: 1px solid var(--border-color);
36
+ }
37
+
38
+ .axis-type-btn:hover {
39
+ background: var(--bg-secondary);
40
+ color: var(--text-primary);
41
+ }
42
+
43
+ .axis-type-btn.active {
44
+ background: var(--accent-color);
45
+ color: white;
46
+ }
47
+
48
+ /* Label input styling */
49
+ .label-input {
50
+ flex: 1;
51
+ padding: 6px 10px;
52
+ border: 1px solid var(--border-color);
53
+ border-radius: 4px;
54
+ background: var(--bg-primary);
55
+ color: var(--text-primary);
56
+ font-size: 13px;
57
+ }
58
+
59
+ .label-input:focus {
60
+ outline: none;
61
+ border-color: var(--accent-color);
62
+ box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
63
+ }
64
+
65
+ /* Legend custom position */
66
+ .legend-custom-pos {
67
+ margin-top: 8px;
68
+ padding: 8px;
69
+ background: var(--bg-secondary);
70
+ border-radius: 4px;
71
+ }
72
+
73
+ .form-hint {
74
+ font-size: 11px;
75
+ color: var(--text-secondary);
76
+ margin-top: 4px;
77
+ font-style: italic;
78
+ }
79
+
80
+ /* Legend labels editor */
81
+ .legend-labels-container {
82
+ margin-top: 8px;
83
+ }
84
+
85
+ .legend-label-item {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 8px;
89
+ margin-bottom: 6px;
90
+ }
91
+
92
+ .legend-label-color {
93
+ width: 16px;
94
+ height: 16px;
95
+ border-radius: 3px;
96
+ border: 1px solid var(--border-color);
97
+ flex-shrink: 0;
98
+ }
99
+
100
+ .legend-label-input {
101
+ flex: 1;
102
+ padding: 4px 8px;
103
+ border: 1px solid var(--border-color);
104
+ border-radius: 4px;
105
+ background: var(--bg-primary);
106
+ color: var(--text-primary);
107
+ font-size: 12px;
108
+ }
109
+
110
+ .legend-label-input:focus {
111
+ outline: none;
112
+ border-color: var(--accent-color);
113
+ }
114
+ """
115
+
116
+ __all__ = ["STYLES_LABELS"]
117
+
118
+ # EOF
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Modal and shortcuts CSS styles for the figure editor.
4
+
5
+ This module contains CSS for:
6
+ - Shortcuts button
7
+ - Shortcuts modal layout
8
+ - Keyboard key (kbd) styling
9
+ """
10
+
11
+ STYLES_MODALS = """
12
+ /* Keyboard Shortcuts Button */
13
+ .btn-shortcuts {
14
+ padding: 6px 10px;
15
+ font-size: 16px;
16
+ background: var(--bg-primary);
17
+ border: 1px solid var(--border-color);
18
+ border-radius: 4px;
19
+ cursor: pointer;
20
+ transition: all 0.15s;
21
+ }
22
+
23
+ .btn-shortcuts:hover {
24
+ background: var(--bg-secondary);
25
+ border-color: var(--accent-color);
26
+ }
27
+
28
+ /* Shortcuts Modal */
29
+ .shortcuts-modal-content {
30
+ max-width: 500px;
31
+ width: 90%;
32
+ }
33
+
34
+ .shortcuts-content {
35
+ padding: 20px;
36
+ max-height: 60vh;
37
+ overflow-y: auto;
38
+ }
39
+
40
+ .shortcut-section {
41
+ margin-bottom: 20px;
42
+ }
43
+
44
+ .shortcut-section:last-child {
45
+ margin-bottom: 0;
46
+ }
47
+
48
+ .shortcut-section h4 {
49
+ font-size: 13px;
50
+ font-weight: 600;
51
+ color: var(--accent-color);
52
+ margin-bottom: 12px;
53
+ padding-bottom: 6px;
54
+ border-bottom: 1px solid var(--border-color);
55
+ }
56
+
57
+ .shortcut-row {
58
+ display: flex;
59
+ align-items: center;
60
+ padding: 6px 0;
61
+ gap: 16px;
62
+ }
63
+
64
+ .shortcut-keys {
65
+ flex: 0 0 180px;
66
+ text-align: left;
67
+ white-space: nowrap;
68
+ }
69
+
70
+ .shortcut-desc {
71
+ flex: 1;
72
+ color: var(--text-secondary);
73
+ font-size: 13px;
74
+ text-align: left;
75
+ }
76
+
77
+ kbd {
78
+ display: inline-block;
79
+ padding: 3px 8px;
80
+ font-size: 12px;
81
+ font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
82
+ background: var(--bg-secondary);
83
+ border: 1px solid var(--border-color);
84
+ border-radius: 4px;
85
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
86
+ color: var(--text-primary);
87
+ margin: 0 2px;
88
+ }
89
+
90
+ [data-theme="dark"] kbd {
91
+ background: var(--bg-tertiary);
92
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
93
+ }
94
+ """
95
+
96
+ __all__ = ["STYLES_MODALS"]
97
+
98
+ # EOF
@@ -0,0 +1,130 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ """Ruler, grid, and column overlay CSS styles for the figure editor.
4
+
5
+ This module contains CSS for:
6
+ - Ruler overlay with measurements
7
+ - Grid overlay (1mm and 5mm lines)
8
+ - Column guide overlay
9
+ """
10
+
11
+ STYLES_OVERLAYS = """
12
+ /* Ruler & Grid toggle button */
13
+ .btn-ruler {
14
+ padding: 6px 12px;
15
+ font-size: 13px;
16
+ }
17
+
18
+ .btn-ruler.active {
19
+ background: var(--accent-color);
20
+ color: white;
21
+ border-color: var(--accent-color);
22
+ }
23
+
24
+ /* Ruler, Grid, Column overlays */
25
+ .ruler-overlay,
26
+ .grid-overlay,
27
+ .column-overlay {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ pointer-events: none;
34
+ z-index: 5;
35
+ display: none;
36
+ }
37
+
38
+ .ruler-overlay.visible,
39
+ .grid-overlay.visible,
40
+ .column-overlay.visible {
41
+ display: block;
42
+ }
43
+
44
+ /* Ruler styles */
45
+ .ruler-line {
46
+ stroke: #ff6600;
47
+ stroke-width: 1;
48
+ }
49
+
50
+ .ruler-line-major {
51
+ stroke: #ff6600;
52
+ stroke-width: 1.5;
53
+ }
54
+
55
+ .ruler-text {
56
+ fill: #ff6600;
57
+ font-size: 10px;
58
+ font-family: monospace;
59
+ }
60
+
61
+ .ruler-bg {
62
+ fill: rgba(255, 255, 255, 0.85);
63
+ }
64
+
65
+ [data-theme="dark"] .ruler-bg {
66
+ fill: rgba(30, 30, 30, 0.85);
67
+ }
68
+
69
+ [data-theme="dark"] .ruler-line,
70
+ [data-theme="dark"] .ruler-line-major {
71
+ stroke: #ff9944;
72
+ }
73
+
74
+ [data-theme="dark"] .ruler-text {
75
+ fill: #ff9944;
76
+ }
77
+
78
+ /* Grid styles */
79
+ .grid-line-1mm {
80
+ stroke: rgba(100, 100, 255, 0.2);
81
+ stroke-width: 0.5;
82
+ }
83
+
84
+ .grid-line-5mm {
85
+ stroke: rgba(100, 100, 255, 0.5);
86
+ stroke-width: 1;
87
+ }
88
+
89
+ [data-theme="dark"] .grid-line-1mm {
90
+ stroke: rgba(150, 150, 255, 0.2);
91
+ }
92
+
93
+ [data-theme="dark"] .grid-line-5mm {
94
+ stroke: rgba(150, 150, 255, 0.5);
95
+ }
96
+
97
+ /* Column guide styles */
98
+ .column-line {
99
+ stroke: #22cc22;
100
+ stroke-width: 2;
101
+ stroke-dasharray: 8, 4;
102
+ }
103
+
104
+ .column-text {
105
+ fill: #22cc22;
106
+ font-size: 12px;
107
+ font-family: monospace;
108
+ font-weight: bold;
109
+ }
110
+
111
+ .column-bg {
112
+ fill: rgba(255, 255, 255, 0.8);
113
+ }
114
+
115
+ [data-theme="dark"] .column-line {
116
+ stroke: #44ff44;
117
+ }
118
+
119
+ [data-theme="dark"] .column-text {
120
+ fill: #44ff44;
121
+ }
122
+
123
+ [data-theme="dark"] .column-bg {
124
+ fill: rgba(30, 30, 30, 0.8);
125
+ }
126
+ """
127
+
128
+ __all__ = ["STYLES_OVERLAYS"]
129
+
130
+ # EOF