Spaces:
Sleeping
Sleeping
merging self assessments (hidden) and responsiveness
Browse files- src/components/Sankey.tsx +4 -5
- src/components/itemList.tsx +2 -2
- src/index.css +22 -4
src/components/Sankey.tsx
CHANGED
|
@@ -5,7 +5,7 @@ import type { HeatmapProps as SankeyDiagramProps } from '../types'; // Reuse the
|
|
| 5 |
const SankeyDiagram: React.FC<SankeyDiagramProps> = ({ matrix, judge1, judge2, onCellClick }) => {
|
| 6 |
// --- Refs and State for Responsiveness ---
|
| 7 |
const containerRef = useRef<HTMLDivElement>(null);
|
| 8 |
-
const [dimensions, setDimensions] = useState({ width:
|
| 9 |
|
| 10 |
// --- Effect to measure container size ---
|
| 11 |
useEffect(() => {
|
|
@@ -22,7 +22,6 @@ const SankeyDiagram: React.FC<SankeyDiagramProps> = ({ matrix, judge1, judge2, o
|
|
| 22 |
observer.observe(currentRef);
|
| 23 |
}
|
| 24 |
|
| 25 |
-
// Cleanup function to disconnect the observer when the component unmounts
|
| 26 |
return () => {
|
| 27 |
if (currentRef) {
|
| 28 |
observer.unobserve(currentRef);
|
|
@@ -31,9 +30,9 @@ const SankeyDiagram: React.FC<SankeyDiagramProps> = ({ matrix, judge1, judge2, o
|
|
| 31 |
}, []);
|
| 32 |
|
| 33 |
// --- Layout Constants ---
|
| 34 |
-
const NODE_WIDTH = 0;
|
| 35 |
const NODE_GAP = 10; // Vertical gap between nodes
|
| 36 |
-
const PADDING = { top: 0, bottom: 0, left: 10, right: 10 };
|
| 37 |
|
| 38 |
// --- Calculation Logic inside useMemo ---
|
| 39 |
const sankeyData = useMemo(() => {
|
|
@@ -189,7 +188,7 @@ const SankeyDiagram: React.FC<SankeyDiagramProps> = ({ matrix, judge1, judge2, o
|
|
| 189 |
))}
|
| 190 |
</g>
|
| 191 |
|
| 192 |
-
{/*
|
| 193 |
<g>
|
| 194 |
{sankeyData.nodes.map(node => (
|
| 195 |
<g key={node.id}>
|
|
|
|
| 5 |
const SankeyDiagram: React.FC<SankeyDiagramProps> = ({ matrix, judge1, judge2, onCellClick }) => {
|
| 6 |
// --- Refs and State for Responsiveness ---
|
| 7 |
const containerRef = useRef<HTMLDivElement>(null);
|
| 8 |
+
const [dimensions, setDimensions] = useState({ width: 1, height: 1 });
|
| 9 |
|
| 10 |
// --- Effect to measure container size ---
|
| 11 |
useEffect(() => {
|
|
|
|
| 22 |
observer.observe(currentRef);
|
| 23 |
}
|
| 24 |
|
|
|
|
| 25 |
return () => {
|
| 26 |
if (currentRef) {
|
| 27 |
observer.unobserve(currentRef);
|
|
|
|
| 30 |
}, []);
|
| 31 |
|
| 32 |
// --- Layout Constants ---
|
| 33 |
+
const NODE_WIDTH = 0; // padding on both sides of the edges
|
| 34 |
const NODE_GAP = 10; // Vertical gap between nodes
|
| 35 |
+
const PADDING = { top: 0, bottom: 0, left: 10, right: 10 }; // Padding around the SVG
|
| 36 |
|
| 37 |
// --- Calculation Logic inside useMemo ---
|
| 38 |
const sankeyData = useMemo(() => {
|
|
|
|
| 188 |
))}
|
| 189 |
</g>
|
| 190 |
|
| 191 |
+
{/* Removing nodes for now (no real value add but keeping it commented-out for later)
|
| 192 |
<g>
|
| 193 |
{sankeyData.nodes.map(node => (
|
| 194 |
<g key={node.id}>
|
src/components/itemList.tsx
CHANGED
|
@@ -134,7 +134,7 @@ const AssessmentItem: React.FC<AssessmentItemProps> = memo(({
|
|
| 134 |
)}
|
| 135 |
</div>
|
| 136 |
|
| 137 |
-
<div className="third-assessment">
|
| 138 |
<div>
|
| 139 |
<h4>Provide Human Assessment</h4>
|
| 140 |
<p className="assessment-hint">Click to copy assessment tuple for response ID: <code>{item.r_uuid}</code></p>
|
|
@@ -170,7 +170,7 @@ const AssessmentItem: React.FC<AssessmentItemProps> = memo(({
|
|
| 170 |
{copied ? '✓ Copied!' : 'Copy'}
|
| 171 |
</button>
|
| 172 |
</div>
|
| 173 |
-
)}
|
| 174 |
</div>
|
| 175 |
);
|
| 176 |
});
|
|
|
|
| 134 |
)}
|
| 135 |
</div>
|
| 136 |
|
| 137 |
+
{/* <div className="third-assessment">
|
| 138 |
<div>
|
| 139 |
<h4>Provide Human Assessment</h4>
|
| 140 |
<p className="assessment-hint">Click to copy assessment tuple for response ID: <code>{item.r_uuid}</code></p>
|
|
|
|
| 170 |
{copied ? '✓ Copied!' : 'Copy'}
|
| 171 |
</button>
|
| 172 |
</div>
|
| 173 |
+
)} */}
|
| 174 |
</div>
|
| 175 |
);
|
| 176 |
});
|
src/index.css
CHANGED
|
@@ -87,6 +87,7 @@ body {
|
|
| 87 |
|
| 88 |
/* Filter Bar Styles */
|
| 89 |
.filter-bar {
|
|
|
|
| 90 |
background: var(--bg-color);
|
| 91 |
border-radius: 16px;
|
| 92 |
padding: 2rem;
|
|
@@ -102,6 +103,7 @@ body {
|
|
| 102 |
display: flex;
|
| 103 |
flex-direction: column;
|
| 104 |
gap: 0.5rem;
|
|
|
|
| 105 |
}
|
| 106 |
|
| 107 |
.filter-label {
|
|
@@ -768,10 +770,10 @@ h4 {
|
|
| 768 |
|
| 769 |
/* Responsive Design */
|
| 770 |
@media (max-width: 1200px) {
|
| 771 |
-
.charts-container {
|
| 772 |
grid-template-columns: 1fr;
|
| 773 |
height: auto;
|
| 774 |
-
}
|
| 775 |
|
| 776 |
.heatmap-container {
|
| 777 |
width: 100%;
|
|
@@ -780,6 +782,21 @@ h4 {
|
|
| 780 |
}
|
| 781 |
}
|
| 782 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 783 |
@media (max-width: 768px) {
|
| 784 |
.main-content {
|
| 785 |
padding: 1rem;
|
|
@@ -790,7 +807,8 @@ h4 {
|
|
| 790 |
}
|
| 791 |
|
| 792 |
.filter-bar {
|
| 793 |
-
|
|
|
|
| 794 |
padding: 1.5rem;
|
| 795 |
}
|
| 796 |
|
|
@@ -872,4 +890,4 @@ select:focus-visible {
|
|
| 872 |
border-color: #10b981;
|
| 873 |
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
|
| 874 |
}
|
| 875 |
-
}
|
|
|
|
| 87 |
|
| 88 |
/* Filter Bar Styles */
|
| 89 |
.filter-bar {
|
| 90 |
+
position:relative;
|
| 91 |
background: var(--bg-color);
|
| 92 |
border-radius: 16px;
|
| 93 |
padding: 2rem;
|
|
|
|
| 103 |
display: flex;
|
| 104 |
flex-direction: column;
|
| 105 |
gap: 0.5rem;
|
| 106 |
+
max-width: 100%;
|
| 107 |
}
|
| 108 |
|
| 109 |
.filter-label {
|
|
|
|
| 770 |
|
| 771 |
/* Responsive Design */
|
| 772 |
@media (max-width: 1200px) {
|
| 773 |
+
/* .charts-container {
|
| 774 |
grid-template-columns: 1fr;
|
| 775 |
height: auto;
|
| 776 |
+
} */
|
| 777 |
|
| 778 |
.heatmap-container {
|
| 779 |
width: 100%;
|
|
|
|
| 782 |
}
|
| 783 |
}
|
| 784 |
|
| 785 |
+
|
| 786 |
+
@media (max-width: 1000px) {
|
| 787 |
+
.charts-container {
|
| 788 |
+
flex-direction: column;
|
| 789 |
+
height:auto;
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
+
.waterfall-container, .sankey-container, .heatmap-container {
|
| 793 |
+
width: 100%;
|
| 794 |
+
max-width: none;
|
| 795 |
+
height: 500px;
|
| 796 |
+
}
|
| 797 |
+
|
| 798 |
+
}
|
| 799 |
+
|
| 800 |
@media (max-width: 768px) {
|
| 801 |
.main-content {
|
| 802 |
padding: 1rem;
|
|
|
|
| 807 |
}
|
| 808 |
|
| 809 |
.filter-bar {
|
| 810 |
+
display: flex;
|
| 811 |
+
flex-direction: column;
|
| 812 |
padding: 1.5rem;
|
| 813 |
}
|
| 814 |
|
|
|
|
| 890 |
border-color: #10b981;
|
| 891 |
box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
|
| 892 |
}
|
| 893 |
+
}
|