Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
33dff25
Moved tools into the general content directory (rather than its old l…
nick-next Dec 5, 2025
b5a3e2c
Update to the tools component to make it more generic and extensible …
nick-next Dec 5, 2025
86ccad6
Renaming header_v2.json to header.json (replacing the old header.json…
nick-next Dec 5, 2025
7b8c1f5
Update to __init__.py to allow for custom DCs to supply their own hea…
nick-next Dec 5, 2025
dfb2058
As a follow-up to the update tool component, this is an updated LinkI…
nick-next Dec 5, 2025
34bad1e
The entry point for the custom DC home page. This loads the custom dc…
nick-next Dec 5, 2025
4dfb970
The custom header for the Custom Data Commons (with a more limited se…
nick-next Dec 5, 2025
5044d0d
The search component, a component that wraps the NLSearchBar and allo…
nick-next Dec 5, 2025
a839446
The custom home page template is now update to remove the old header …
nick-next Dec 5, 2025
f1ae71d
An update to the primary site base template to use HEADER_MENU rather…
nick-next Dec 5, 2025
5c9ee3d
The custom dc app, that displays the search and the tools.
nick-next Dec 5, 2025
e2bb916
Initial Emotion work for the search
pablonoel Dec 7, 2025
c0fdd76
Emotion styles for autocomplete
pablonoel Dec 7, 2025
28a2f3e
Styles for tools and search suggestions
pablonoel Dec 8, 2025
b3c3207
Merge branch 'master' into custom-dc-homepage
nick-next Dec 9, 2025
1d7f142
Restored styling and intro header to the Data Commons tool component …
nick-next Dec 9, 2025
4655e7f
The link description is now black, and the custom dc version of the t…
nick-next Dec 9, 2025
3ddeea8
Merge branch 'master' into custom-dc-homepage
nick-next Dec 14, 2025
0cdec09
Color, typography and new logo
pablonoel Dec 14, 2025
95125e2
Update overrides.css
pablonoel Dec 14, 2025
27ef2ac
Merge branch 'custom-dc-homepage' of github.com:Half-Integer/datacomm…
pablonoel Dec 14, 2025
1e547cd
Some refactoring of the tools component (adding memoization and rolli…
nick-next Dec 14, 2025
6ca2660
Removal of redundant CSS styles.
nick-next Dec 14, 2025
45a1294
Import of font should be done in base.html rather than inside the css
pablonoel Dec 14, 2025
ce66a3f
Font fixes, autocomplete load more styles and improvement on contrast
pablonoel Dec 15, 2025
370317d
Styled components
pablonoel Dec 15, 2025
977ba13
improvements on Styled components
pablonoel Dec 15, 2025
600423f
Clean up styled components
pablonoel Dec 15, 2025
46dff8f
Merge branch 'master' into custom-dc-homepage
nick-next Dec 16, 2025
e3e3e6d
Factored the styled components out of the primary components, and som…
nick-next Dec 16, 2025
9019f0c
Fix CSS nest issue, Improve the showloadmore
pablonoel Dec 16, 2025
1203a31
Formatting
nick-next Dec 16, 2025
780190f
Merge branch 'master' into custom-dc-homepage
nick-next Dec 16, 2025
ccfbda0
Conversion of export from default to standard, and collapsing of impo…
nick-next Dec 16, 2025
8ff5505
Removal of component props that were not used.
nick-next Dec 16, 2025
dfb5075
Removal of unused imports.
nick-next Dec 16, 2025
f2c5af8
Update to tests to account for changes in the frontend hierarchy.
nick-next Dec 16, 2025
879a5f1
Removes old logo, check some copyright dates, brings back the medium …
pablonoel Dec 21, 2025
8a3e0bd
Merge branch 'master' into custom-dc-homepage
pablonoel Dec 22, 2025
c2bc661
Merge branch 'master' into custom-dc-homepage
pablonoel Jan 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,17 +517,40 @@ def add_language_code(endpoint, values):
return
values['hl'] = g.locale

def get_custom_config_path(custom_dc_template_folder=None):
"""
Return the custom configuration folder path
if custom configuration is enabled and a custom template folder is provided.
"""
if cfg.CUSTOM and custom_dc_template_folder:
return os.path.join(app.root_path, "config", "custom_dc",
custom_dc_template_folder)
return None

# Provides locale and other common parameters in all templates
@app.context_processor
def inject_common_parameters():
header_json_path = "config/base/header.json"
footer_json_path = "config/base/footer.json"

custom_config_path = get_custom_config_path(custom_dc_template_folder)
if custom_config_path:
custom_header_override = os.path.join(custom_config_path, "base",
"header.json")
if os.path.exists(custom_header_override):
header_json_path = custom_header_override

custom_footer_override = os.path.join(custom_config_path, "base",
"footer.json")
if os.path.exists(custom_footer_override):
footer_json_path = custom_footer_override

header_menu = libutil.get_json(header_json_path)
footer_menu = libutil.get_json(footer_json_path)

common_variables = {
#TODO: replace HEADER_MENU with V2
'HEADER_MENU':
json.dumps(libutil.get_json("config/base/header.json")),
'FOOTER_MENU':
json.dumps(libutil.get_json("config/base/footer.json")),
'HEADER_MENU_V2':
json.dumps(libutil.get_json("config/base/header_v2.json")),
'HEADER_MENU': json.dumps(header_menu),
'FOOTER_MENU': json.dumps(footer_menu),
}
locale_variable = dict(locale=get_locale())
return {**common_variables, **locale_variable}
Expand Down
2 changes: 1 addition & 1 deletion server/app_env/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Config(_base.Config):
CUSTOM = True
NAME = "Custom Data Commons"
OVERRIDE_CSS_PATH = '/custom_dc/custom/overrides.css'
LOGO_PATH = "/custom_dc/custom/logo.png"
LOGO_PATH = "/custom_dc/custom/logo.svg"
MIN_STAT_VAR_GEO_COVERAGE = 1
SHOW_DISASTER = False
USE_LLM = False
Expand Down
178 changes: 114 additions & 64 deletions server/config/base/header.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,139 @@
[
{
"label": "Explore",
"id": "tools",
"label": "Tools",
"ariaLabel": "Show exploration tools",
"subMenu": [
{
"href": "{place.place_explorer}",
"label": "Place Explorer"
},
{
"href": "{browser.browser_main}",
"label": "Knowledge Graph"
},
{
"href": "{tools.visualization}#visType=timeline",
"label": "Timelines Explorer"
},
{
"href": "{tools.visualization}#visType=scatter",
"label": "Scatter Plot Explorer"
"introduction": {
"description": "Explore a variety of tools to visualize, analyze, and interact with the Data Commons knowledge graph and its extensive datasets"
},
"primarySectionGroups": [
{
"id": "tools-0",
"items": [
{
"title": "Knowledge Graph",
"url": "{browser.browser_main}",
"description": "Explore what data is available and understand the graph structure"
},
{
"title": "Statistical Variable Explorer",
"url": "{tools.stat_var}",
"description": "Explore statistical variable details including metadata and observations"
},
{
"title": "Data Download Tool",
"url": "{tools.download}",
"description": "Download data for selected statistical variables"
}
]
},
{
"href": "{tools.visualization}#visType=map",
"label": "Map Explorer"
},
{
"href": "{tools.stat_var}",
"label": "Statistical Variable Explorer"
},
{
"href": "{tools.download}",
"label": "Data Download Tool"
"id": "tools-1",
"items": [
{
"title": "Map Explorer",
"url": "{tools.visualization}#visType=map",
"description": "Study how a selected statistical variable can vary across geographic regions"
},
{
"title": "Scatter Plot Explorer",
"url": "{tools.visualization}#visType=scatter",
"description": "Visualize the correlation between two statistical variables"
},
{
"title": "Timelines Explorer",
"url": "{tools.visualization}#visType=timeline",
"description": "See trends over time for selected statistical variables"
}
]
}
]
},
{
"id": "docs",
"label": "Documentation",
"ariaLabel": "Show documentation links",
"subMenu": [
{
"href": "https://docs.datacommons.org",
"label": "Documentation"
},
{
"href": "https://docs.datacommons.org/api",
"label": "APIs"
"introduction": {
"description": "Access in-depth tutorials, guides, and API references to unlock the full potential of Data Commons and integrate it into your projects"
},
"primarySectionGroups": [
{
"id": "docs-0",
"items": [
{
"title": "Docs",
"url": "https://docs.datacommons.org",
"description": "Learn how to access and visualize Data Commons data: docs for the website, APIs, and more, for all users and needs"
},
{
"title": "API",
"url": "https://docs.datacommons.org/api",
"description": "Access Data Commons data programmatically, using REST and Python APIs"
}
]
},
{
"hide": true,
"href": "https://docs.datacommons.org/bigquery",
"label": "BigQuery"
},
{
"href": "https://docs.datacommons.org/tutorials",
"label": "Tutorials"
},
{
"href": "https://docs.datacommons.org/contributing/",
"label": "Contribute"
"id": "docs-1",
"items": [
{
"title": "Tutorials",
"url": "https://docs.datacommons.org/tutorials",
"description": "Get familiar with the Data Commons Knowledge Graph and APIs using analysis examples in Google Colab notebooks written in Python"
},
{
"title": "Contributions",
"url": "https://docs.datacommons.org/contributing/",
"description": "Become part of Data Commons by contributing data, tools, educational materials, or sharing your analysis and insights. Collaborate and help expand the Data Commons Knowledge Graph"
}
]
}
]
},
{
"id": "about",
"label": "About",
"ariaLabel": "Show about links",
"subMenu": [
{
"href": "{static.about}",
"label": "About Data Commons"
},
{
"href": "https://blog.datacommons.org/",
"label": "Blog"
"introduction": {
"description": "Data Commons is an initiative from Google. Explore diverse data, learn to use its tools through Python examples, and stay updated on the latest news and research"
},
"primarySectionGroups": [
{
"id": "about-0",
"items": [
{
"title": "Why Data Commons",
"url": "{static.about}",
"description": "Discover why Data Commons is revolutionizing data access and analysis. Learn how its unified Knowledge Graph empowers you to explore diverse, standardized data"
},
{
"title": "Data Sources",
"url": "{static.data}",
"description": "Get familiar with the data available in Data Commons"
}
]
},
{
"href": "{static.data}",
"label": "Data Sources"
},
{
"href": "{static.faq}",
"label": "FAQ"
},
{
"href": "{static.feedback}",
"label": "Feedback"
"id": "about-1",
"items": [
{
"title": "FAQ",
"url": "{static.faq}",
"description": "Find quick answers to common questions about Data Commons, its usage, data sources, and available resources"
},
{
"title": "Blog",
"url": "https://blog.datacommons.org/",
"description": "Stay up-to-date with the latest news, updates, and insights from the Data Commons team. Explore new features, research, and educational content related to the project"
}
]
}
]
},
{
"id": "feedback",
"label": "Feedback",
"ariaLabel": "Give feedback",
"url": "{feedback-prefill}",
"exposeInMobileBanner": true
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -88,52 +88,5 @@
]
}
]
},
{
"id": "about",
"label": "About",
"ariaLabel": "Show about links",
"introduction": {
"description": "Data Commons is an initiative from Google. Explore diverse data, learn to use its tools through Python examples, and stay updated on the latest news and research"
},
"primarySectionGroups": [
{
"id": "about-0",
"items": [
{
"title": "Why Data Commons",
"url": "{static.about}",
"description": "Discover why Data Commons is revolutionizing data access and analysis. Learn how its unified Knowledge Graph empowers you to explore diverse, standardized data"
},
{
"title": "Data Sources",
"url": "{static.data}",
"description": "Get familiar with the data available in Data Commons"
}
]
},
{
"id": "about-1",
"items": [
{
"title": "FAQ",
"url": "{static.faq}",
"description": "Find quick answers to common questions about Data Commons, its usage, data sources, and available resources"
},
{
"title": "Blog",
"url": "https://blog.datacommons.org/",
"description": "Stay up-to-date with the latest news, updates, and insights from the Data Commons team. Explore new features, research, and educational content related to the project"
}
]
}
]
},
{
"id": "feedback",
"label": "Feedback",
"ariaLabel": "Give feedback",
"url": "{feedback-prefill}",
"exposeInMobileBanner": true
}
]
2 changes: 1 addition & 1 deletion server/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
<body {% if is_hide_header_search_bar %}class="no-header-search-bar"{% endif %}>

<div id="metadata-base" class="d-none"
data-header="{{ HEADER_MENU_V2 }}"
data-header="{{ HEADER_MENU }}"
data-footer="{{ FOOTER_MENU }}"
data-logo-path="{{ LOGO_PATH }}"
data-logo-width="{{ LOGO_WIDTH }}"
Expand Down
Loading
Loading