Skip to content

Commit

Permalink
Revert css I unintentionally modified & add the source sv modal on Pl…
Browse files Browse the repository at this point in the history
…ace page sources (#4798)

When clicking on show metadata in Key Demographics sources:
https://screenshot.googleplex.com/AZy3mBZVrvHbewD
gmechali authored Dec 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 6883b9c commit 1d2b0df
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 2 additions & 2 deletions static/css/place/dev_place_page.scss
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ main {
}
.summary-text {
color: var(--gm-3-ref-neutral-neutral-20);
font-size: 5px;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px;
@@ -132,7 +132,7 @@ main {
}

a {
font-size: 55px;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 20px;
24 changes: 21 additions & 3 deletions static/js/place/dev_place_main.tsx
Original file line number Diff line number Diff line change
@@ -310,7 +310,7 @@ const PlaceTopicTabs = ({
const PlaceOverviewTable = (props: { placeDcid: string }) => {
const { placeDcid } = props;
const [dataRows, setDataRows] = useState<DataRow[]>([]);
const containerRef = useRef<HTMLDivElement>(null);
const containerRef = useRef(null);
// Fetch key demographic statistics for the place when it changes
useEffect(() => {
(async () => {
@@ -336,8 +336,22 @@ const PlaceOverviewTable = (props: { placeDcid: string }) => {
return dataRow.variable.observation.metadata.provenanceUrl;
})
);
const statVarDcids = dataRows.map((dr) => {
return dr.variable.dcid;
});

const statVarSpecs: StatVarSpec[] = statVarDcids.map((dcid) => {
return {
statVar: dcid,
denom: "", // Initialize with an empty string or a default denominator if applicable
unit: "", // Initialize with an empty string or a default unit if applicable
scaling: 1, // Initialize with a default scaling factor
log: false, // Initialize with a default log value
};
});

return (
<table className="table">
<table className="table" ref={containerRef}>
<thead>
<tr>
<th scope="col" colSpan={2}>
@@ -368,7 +382,11 @@ const PlaceOverviewTable = (props: { placeDcid: string }) => {
<tr>
<td>
<div className="chart-container">
<TileSources containerRef={containerRef} sources={sourceUrls} />
<TileSources
containerRef={containerRef}
sources={sourceUrls}
statVarSpecs={statVarSpecs}
/>
</div>
</td>
<td></td>

0 comments on commit 1d2b0df

Please sign in to comment.