Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js_family_tree as a library #14

Open
wants to merge 37 commits into
base: master
Choose a base branch
from

Conversation

asabhaney
Copy link

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:

  • Incorporate your changes from the es-import-export branch
  • Amalgamate all example related code, and centralize it in the examples directory. Examples can be run using npm run examples.
  • Add build tooling that makes it possible to use this as a library in other JS projects via npm install

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!

@asabhaney asabhaney changed the title js_family_tree as a Library js_family_tree as a library Apr 12, 2023
@BenPortner
Copy link
Owner

BenPortner commented Dec 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants