From 82a5c35aa0d5b8a2580005425e04c92711390499 Mon Sep 17 00:00:00 2001 From: Theo Sanderson Date: Sat, 3 Jun 2023 20:25:18 +0100 Subject: [PATCH] UPDATE --- taxonium_component/public/taxonium.proto | 59 ------------------------ taxonium_component/src/README.md | 22 +++++++++ 2 files changed, 22 insertions(+), 59 deletions(-) delete mode 100644 taxonium_component/public/taxonium.proto create mode 100644 taxonium_component/src/README.md diff --git a/taxonium_component/public/taxonium.proto b/taxonium_component/public/taxonium.proto deleted file mode 100644 index 2f18d51e..00000000 --- a/taxonium_component/public/taxonium.proto +++ /dev/null @@ -1,59 +0,0 @@ -syntax = "proto3"; - -message ColourMapping{ - string key = 1; - repeated int32 colour = 2; -} - - -message MutationList{ - repeated int32 mutation = 1; -} - -message MetadataUniqueStringPerNode{ - string metadata_name = 1; - string metadata_title = 2; - repeated string node_values = 3; -} - -message MetadataSingleValuePerNode{ - string metadata_name = 1; - string metadata_title = 2; - repeated string mapping = 3; - repeated int32 node_values = 4; -} - -message AllNodeData { - repeated string names = 1; // Deprecated: DO NOT USE (use metadata_unique_strings) - repeated float x = 2; - repeated float y = 3; - repeated int32 countries = 4;//Deprecated: DO NOT USE (use metadata_singles) - repeated int32 dates = 7; // Deprecated: DO NOT USE (use metadata_singles) - repeated int32 lineages = 5;//Deprecated: DO NOT USE (use metadata_singles) - - - repeated MutationList mutations = 6; - repeated int32 parents = 8; - repeated string genbanks = 9; // Deprecated: DO NOT USE -repeated int32 epi_isl_numbers = 10; // Deprecated: DO NOT USE -repeated int32 num_tips = 11; -repeated MetadataSingleValuePerNode metadata_singles = 12; -repeated MetadataUniqueStringPerNode metadata_unique_strings=13; -repeated float time_x = 14; // Temporary - -} - - -message AllData{ - AllNodeData node_data= 1; - repeated string country_mapping = 2;//Deprecated: DO NOT USE (use metadata_singles above) - repeated string lineage_mapping = 3; //Deprecated: DO NOT USE (use metadata_singles above) - repeated string mutation_mapping = 4; - repeated string date_mapping = 5; //Deprecated: DO NOT USE (use metadata_singles above) - string tree_description = 6; - string tree_title = 7; - string default_search = 8; - string default_seq_name_field = 9; - string default_colourby = 10; - repeated ColourMapping colour_mapping = 11; -} diff --git a/taxonium_component/src/README.md b/taxonium_component/src/README.md new file mode 100644 index 00000000..740e23bf --- /dev/null +++ b/taxonium_component/src/README.md @@ -0,0 +1,22 @@ +src/Taxonium.jsx: This is the main entry point for the Taxonium component. It brings together all the hooks and components to render the interactive phylogenetic tree. + +src/Deck.jsx: This component renders the actual DeckGL canvas and handles interactions with it. It contains the layers for nodes, lines, labels, etc. + +src/hooks: This folder contains all the React hooks used in the project. Some of the main hooks are: + +- useBackend: This hook is used to interface with either a local or server backend to get data and search +- useColor, useColorBy: These hooks handle the node coloring logic +- useConfig: This hook is used to get configuration information (title, source, etc) +- useGetDynamicData: This hook is used to get data from the backend within the current viewport +- useLayers: This hook generates the DeckGL layers +- useNodeDetails: This hook is used to get details for selected nodes +- useSearch: This hook handles searching the tree +- useView: This hook manages the view state and zooming/panning +- useHoverDetails: This hook manages hovered node details + +src/utils: This folder contains various utility functions, including: + +- processNewick.js: For converting Newick/Nexus into Taxonium JSON format +- processNextstrain.js: For converting Nextstrain JSON into Taxonium JSON format +- searchUtil.js: Contains utility functions for searching +- formatNumber.js: Used to format large numbers with commas \ No newline at end of file