Post by Uncle Buddy on Jun 13, 2021 17:35:09 GMT -8
I haven't done anything with this yet but it looks promising. In my Treebard GPS Python code I've included a sample hard-coded way to draw a pedigree chart on the Tkinter canvas. This is just a placeholder for the real thing. It needs to not be hard-coded. You have to be able to draw the chart dynamically, a different chart for every set of data.
I'm at absolute zero with this, haven't really started, but I'll add a link to some code below and a tutorial that explains how to use SVG to draw a tree diagram. I suggest commenting out the font stuff in the css. It's not for Python but if you want to adapt this sort of thing to Python, here's an example of how that might be approached. The last line about converting to .png is optional, you could do that if you wanted to display the graphic with Pillow in Tkinter. www.geeksforgeeks.org/pycairo-saving-svg-image-file-to-png-file/
Here's the SVG tree tutorial:
www.codewall.co.uk/how-to-make-tree-visualizations-with-javascript-and-svg-tutorial/
The link for the full code is broken but here is a good link for the same code. The .ttf is just font stuff, I'm sure that can be ignored:
github.com/zchtodd/tree-drawing
Here's an intro to SVG tutorial, it's easy to get started:
www.w3schools.com/graphics/svg_intro.asp
As for whether it's better to use SVG or HTML5's canvas in a webpage or web app, for something like a dynamic family tree my research indicates that SVG is the right way to go.
I have been putting all my time into tutorials lately since I'm getting ready to change my focus to Treebard 0.0.0. I also plan to keep puttering away in the Treebard GPS project using Python/Tkinter/SQLite. If someone creates some code to draw a tree diagram using the above links or some other method, please start a thread about how you did it.
Regarding my current choice of vehicles to bring Treebard 0.0.0 to fruition, I'll be posting soon. The full-stack no-dependency approach is probably not practical for me. Not because I can't do it but my interest is GUI and database, not in how to connect them to each other. I believe the best tool for doing that is a program called Electron.
I've been playing around with my old friends HTML, CSS and JavaScript and I'm convinced that this is the GUI toolkit for me. Electron puts it all together with a built-in backend which is usable with SQLite, so a desktop application (not an internet-dependent web app) can be made with HTML etc. Results so far are promising. I'll post the details when I escape from tutorial hell.
I'm at absolute zero with this, haven't really started, but I'll add a link to some code below and a tutorial that explains how to use SVG to draw a tree diagram. I suggest commenting out the font stuff in the css. It's not for Python but if you want to adapt this sort of thing to Python, here's an example of how that might be approached. The last line about converting to .png is optional, you could do that if you wanted to display the graphic with Pillow in Tkinter. www.geeksforgeeks.org/pycairo-saving-svg-image-file-to-png-file/
Here's the SVG tree tutorial:
www.codewall.co.uk/how-to-make-tree-visualizations-with-javascript-and-svg-tutorial/
The link for the full code is broken but here is a good link for the same code. The .ttf is just font stuff, I'm sure that can be ignored:
github.com/zchtodd/tree-drawing
Here's an intro to SVG tutorial, it's easy to get started:
www.w3schools.com/graphics/svg_intro.asp
As for whether it's better to use SVG or HTML5's canvas in a webpage or web app, for something like a dynamic family tree my research indicates that SVG is the right way to go.
I have been putting all my time into tutorials lately since I'm getting ready to change my focus to Treebard 0.0.0. I also plan to keep puttering away in the Treebard GPS project using Python/Tkinter/SQLite. If someone creates some code to draw a tree diagram using the above links or some other method, please start a thread about how you did it.
Regarding my current choice of vehicles to bring Treebard 0.0.0 to fruition, I'll be posting soon. The full-stack no-dependency approach is probably not practical for me. Not because I can't do it but my interest is GUI and database, not in how to connect them to each other. I believe the best tool for doing that is a program called Electron.
I've been playing around with my old friends HTML, CSS and JavaScript and I'm convinced that this is the GUI toolkit for me. Electron puts it all together with a built-in backend which is usable with SQLite, so a desktop application (not an internet-dependent web app) can be made with HTML etc. Results so far are promising. I'll post the details when I escape from tutorial hell.