I'm creating a floor plan with neo4j which is going to be later presented in frontend d3-backed application.
My base label is
Floor has many
OutlinePoints (attributes: x, y), which form a floor outline (graphical representation of floor).
The direction of points must be known in order to properly draw it on the frontend. Because of that I've been considering following solutions:
OutlinePointsand maintaining them on application level, so than when ordered by
order_idxwe get exact direction of the line.
Self referencing relation for
This approach seems logical when working with graph data, however it would be harder to maintain, as outline points are going to come from a front-end creator app and later be returned by REST API. Could it be beneficial in any way compared to solution 1? Also,would it be possible to create a query returning
OutlinePoints in proper order?
- The lazy way - keep outline in serialized attribute as array of (x,y) coordinates. This is probably a wrong way though, because huge attribute values should be avoided.
The same logic later applies to rooms:
Suggestions are more than welcome, as it's my first project with neo4j