Skip to content
Firestone82Public

About

Angular family tree app with automatic layout, relationship names and printable posters in three styles

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Stemma

Angular app for mapping a family and getting a clear family tree drawn and printed for you.

Angular TypeScript Node.js Deploy License

Live demo: firestone82.github.io/stemma

About

Stemma lets you add people and how they are related, and lays the chart out for you, each family coloured; centre it on anyone and the cards say how everyone is related to them, while the chart stays as it is. Families hang together wherever there is room, with no line crossing another even for remarriages, divorces, adoptions or cousin marriages. Trees are printed as posters that fill the sheet, A4 to A0, with cards as big as the paper allows, and are saved as a versioned XML file. Everything runs in the browser and no data leaves your machine.

Features

  • Automatic layout for real families: families hang together wherever there is room, packed outline to outline with padding between them, each one as wide or as narrow as fills the space best, and no line crosses another; someone who married more than once stands between their partners
  • Family view: one family on its own; where a family it is joined to would begin there is a button in a card's place, which brings that family in
  • One card for everyone, on the chart and in print: shield with initials in the family colour, name, surname and surname at birth ("née Unknown" for a married woman whose own is not known), dates in years or in full, sex as an accent, a ribbon across the top right corner for the deceased, a badge on records with a mistake - every part can be switched off, the shield at the top or in the middle, and a card without the shield is narrower
  • Relationship names to the centred person on the cards, if you like (great-aunt, sister-in-law, first cousin once removed, ...)
  • Relationship status: married, engaged, partners, separated, divorced, widowed, annulled
  • Twins and multiple births, people with unknown names, unknown parents
  • Surnames that fill themselves in, including Czech female forms (Mikula -> Mikulova); for a woman married more than once, the surname field suggests her husbands' surnames as you type or from its arrow, and keeps whatever else you write
  • Family colours on heraldic shields, with the Polish, the German and the Czech spelling of a name as one family (Nowak and Novák, Schmidt and Šmíd), and a soft background behind each family's cards on the chart if you like; light and dark mode
  • Print studio in the Heritage style: the page is shaped to the paper for the biggest cards and the least empty paper, upright or on its side; families can be packed tightly, a longer search can spread them into room that would stay empty, and couples can stand one over the other in a column, if you prefer; the couple in the middle is ringed and each one's direct line drawn in their colour; drag a card to move it (its lines and everyone hanging under it follow, guides line it up with other cards and snap it to the usual gap for partners, brothers and sisters or families, Alt places it freely), swap the sides a couple's partners stand on, click a line to leave out everyone who hangs on it, right-click a card to bring that person's parents, brothers and sisters or whole family onto the print (the parents of a former partner, say), and undo any of it; the title and the family names are sized to the sheet and the cards (a size typed in can be swapped for the suggested one with a click) and can be dragged anywhere: a moved box shows its lettering where it would go, and the page is drawn again only once the move is applied; either can be held at an anchor instead (a corner, the middle of a side), where it stays whatever its size, and the names can stand in any corner of a box made bigger than they need; left alone, the family names stand across the foot or in the corner the tree leaves empty; the tree keeps clear of both; the words on the cards can be a size bigger, and a card whose names do not fit can be as wide as they need; a big tree's page is drawn a piece at a time, so the studio keeps answering, and a change made meanwhile drops the drawing and starts the page wanted now
  • Paper sizes A4 to A0, US Letter and Tabloid, each with its own smallest readable card; stronger lines and marks if wanted; the couple in the middle framed as one; export to printer, PDF, PNG or SVG
  • Versioned XML format with schema (schema/stemma-1.xsd) and autosave in the browser
  • Undo/redo, keyboard navigation, English and Czech, mobile layout

Showcase

Editor with a person selected

The family view shows one family at a time. Where a family it is joined to would begin, a dashed button stands in a card's place: press it and the family comes in.

Family view

The print studio: pick the paper, who the page is drawn around and what the cards show, then print or export.

Print studio

Heritage poster

Requirements

  • Node.js 22.22.3+ or 24.15+
  • npm 10+

Setup

  1. Clone the repository:

    git clone https://github.com/Firestone82/stemma.git
    cd stemma
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start

    The app runs at http://localhost:4200. An example tree is in samples/ashworth-family.xml.

  4. Build for production:

    npm run build

    The output in dist/stemma/browser is a static site that can be hosted anywhere.

Other scripts: npm test (Vitest), npm run lint (ESLint), npm run format (Prettier).

Saving

In Chrome and Edge, a tree opened from a file is saved back to that same file (Ctrl S), and Save as (Ctrl Shift S) picks a new one. Browsers without the File System Access API (Firefox, Safari) download a new copy each time.

A tree opened from or saved to a file (on the computer or in Google Drive) is not reopened from the browser on the next visit: the start page lists the recent files instead, and opening one reads it again from the file, so you always go on from what was last saved. In Chrome and Edge the browser asks once more for permission to the file; elsewhere the file is picked again. Leaving the page, or opening another tree, with changes that are not saved yet asks first. A new tree that was never saved to a file is still kept in the browser between visits.

Google Drive

Trees can also be opened from and saved to Google Drive (Open from Google Drive on the start page, or in the File menu). The browser talks to Google directly, and the app only gets the drive.file permission: it sees the trees it saved to Drive itself and the files and folders picked in the Google Picker, nothing else there.

With an API key set, Open from Google Drive shows the Google Picker, where any tree you can see is picked (in My Drive, shared with you, or in a shared drive), and Save a copy to Google Drive asks for the folder to save in. A tree shared with you for viewing only is opened, and kept with Save a copy. Without an API key, Open from Google Drive lists only the trees Stemma saved itself, and new trees go to the top folder of My Drive.

A tree in Google Drive can be shared by a link (File, Share a link): Stemma's address with ?drive=<file id>. Whoever opens it sees the tree at once, with no sign-in, as long as the file is shared in Drive as "Anyone with the link" (the dialog checks, and can set that for a file of yours). A tree opened this way can be explored and changed, but nothing is written back to the shared file: Save keeps your own copy, and closing it brings back the tree you had in the browser. Reading it needs the API key, allowed for the Google Drive API too.

Until a client ID is set, the Drive items show the steps below instead of Google's sign-in. The values go in src/app/core/services/google-config.ts:

  1. In the Google Cloud console, create a project and enable the Google Drive API and the Google Picker API.
  2. Under Google Auth Platform, set up the consent screen (External), add the scope https://www.googleapis.com/auth/drive.file, and add yourself (and anyone else who will use it) as a test user, or publish the app.
  3. Create an OAuth client ID of type Web application, with http://localhost:4200 and https://firestone82.github.io as authorised JavaScript origins (no redirect URIs). Copy it to clientId.
  4. Optional, for the Picker: create an API key (APIs & Services, Credentials), restricted to the Google Picker API and the Google Drive API (for shared links), and to the websites http://localhost:4200/* and https://firestone82.github.io/*. Copy it to apiKey. The app ID (the project number) is taken from the start of the client ID.

None of these is a secret: they are part of the page, and Google accepts them only from the listed origins.

License

MIT

About

Angular family tree app with automatic layout, relationship names and printable posters in three styles

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages