syntaxmatrix 2.5.6.1__py3-none-any.whl → 2.5.8__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.
@@ -15,7 +15,7 @@
15
15
  position: fixed;
16
16
  top: 0; left: 0;
17
17
  width: 200px; height: 100vh;
18
- background: #f1f4f7;
18
+ background: #a3a4a5ff;
19
19
  border-right: 1px solid #ccc;
20
20
  padding: 26px 10px 10px 14px;
21
21
  box-sizing: border-box;
@@ -56,7 +56,7 @@
56
56
  min-height: 100vh;
57
57
  box-sizing: border-box;
58
58
  overflow-x: auto;
59
- background: #f8f9fb;
59
+ background: #dff0f5ff;
60
60
  font-size: clamp(0.98rem, 2vw, 1.07rem);
61
61
  }
62
62
  .dashboard-tabs {
@@ -85,7 +85,7 @@
85
85
  top: 2px;
86
86
  }
87
87
  .dashboard-content {
88
- background: #fff;
88
+ background: #bbbbbd;
89
89
  width: 100%;
90
90
  padding: 10px;
91
91
  border-radius: 0 0 10px 10px;
@@ -95,6 +95,10 @@
95
95
  overflow-x: auto;
96
96
  margin-right: 1vw;
97
97
  }
98
+
99
+ textarea#askai{
100
+ background: #e5e5e5cd;
101
+ }
98
102
 
99
103
  .smx-table {
100
104
  padding: clamp(3px, 1vw, 9px) clamp(4px, 2vw, 13px);
@@ -156,31 +160,18 @@
156
160
  padding:0.2rem;
157
161
  }
158
162
  .del-btn:hover { opacity:0.8; background:red; }
159
-
160
- /* full-screen overlay */
161
- #loader-overlay {
162
- position: fixed;
163
- top: 0; left: 0;
164
- width: 100%; height: 100%;
165
- background: rgba(241, 235, 235, 0);
166
- display: none;
163
+
164
+ /* Make the Explore Data submit button compact instead of full-width */
165
+ .eda-submit-btn {
166
+ align-self: flex-start; /* stop flex from stretching it to 100% */
167
+ width: auto; /* shrink to content */
168
+ min-width: 7.5rem; /* tweak this if you want it smaller/larger */
169
+ padding: 6px 16px; /* a bit tighter than the global button */
170
+ display: inline-flex;
167
171
  align-items: center;
168
172
  justify-content: center;
169
- z-index: 9999;
170
- }
171
- /* simple spinner */
172
- .loader {
173
- border: 8px solid #eee;
174
- border-top: 8px solid #333;
175
- border-radius: 50%;
176
- width: 60px; height: 60px;
177
- animation: spin 1s linear infinite;
178
- }
179
- @keyframes spin {
180
- 0% { transform: rotate(0deg); }
181
- 100% { transform: rotate(360deg); }
182
173
  }
183
-
174
+
184
175
  /* --- Mobile fixes --- */
185
176
  .dashboard-content img,
186
177
  .dashboard-content canvas,
@@ -590,29 +581,121 @@
590
581
  .eda-card h3{ color: #1f2937 !important; }
591
582
  .smx-stat h4{ color: #64748b !important; }
592
583
  </style>
584
+ <style>
585
+ div.li > li {
586
+ margin-left: 35px;
587
+ }
588
+ /* 1. Style the arrow specifically */
589
+ .toggle-arrow {
590
+ display: inline-block; /* CRITICAL: Allows the element to rotate */
591
+ transition: transform 0.2s; /* Makes the rotation smooth */
592
+ margin-right: 6px; /* Spacing between arrow and text */
593
+ }
594
+
595
+ /* 2. Rotate and color when the menu is OPEN */
596
+ details[open] summary .toggle-arrow {
597
+ transform: rotate(90deg); /* Rotates the arrow downwards */
598
+ color: #007acc; /* Changes color to blue */
599
+ }
600
+
601
+ /* 3. (Optional) Remove default browser markers to avoid double arrows */
602
+ details > summary {
603
+ list-style: none;
604
+ }
605
+ details > summary::-webkit-details-marker {
606
+ display: none;
607
+ }
608
+
609
+ /* Spinner that sits inside the Explore Data submit button */
610
+ .eda-btn-spinner {
611
+ display: none;
612
+ width: 1.1rem;
613
+ height: 1.1rem;
614
+ border-radius: 999px;
615
+ border: 2px solid currentColor;
616
+ border-top-color: transparent;
617
+ border-right-color: transparent;
618
+ animation: edaBtnSpin 0.7s linear infinite;
619
+ margin-left: 0; /* was 0.5rem */
620
+ vertical-align: middle;
621
+ box-sizing: border-box;
622
+ }
623
+ .eda-btn-label {
624
+ display: inline-block;
625
+ margin-right: 0.5rem; /* space between text and spinner when both are visible */
626
+ }
627
+
628
+ /* While loading: hide the label, show the spinner */
629
+ .eda-btn-loading .eda-btn-label {
630
+ display: none; /* keeps button width stable */
631
+ }
632
+
633
+ .eda-btn-loading .eda-btn-spinner {
634
+ display: inline-block;
635
+ }
636
+
637
+ @keyframes edaBtnSpin {
638
+ to {
639
+ transform: rotate(360deg);
640
+ }
641
+ }
642
+ .sidebar-links {
643
+ margin-top: 22px;
644
+ }
645
+ .sidebar-links a {
646
+ display: block;
647
+ padding: 12px 10px 12px 0;
648
+ color: #333;
649
+ text-decoration: none;
650
+ font-size: clamp(0.93rem, 2vw, 1.08rem);
651
+ border-radius: 6px;
652
+ margin-bottom: 6px;
653
+ transition: background 0.2s, color 0.2s;
654
+ }
655
+ .sidebar-links a.active,
656
+ .sidebar-links a:hover {
657
+ background: #e0e5ee;
658
+ color: #007acc;
659
+ font-weight: bold;
660
+ }
661
+ /* Sub-links under a main section (e.g. Explore → Resize dataset) */
662
+ .sidebar-links a.sidebar-sub-link {
663
+ font-size: clamp(0.80rem, 1.4vw, 0.95rem); /* smaller than main items */
664
+ padding: 6px 10px 6px 14px; /* slight indent to show hierarchy */
665
+ margin-bottom: 4px;
666
+ opacity: 0.95;
667
+ }
668
+
669
+ /* Optional: visual cue arrow for sub-items */
670
+ .sidebar-links a.sidebar-sub-link::before {
671
+ content: "↳ ";
672
+ font-size: 0.8em;
673
+ opacity: 0.7;
674
+ }
675
+ </style>
593
676
 
594
677
  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
595
678
  </head>
596
679
  <body>
597
680
  <div id="sidebarScrim" class="sidebar-scrim" aria-hidden="true"></div>
598
- <div id="loader-overlay">
599
- <div class="loader"></div>
600
- </div>
601
681
  <div class="dashboard-sidebar">
602
682
  <button class="sidebar-close" aria-label="Close menu">✕</button>
603
683
  <h2>ML&nbsp;Lab</h2>
604
684
  <a href="/">return to home</a>
605
685
  <div class="sidebar-links">
606
686
  <a href="/dashboard?section=explore"{% if section == 'explore' %} class="active"{% endif %}>Explore</a>
607
-
687
+
688
+ <!-- Explore subsets -->
689
+ <a href="{{ url_for('dataset_resize') }}" class="sidebar-sub-link">Resize dataset</a>
690
+
608
691
  <!-- Future: more links here -->
609
692
  </div>
693
+
610
694
  </div>
611
695
  <div class="dashboard-main">
612
696
  <button id="sidebarToggle" class="sidebar-toggle" aria-label="Open menu"></button>
613
697
  <ul class="dashboard-tabs">
614
- <li class="{{ 'active' if section == 'explore' else '' }}"><a href="/dashboard?section=explore">Explore</a></li>
615
-
698
+ <li class="{{ 'active' if section == 'explore' else '' }}"><a href="/dashboard?section=explore">Explore</a></li>
616
699
  </ul>
617
700
  <div class="dashboard-content">
618
701
  <div class="explore-card">
@@ -663,11 +746,18 @@
663
746
  <h2>Explore Data</h2>
664
747
  <form id="form-askai" method="post" action="/dashboard?section=explore" style="margin-top:5px;padding:12px; border:1px solid grey;border-radius:5px;width:70vw;">
665
748
  <input type="hidden" name="dataset" value="{{ selected_dataset }}">
666
- <label for="askai"><strong>Ask smxAI:</strong></label>
667
- <textarea id="askai" name="askai_question" type="text" rows="4"
668
- style="position:relative; width:90%; padding:8px; font-size:0.8em; border-radius:8px;"
669
- placeholder="Ask me about {{ (selected_dataset or 'your dataset. Upload it first.').replace('_', ' ').replace('.csv', '') }}" required></textarea>
670
- <button type="submit" style="font-size:1.2rem; width:8rem; padding:4px;">Submit</button>
749
+ <label for="askai"><strong>Ask {{ smxAI }}:</strong></label>
750
+ <textarea id="askai" name="askai_question" type="text" rows="5"
751
+ style="position:relative; width:90%; padding:16px; font-size:0.8em; border-radius:8px;"
752
+ placeholder="Ask me about {{ (selected_dataset or 'your dataset\n. But upload it first.').replace('_', ' ').replace('.csv', '') }}" required></textarea>
753
+ <!-- <button type="submit" style="font-size:1.2rem; width:8rem; padding:4px;">Submit</button> -->
754
+ <button
755
+ type="submit"
756
+ class="btn btn-primary eda-submit-btn"
757
+ >
758
+ <span class="eda-btn-label">Submit</span>
759
+ <span class="eda-btn-spinner" aria-hidden="true"></span>
760
+ </button>
671
761
  </form>
672
762
  <div style="margin-bottom: 36px;">
673
763
  {% if askai_question %}
@@ -679,30 +769,35 @@
679
769
  -->
680
770
  <br><br>
681
771
  <div class="refined-qblock">
682
- <span class="refined-q-label"><b>My Thought Process:</b></span><br>
683
- <span class="refined-q">{{ refined_question|safe }}</span>
684
- </div><br>
685
- <div class="refined-qblock">
686
- {% if tasks %}
687
- <b>Tasks Performed: </b><br>
688
- {% for task in tasks %}
689
- <span class="refined-q">- {{ task }}</span><br>
690
- {% endfor %}
691
- {% endif %}
692
- </div><br>
693
- {% if llm_usage %}
694
- <div class="refined-qblock">
695
- <!-- <b>LLM: </b><span>{{ llm_usage.provider }} | {{ llm_usage.model }}</span><br> -->
696
- <b>Token Usage: </b>
697
- <li>- Input Tokens: {{ llm_usage.input_tokens }}</li>
698
- <li>- Output Tokens: {{ llm_usage.output_tokens }}</li>
699
- <li>- Total Tokens: {{ llm_usage.total_tokens }}</li>
700
- </ul>
701
- </div>
702
- {% endif %}
772
+ <details>
773
+ <summary class="refined-q-label" style="cursor: pointer; list-style: none;">
774
+ <span class="toggle-arrow">▶</span>
775
+ <b>Thought Process</b>
776
+ </summary>
777
+ <div class="li" style="margin-top: 10px; padding-left: 14px; border-left: 3px solid #e0e5ee;">
778
+ <span class="refined-q">{{ refined_question|safe }}</span>
779
+ <br><br>
780
+ {% if tasks %}
781
+ <b>Tasks Performed: </b>
782
+ {% for task in tasks %}
783
+ <li>{{ task.replace('_', ' ').capitalize() }}</li>
784
+ {% endfor %}
785
+ {% endif %}
786
+ <br><br>
787
+ {% if llm_usage %}
788
+ <b>LLM: </b><span>{{ llm_usage.provider }} | {{ llm_usage.model }}</span><br>
789
+ <b>Token Usage: </b>
790
+ <li>Input Tokens: {{ llm_usage.input_tokens }}</li>
791
+ <li>Output Tokens: {{ llm_usage.output_tokens }}</li>
792
+ <li>Total Tokens: {{ llm_usage.total_tokens }}</li>
793
+ </div>
794
+ {% endif %}
795
+ </div>
796
+ </details>
703
797
  {% endif %}
704
798
  {% if ai_outputs %}
705
799
  <div class="d-flex align-items-center justify-content-between" style="margin: 12px;">
800
+ <br>
706
801
  <h3 class="m-0">Result</h3>
707
802
  {% for html_block in ai_outputs %}
708
803
  <div class="ai-output" style="margin-bottom:18px;overflow-x:auto; max-width:100%;">
@@ -755,31 +850,31 @@
755
850
  </div>
756
851
  </div>
757
852
  <script>
758
- async function copyCode(btn){
759
- const pre = btn.parentElement.querySelector('pre');
760
- if(!pre) return;
761
- const text = pre.innerText;
762
-
763
- try {
764
- if (navigator.clipboard && navigator.clipboard.writeText) {
765
- await navigator.clipboard.writeText(text);
766
- } else {
767
- // fallback
768
- const range = document.createRange();
769
- range.selectNodeContents(pre);
770
- const sel = window.getSelection();
771
- sel.removeAllRanges(); sel.addRange(range);
772
- document.execCommand('copy');
773
- sel.removeAllRanges();
774
- }
775
- btn.textContent = 'Copied!';
776
- setTimeout(()=>btn.textContent='Copy', 1200);
777
- } catch(e){
778
- btn.textContent = 'Failed';
779
- setTimeout(()=>btn.textContent='Copy', 1200);
853
+ async function copyCode(btn){
854
+ const pre = btn.parentElement.querySelector('pre');
855
+ if(!pre) return;
856
+ const text = pre.innerText;
857
+
858
+ try {
859
+ if (navigator.clipboard && navigator.clipboard.writeText) {
860
+ await navigator.clipboard.writeText(text);
861
+ } else {
862
+ // fallback
863
+ const range = document.createRange();
864
+ range.selectNodeContents(pre);
865
+ const sel = window.getSelection();
866
+ sel.removeAllRanges(); sel.addRange(range);
867
+ document.execCommand('copy');
868
+ sel.removeAllRanges();
869
+ }
870
+ btn.textContent = 'Copied!';
871
+ setTimeout(()=>btn.textContent='Copy', 1200);
872
+ } catch(e){
873
+ btn.textContent = 'Failed';
874
+ setTimeout(()=>btn.textContent='Copy', 1200);
875
+ }
780
876
  }
781
- }
782
- </script>
877
+ </script>
783
878
  <script>
784
879
  function toggleCodeCell(link) {
785
880
  var cell = link.nextElementSibling;
@@ -792,6 +887,7 @@
792
887
  link.querySelector("span").innerText = "Show Code";
793
888
  }
794
889
  }
890
+
795
891
  function copyCodeToClipboard(btn) {
796
892
  var pre = btn.parentElement.querySelector("pre");
797
893
  if (!pre) return;
@@ -810,13 +906,36 @@
810
906
  }
811
907
  sel.removeAllRanges();
812
908
  }
813
-
814
- document.addEventListener("DOMContentLoaded", () => {
815
- const form = document.getElementById("form-askai");
816
- const overlay = document.getElementById("loader-overlay");
817
- form.addEventListener("submit", () => {
818
- overlay.style.display = "flex";
909
+
910
+ document.addEventListener("DOMContentLoaded", function () {
911
+ var form = document.getElementById("form-askai");
912
+ if (!form) return;
913
+
914
+ var submitBtn = form.querySelector(".eda-submit-btn");
915
+ if (!submitBtn) return;
916
+
917
+ // When the form actually submits, show the spinner and disable the button
918
+ form.addEventListener("submit", function () {
919
+ submitBtn.classList.add("eda-btn-loading");
920
+ submitBtn.disabled = true;
921
+ // IMPORTANT: no preventDefault here – the browser/htmx still submits normally
819
922
  });
923
+
924
+ // If htmx is used on this form, reset the spinner once the request completes or errors
925
+ if (window.htmx) {
926
+ form.addEventListener("htmx:afterRequest", function () {
927
+ submitBtn.classList.remove("eda-btn-loading");
928
+ submitBtn.disabled = false;
929
+ });
930
+ form.addEventListener("htmx:responseError", function () {
931
+ submitBtn.classList.remove("eda-btn-loading");
932
+ submitBtn.disabled = false;
933
+ });
934
+ form.addEventListener("htmx:sendError", function () {
935
+ submitBtn.classList.remove("eda-btn-loading");
936
+ submitBtn.disabled = false;
937
+ });
938
+ }
820
939
  });
821
940
  </script>
822
941
  <script>