Files
topola-viewer/src/datasource
2026-06-24 23:18:04 +02:00
..
2026-05-11 18:06:31 +02:00
2026-05-02 14:57:03 +02:00
2026-06-15 07:39:22 +02:00
2026-05-12 00:29:35 +02:00

Data Sources

This directory contains the implementation of various data sources supported by Topola Viewer. It handles loading genealogical data from different origins and transforming it into a unified format used by the application.

Purpose

The main purpose of this directory is to abstract away the details of where the genealogical data comes from. Whether it is a file uploaded by the user, a URL pointing to a GEDCOM file, data fetched from the WikiTree API, or data received from a parent window in embedded mode, this directory provides a consistent interface (DataSource) to the rest of the application.

Files

  • data_source.ts: Defines the core abstractions for data sources, including the DataSourceEnum and the DataSource interface.
  • load_data.ts: Contains helper functions for loading data from files and URLs, handling zip files (GEDZIP), and implements UploadedDataSource and GedcomUrlDataSource.
  • embedded.ts: Implements EmbeddedDataSource for cases where the viewer is embedded in an iframe and receives GEDCOM data via window messages.
  • gedcom_generator.ts: Used to create a GEDCOM structure from internal JSON data. This is primarily used to generate a GEDCOM representation for data sources that do not natively provide it (like WikiTree), which is needed for the details panel.
  • wikitree.ts: Implements WikiTreeDataSource and serves as the main entry point for loading data from WikiTree.
  • wikitree_api.ts: Handles the actual communication with the WikiTree API using the wikitree-js library, including caching and handling private profiles.
  • wikitree_transformer.ts: Transforms data fetched from the WikiTree API into Topola's internal data format.
  • load_data.spec.ts: Unit tests for the data loading functions in load_data.ts.
  • testdata/: A directory containing test files used by the unit tests.