BenPortner / js_family_tree

An interactive family tree visualization using d3-dag
GNU General Public License v3.0
70 stars 30 forks source link

`js_family_tree` as a library #14

Open asabhaney opened 1 year ago

asabhaney commented 1 year ago

Thanks for all your work on this really great project and for making it publicly available!

Beyond a bunch of code changes, this PR - if merged in - would transition this repository into more of a library that can be installed and used as a module within other applications. My motivation for opening this PR is so that I can make use of the great work here as part of a hobby project I am working on (as is the essence of what is being asked for in #11 as well, I believe). I realize that this changes the nature of the project, and I welcome your thoughts as to whether these changes are in line with your vision for this project.

To ensure you don’t become stuck with the added obligation of maintaining build tooling, I’m happy to continue contributing to this project and assisting in the maintenance of it (in particular, the build tooling).

Changes:

In addition, I have also created a barebone React app that demonstrates how this project could be used as a library within other applications. Although this example uses React, it is fairly framework agnostic and would work similarly within other frameworks as well.

Looking forward to hearing your feedback!

BenPortner commented 8 months ago

Dear @asabhaney,

First off, I am sorry for my very late response to your PR. I changed jobs this year and it took me a while to settle in. Furthermore, since I am spending most of my time in front of the computer at work, doing so in private seems less attractive now. Maybe you can relate :)

Next, thank you very much for the significant amount of work you have poured into this. I am happy to see that my code could serve as a basis for your own project and even more happy that you decided to contribute back! I believe the work you did is important and valuable. However, before I can merge, I have a question: How can I use the index.js in the dist folder? I tried to import it the same way as familytree.js is imported now, but it seems no FamilyTree class is exported?

Since you asked, let me also explain the vision behind js_family_tree. The fundamental idea is to make it as easy as possible for non-programmers to create beautiful, interactive family trees. As is, a user needs nothing more than a text editor and a browser (tools that come with any desktop) to create their own tree. This is something that I want to maintain at all cost. However, I do agree that the current code base makes it very hard (if not impossible) to integrate js_family_tree into other projects. The es-import-export branch was my (admittedly amateurish) attempt to change this. I am therefore very happy about contributions like yours, which make the project more accessible to other developers - IF the usability for non-programmers does not suffer. For your PR, I cannot yet see if this is the case (most likely because I am not familiar with npm, React and the likes). Can you help me by providing an example?

Thank you again. Ben