forked from datacommonsorg/website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Knowledge graph (datacommonsorg#4700)
## Description This PR implements the redesign of the knowledge graph (browser landing) page. It consists of both a conversion of the page itself to a React app with components (along with the movement of the source data that populates the page into json, similar to comparable pages), and a reworking of the page itself into the new layout. It includes a general component (the intro) that will be used in other similar redesigns, as well as components specific to the knowledge graph page. --------- Co-authored-by: Pablo Noel <[email protected]>
- Loading branch information
Showing
15 changed files
with
539 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* Styles for the browser landing (knowledge graph page) */ | ||
|
||
@use "./variables" as var; | ||
@import "base"; | ||
@import "./content/browser_items"; | ||
@import "./content/intro_text"; | ||
|
||
#browser_landing { | ||
&.main-content { | ||
margin: 0; | ||
} | ||
.container { | ||
padding: calc(#{var.$spacing} * 8) 0; | ||
&.big { | ||
padding: calc(#{var.$spacing} * 12) 0; | ||
@include media-breakpoint-down(lg) { | ||
padding: calc(#{var.$spacing} * 8) calc(#{var.$spacing} * 3); | ||
} | ||
} | ||
@include media-breakpoint-down(lg) { | ||
max-width: 100%!important; | ||
padding: var.$container-horizontal-padding calc(#{var.$spacing} * 3); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License.a | ||
*/ | ||
|
||
/* Styles for the browser items component located on the browser landing (knowledge graph) page */ | ||
|
||
.browser-items { | ||
.item { | ||
padding-bottom: calc(#{var.$spacing} * 10); | ||
margin-bottom: calc(#{var.$spacing} * 10); | ||
border-bottom: 1px solid rgba(220,220,220,0.3); | ||
&:last-of-type { | ||
border-bottom: none; | ||
} | ||
@include media-breakpoint-down(md) { | ||
padding-bottom: calc(#{var.$spacing} * 6); | ||
margin-bottom: calc(#{var.$spacing} * 6); | ||
} | ||
@include media-breakpoint-down(sm) { | ||
padding-bottom: calc(#{var.$spacing} * 4); | ||
margin-bottom: calc(#{var.$spacing} * 4); | ||
} | ||
.header { | ||
h3 { | ||
@include var.title_md; | ||
margin-bottom: calc(#{var.$spacing} * 3); | ||
} | ||
} | ||
ul { | ||
margin: 0; | ||
margin-left: 200px; | ||
padding: 0; | ||
display: grid; | ||
grid-template-columns: 1fr 1fr 1fr; | ||
gap: calc(#{var.$spacing} * 2) calc(#{var.$spacing} * 3); | ||
@include media-breakpoint-down(md) { | ||
grid-template-columns: 1fr 1fr; | ||
} | ||
@include media-breakpoint-down(sm) { | ||
grid-template-columns: 1fr; | ||
gap: calc(#{var.$spacing} * 2) calc(#{var.$spacing} * 3); | ||
margin-left: 10%; | ||
} | ||
li { | ||
@include var.text_lg; | ||
font-weight: 200; | ||
margin:0; | ||
padding: 0; | ||
list-style: none; | ||
display: block; | ||
.more { | ||
display: flex; | ||
align-content: center; | ||
gap: var.$spacing; | ||
color: var(--gm-3-ref-neutral-neutral-40); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* Copyright 2024 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/** | ||
* Main component for the browser landing (knowledge graph) page | ||
*/ | ||
|
||
import React, { ReactElement } from "react"; | ||
|
||
import { IntroText } from "../../components/content/intro_text"; | ||
import { KnowledgeGraphBrowser } from "../../components/knowledge_graph/knowledge_graph_browser"; | ||
import { KnowledgeGraphCategory } from "../../shared/types/knowledge_graph"; | ||
import knowledgeGraphData from "./knowledge_graph.json"; | ||
|
||
const knowledgeGraph: KnowledgeGraphCategory[] = knowledgeGraphData; | ||
|
||
/** | ||
* Application container | ||
*/ | ||
export function App(): ReactElement { | ||
return ( | ||
<> | ||
<IntroText> | ||
<header> | ||
<h1>Knowledge Graph</h1> | ||
<p> | ||
The Data Commons Knowledge Graph is constructed by synthesizing a | ||
single database from many different data sources. This knowledge | ||
graph can be used both to explore what data is available and to | ||
understand the graph structure. | ||
</p> | ||
</header> | ||
</IntroText> | ||
<KnowledgeGraphBrowser knowledgeGraph={knowledgeGraph} /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.