monicahq / monica

Personal CRM. Remember everything about your friends, family and business relationships.
https://beta.monicahq.com
GNU Affero General Public License v3.0
21.4k stars 2.13k forks source link

Relationship Graphs #357

Open cybershambles opened 7 years ago

cybershambles commented 7 years ago

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

dancyfits commented 7 years ago

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

lathomas64 commented 7 years ago

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.

sid3windr commented 7 years ago

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!

cybershambles commented 7 years ago

:D

djaiss commented 6 years ago

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

dancyfits commented 6 years ago

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

turtles2 commented 6 years ago

@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.

dancyfits commented 6 years ago

@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.

djaiss commented 6 years ago

@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 😀

turtles2 commented 6 years ago

@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

dancyfits commented 6 years ago

@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

cybershambles commented 6 years ago

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.

dancyfits commented 6 years ago

@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.

ghost commented 5 years ago

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:

MrModest commented 7 months ago

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