syd 1.1.0__py3-none-any.whl → 1.2.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.
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Update the status display
3
+ */
4
+ export function updateStatus(message) {
5
+ const statusElement = document.getElementById('status-display');
6
+ if (statusElement) {
7
+ statusElement.innerHTML = `<b>Syd Controls</b> <span class="status-message">Status: ${message}</span>`;
8
+ }
9
+ }
10
+
11
+ /**
12
+ * Format parameter name as a label (capitalize each word)
13
+ */
14
+ export function formatLabel(name) {
15
+ return name
16
+ .replace(/_/g, ' ') // Replace underscores with spaces
17
+ .replace(/\w\S*/g, function(txt) {
18
+ return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
19
+ });
20
+ }
21
+
22
+ /**
23
+ * Create and cache the slow loading image
24
+ */
25
+ let slowLoadingImageCache = null; // Cache for slow loading image
26
+ export function createSlowLoadingImage() {
27
+ if (slowLoadingImageCache) {
28
+ return slowLoadingImageCache;
29
+ }
30
+
31
+ const canvas = document.createElement('canvas');
32
+ canvas.width = 1200;
33
+ canvas.height = 900;
34
+ const ctx = canvas.getContext('2d');
35
+
36
+ // Fill background
37
+ ctx.fillStyle = '#ffffff';
38
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
39
+
40
+ // Add loading text
41
+ ctx.fillStyle = '#000000';
42
+ ctx.font = 'bold 16px Arial';
43
+ ctx.textAlign = 'center';
44
+ ctx.textBaseline = 'middle';
45
+ ctx.fillText('waiting for next figure...', canvas.width/2, canvas.height/2);
46
+
47
+ slowLoadingImageCache = canvas.toDataURL();
48
+ return slowLoadingImageCache;
49
+ }