@@ -186,9 +186,7 @@ export const filterData = (
186186 const entityNode = allNodes . filter ( ( node ) => ! node . labels . includes ( 'Document' ) && ! node . labels . includes ( 'Chunk' ) ) ;
187187 filteredNodes = entityNode ? entityNode : [ ] ;
188188 // @ts -ignore
189- filteredRelations = allRelationships . filter (
190- ( rel ) => ! [ 'PART_OF' , 'FIRST_CHUNK' , 'HAS_ENTITY' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption )
191- ) ;
189+ filteredRelations = allRelationships . filter ( ( rel ) => ! [ 'PART_OF' , 'FIRST_CHUNK' , 'HAS_ENTITY' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption ) ) ;
192190 filteredScheme = Object . fromEntries ( entityTypes . map ( ( key ) => [ key , scheme [ key ] ] ) ) as Scheme ;
193191 } else if ( ! graphType . includes ( 'Document' ) && ! graphType . includes ( 'Entities' ) && graphType . includes ( 'Chunk' ) ) {
194192 // Only Chunk
@@ -200,22 +198,16 @@ export const filterData = (
200198 } else if ( graphType . includes ( 'Document' ) && graphType . includes ( 'Entities' ) && ! graphType . includes ( 'Chunk' ) ) {
201199 // Document + Entity
202200 // @ts -ignore
203- filteredNodes = allNodes . filter (
204- ( node ) =>
205- node . labels . includes ( 'Document' ) || ( ! node . labels . includes ( 'Document' ) && ! node . labels . includes ( 'Chunk' ) )
201+ filteredNodes = allNodes . filter ( ( node ) => node . labels . includes ( 'Document' ) || ( ! node . labels . includes ( 'Document' ) && ! node . labels . includes ( 'Chunk' ) )
206202 ) ;
207203 // @ts -ignore
208- filteredRelations = allRelationships . filter (
209- ( rel ) => ! [ 'PART_OF' , 'FIRST_CHUNK' , 'HAS_ENTITY' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption )
210- ) ;
204+ filteredRelations = allRelationships . filter ( ( rel ) => ! [ 'PART_OF' , 'FIRST_CHUNK' , 'HAS_ENTITY' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption ) ) ;
211205 } else if ( graphType . includes ( 'Document' ) && ! graphType . includes ( 'Entities' ) && graphType . includes ( 'Chunk' ) ) {
212206 // Document + Chunk
213207 // @ts -ignore
214208 filteredNodes = allNodes . filter ( ( node ) => node . labels . includes ( 'Document' ) || node . labels . includes ( 'Chunk' ) ) ;
215209 // @ts -ignore
216- filteredRelations = allRelationships . filter ( ( rel ) =>
217- [ 'PART_OF' , 'FIRST_CHUNK' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption )
218- ) ;
210+ filteredRelations = allRelationships . filter ( ( rel ) => [ 'PART_OF' , 'FIRST_CHUNK' , 'SIMILAR' , 'NEXT_CHUNK' ] . includes ( rel . caption ) ) ;
219211 filteredScheme = { Document : scheme . Document , Chunk : scheme . Chunk } ;
220212 } else if ( ! graphType . includes ( 'Document' ) && graphType . includes ( 'Entities' ) && graphType . includes ( 'Chunk' ) ) {
221213 // Chunk + Entity
0 commit comments