@@ -33,64 +33,13 @@ function clusterDataPopulate(props) {
33
33
clusterData . name = props [ 0 ] . name ;
34
34
}
35
35
36
- //internal counter for the array
37
- let ocounter = 0 ;
38
- let icounter = 0
39
- for ( let key in atomCompObj ) {
40
-
41
- if ( props [ 0 ] . atomSelectors [ key ] ) {
42
- if ( ! clusterData . children ) {
43
- clusterData . children = [ ]
44
- }
45
- //need to handle duplicates
46
- clusterData . children . push ( { name : key } ) ;
47
-
48
- if ( props [ 0 ] . atomSelectors [ key ] . length ) {
49
- for ( let i = 0 ; i < props [ 0 ] . atomSelectors [ key ] . length ; i ++ ) {
50
- if ( ! clusterData . children [ ocounter ] . children ) {
51
- clusterData . children [ ocounter ] . children = [ ]
52
- }
53
- clusterData . children [ ocounter ] . children . push ( {
54
- name : props [ 0 ] . atomSelectors [ key ] [ i ]
55
- } )
56
- for ( let i = 0 ; i < clusterData . children [ ocounter ] . children [ icounter ] )
57
-
58
- }
59
- }
60
- outercounter ++
61
- }
36
+ //we'll first handle AtomSelectors
37
+ if ( ! Object . entries ( props [ 0 ] . atomSelectors ) . length === 0 ) {
38
+
62
39
}
63
-
64
- console . log ( clusterData )
40
+
65
41
}
66
42
67
-
68
-
69
- // if (atomCompObj[key].length) {
70
- // for (let i = 0; i < atomCompObj[key].length; i++) {
71
-
72
- // if (!memoizeObj[key]) {
73
- // memoizeObj[key] = [];
74
- // if (!clusterData.children && !props[0].atomSelectors[key]) clusterData.children = [];
75
- // clusterData.children.push({ name: key });
76
- // }
77
-
78
-
79
- // if (!memoizeObj[key].includes(atomCompObj[key][i])) {
80
- // if (!clusterData.children[counter].children)
81
- // clusterData.children[counter].children = [];
82
- // clusterData.children[counter].children.push({
83
- // name: atomCompObj[key][i],
84
- // });
85
- // }
86
- // memoizeObj[key].push(atomCompObj[key][i]);
87
- // }
88
- // }
89
- // counter++;
90
- // }
91
- // console.log(clusterData)
92
-
93
-
94
43
function reorganizedCompObj ( props ) {
95
44
let atomsComponentObj = props [ 0 ] . atomsComponents ;
96
45
let reorganizedCompObj = { } ;
@@ -107,22 +56,6 @@ function reorganizedCompObj(props) {
107
56
return reorganizedCompObj ;
108
57
}
109
58
110
- function reorganizedFamObj ( props ) {
111
- let atomsComponentObj = props [ 0 ] . atomsComponents ;
112
- let reorganizedCompObj = { } ;
113
-
114
- for ( const key in atomsComponentObj ) {
115
- for ( let i = 0 ; i < atomsComponentObj [ key ] . length ; i ++ ) {
116
- if ( ! reorganizedCompObj [ atomsComponentObj [ key ] [ i ] ] ) {
117
- reorganizedCompObj [ atomsComponentObj [ key ] [ i ] ] = [ key ] ;
118
- } else {
119
- reorganizedCompObj [ atomsComponentObj [ key ] [ i ] ] . push ( key ) ;
120
- }
121
- }
122
- }
123
- return reorganizedCompObj ;
124
- }
125
-
126
59
function Node ( { node } ) {
127
60
const isRoot = node . depth === 0 ;
128
61
const isParent = ! ! node . children ;
0 commit comments