@@ -19,9 +19,6 @@ import {
1919 Triangle ,
2020 ArrowDown ,
2121 Flame ,
22- TrendingUp ,
23- Briefcase ,
24- Activity ,
2522 Layers ,
2623 Sparkles ,
2724 ListTodo ,
@@ -1095,52 +1092,7 @@ export function ListView() {
10951092 setZoomLevel ( 1 ) ;
10961093 } ;
10971094
1098- // Calculate label positions to avoid overlaps
1099- const calculateLabelPositions = ( ) => {
1100- let tempCumulative = 0 ;
1101- const positions = [ ] ;
1102-
1103- for ( let i = 0 ; i < filteredData . length ; i ++ ) {
1104- const percentage = ( filteredData [ i ] . value / total ) * 100 ;
1105- const midAngle = ( tempCumulative + percentage / 2 ) * 3.6 - 90 ;
1106-
1107- // Keep radius constant for all labels - optimal distance from pie edge
1108- const labelRadius = 44 ;
1109-
1110- // Check for potential overlaps and adjust
1111- let adjustedAngle = midAngle ;
1112- const minAngleDiff = 25 ; // Minimum angle difference between labels
1113-
1114- // Check against previous labels
1115- for ( let j = 0 ; j < positions . length ; j ++ ) {
1116- const angleDiff = Math . abs ( adjustedAngle - positions [ j ] . angle ) ;
1117- if ( angleDiff < minAngleDiff && angleDiff > 0 ) {
1118- // Adjust angle to avoid overlap
1119- if ( i % 2 === 0 ) {
1120- adjustedAngle += minAngleDiff - angleDiff + 5 ;
1121- } else {
1122- adjustedAngle -= minAngleDiff - angleDiff + 5 ;
1123- }
1124- }
1125- }
1126-
1127- const labelX = 50 + labelRadius * Math . cos ( adjustedAngle * Math . PI / 180 ) ;
1128- const labelY = 50 + labelRadius * Math . sin ( adjustedAngle * Math . PI / 180 ) ;
1129-
1130- positions . push ( {
1131- angle : adjustedAngle ,
1132- x : labelX ,
1133- y : labelY ,
1134- radius : labelRadius
1135- } ) ;
1136-
1137- tempCumulative += percentage ;
1138- }
1139-
1140- return positions ;
1141- } ;
11421095
1143- const labelPositions = calculateLabelPositions ( ) ;
11441096
11451097 const createPath = ( percentage : number , startPercentage : number ) => {
11461098 const startAngle = startPercentage * 3.6 - 90 ;
@@ -1304,49 +1256,6 @@ export function ListView() {
13041256 ) ;
13051257 } ;
13061258
1307- // Bar Chart Component
1308- const BarChart = ( { data, title } : { data : Array < { label : string , value : number , color : string } > , title : string } ) => {
1309- const filteredData = data . filter ( item => item . value > 0 ) ;
1310- const maxValue = filteredData . length > 0 ? Math . max ( ...filteredData . map ( item => item . value ) ) : 0 ;
1311- if ( filteredData . length === 0 ) {
1312- return (
1313- < div className = "bg-gray-800 rounded-lg p-6 border border-gray-700" >
1314- < h3 className = "text-lg font-semibold text-white mb-4" > { title } </ h3 >
1315- < div className = "flex items-center justify-center h-48" >
1316- < div className = "text-center" >
1317- < div className = "text-gray-400 text-sm mb-2" > No data to display</ div >
1318- < div className = "text-gray-500 text-xs" > Try adjusting your filters</ div >
1319- </ div >
1320- </ div >
1321- </ div >
1322- ) ;
1323- }
1324-
1325- return (
1326- < div className = "bg-gray-800 rounded-lg p-6 border border-gray-700" >
1327- < h3 className = "text-lg font-semibold text-white mb-4" > { title } </ h3 >
1328- < div className = "space-y-3" >
1329- { filteredData . map ( ( item , index ) => (
1330- < div key = { index } className = "space-y-1" >
1331- < div className = "flex justify-between items-center" >
1332- < span className = "text-sm text-gray-300" > { item . label } </ span >
1333- < span className = "text-sm font-medium text-white" > { item . value } </ span >
1334- </ div >
1335- < div className = "w-full bg-gray-700 rounded-full h-3 overflow-hidden" >
1336- < div
1337- className = "h-full rounded-full transition-all duration-500 ease-out"
1338- style = { {
1339- width : `${ ( item . value / maxValue ) * 100 } %` ,
1340- backgroundColor : item . color
1341- } }
1342- > </ div >
1343- </ div >
1344- </ div >
1345- ) ) }
1346- </ div >
1347- </ div >
1348- ) ;
1349- } ;
13501259
13511260 // Dashboard View
13521261 const renderDashboardView = ( ) => (
0 commit comments