monica icon indicating copy to clipboard operation
monica copied to clipboard

Relationship Graphs

Open cybershambles opened this issue 7 years ago • 15 comments

Imagine I Added person X, added person Y, added Child Z.... I'd love to be able to link there people together automatically as people

then have them displayed as as graph.


also, you cannot link existing people image

Doesn't seem to actually link the people.. just added the text field? image

cybershambles avatar Jun 20 '17 08:06 cybershambles

This is the lowest hanging fruit in my opinion. Having this feature would do the most in making Monica a complete product, for me.

dancyfits avatar Jul 19 '17 06:07 dancyfits

yes was very dissapointed that I could not have a significant other listed as a separate person instead of basically a note on the person.

lathomas64 avatar Jul 24 '17 20:07 lathomas64

The linking of contacts is now implemented and working, this issue should be (and remain?) only for the graph part :) Would also love to see this!

sid3windr avatar Aug 19 '17 20:08 sid3windr

:D

cybershambles avatar Aug 22 '17 04:08 cybershambles

Are you aware of a tool that would help me build those relationship graphs?

djaiss avatar Nov 10 '17 22:11 djaiss

https://github.com/lazychaser/laravel-nestedset I'm not up to date with the PHP scene, but that looks pretty helpful! Maybe at least a good an example to work from.

Edit: Although, the above seems more suited for family relationships and not so great for work, friend networks. Maybe this? https://github.com/clue/graph

And if you wanna get really into it: https://en.wikipedia.org/wiki/Graph_theory

I guess it really depends on how your database is setup. Network graphs and d3.js seem like the things to google. http://bl.ocks.org/jose187/4733747

dancyfits avatar Nov 11 '17 00:11 dancyfits

@djaiss The graph part of this interests me. I am willing to find the tool and build them. I just need some guidance on what we are looking for visually.

turtles2 avatar Apr 15 '18 02:04 turtles2

@turtles2 It's been a while since I've looked at this project, but I'd be willing to play around with the current ui for a few days and come up with a UI/UX mockup if any code contributors are interested. I can't remember what my line of thinking was in my last comment, but GraphQL comes to mind now. Wonder if that could make things easier.

dancyfits avatar Apr 15 '18 02:04 dancyfits

@dancyfits imho GraphQL is unrelated with the relationship graph concept. GraphQL is an alternative to traditional REST APIs, and the work to implement it in Monica would take months and months.

@turtles2 @dancyfits before finding out how it should look like, we should define what it would do, considering the current structure of the relationships between contacts. Also I need to be convinced that we need this feature, because I'm not sure what it would bring 😀

djaiss avatar Apr 15 '18 11:04 djaiss

@djaiss My interest in implementing this is due to the technical nature of it. I was hoping for guidance from you and others on what it should do precisely

turtles2 avatar Apr 15 '18 14:04 turtles2

@djaiss This type of problem is one of the main reasons GraphQL was built in the first place: https://dev-blog.apollodata.com/explaining-graphql-connections-c48b7c3d6976#de1c

GraphQL is not an alternative for REST APIs: http://graphql.org/blog/rest-api-graphql-wrapper/

Here's a video of a guy implementing GraphQL over Django, Rails, and Node in 30 minutes: https://www.youtube.com/watch?time_continue=900&v=UBGzsb2UkeY

Here's the GraphQL spec written for PHP: https://webonyx.github.io/graphql-php/

Here's a GraphQL wrapper for Laravel: https://github.com/rebing/graphql-laravel

dancyfits avatar Apr 15 '18 23:04 dancyfits

I'd also like to be able to tag people into groups.. I have social circles.. like a workplace or hobby or group of friends.

cybershambles avatar Apr 17 '18 01:04 cybershambles

@cybershambles That you can do. On a contact's page, "Edit tag" under their name. Tags will show up on the right of the contact list, clicking on one will filter the list to just the people with that tag.

dancyfits avatar Apr 17 '18 01:04 dancyfits

Agree that GraphQL is not relevant to this issue -- it's a tool for building APIs, but this issue is about visualizing a graph.

I've used this front-end graph framework in the past, and it's pretty solid and well-maintained: http://js.cytoscape.org/

If Monica already has API endpoints to get all contacts and all relationships, then visualizing such a graph isn't a very large task. Do these endpoints exist?

Just visualizing the social graph is the MVP, but other neat feature could be:

  • Dragging a line between people on the graph, then getting a small popup to select the relationship type. This'd be a fast way to enter relationships!
  • The ability to filter nodes by tag, so you can view only people tagged with "family" for a family-tree-like view

ghost avatar Sep 01 '19 12:09 ghost

Maybe this script will be somehow helpful in implementing a built-in feature: https://github.com/jmcker/monica2neo4j

MrModest avatar Jan 28 '24 14:01 MrModest