There are many possibilities for achieving that effect.
Usually the first filtering happens when querying the database – deciding what tables and rows to send to the browser.
Another step in the filtering process happens when you construct the Model. You need to decide exactly which node data objects you include in the Model.nodeDataArray and which link data objects you include in the GraphLinksModel.linkDataArray.
Once the diagram has its model, you have the opportunity to show or hide any number of Nodes and Links. Normally, changing the visible property of a node or link will invalidate the layout so that it is performed again at the end of the transaction. (Remember to make all changes to an existing diagram within a single transaction.)
But you talk about not changing the value of Part.visible. Does that mean that you want to do your filtering of/in the model data? That’s fine. Could you please be more specific about the problem you have encountered?