Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs/epic 13898 #1099

Merged
merged 5 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion app/components/population-pyramid-decennial.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default HorizontalBar.extend({
.data(data, d => get(d, 'group'));

const handleBars = (selection, type) => {
const widthFunction = d => xScale(get(d, `${type}.percent`));
const widthFunction = d => xScale(getByMode(d, type, 'percent'));

selection.enter()
.append('rect')
Expand Down
2 changes: 1 addition & 1 deletion app/components/population-pyramid.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default HorizontalBar.extend({
.data(data, d => get(d, 'group'));

const handleBars = (selection, type) => {
const widthFunction = d => xScale(get(d, `${type}.percent`));
const widthFunction = d => xScale(getByMode(d, type, 'percent'));

selection.enter()
.append('rect')
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/data-table-row-change.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{!-- Estimate --}}
{{#with (format-number (abs @data.changeSum) precision=@rowConfig.decimal) as |roundedChangeSum|}}
{{#with (format-number (abs @data.changeMarginOfError) precision=@rowConfig.decimal) as |roundedChangeMarginOfError|}}
<td class="cell-border-left change-estimate {{unless @data.changeIsReliable 'insignificant'}}">
<td class="cell-border-left change-estimate {{unless (or @data.changeIsReliable this.decennial) 'insignificant'}}">
{{#unless (or
(eq @data.changeSum null)
(eq @data.changeSum undefined)
Expand Down Expand Up @@ -81,7 +81,7 @@
{{#with (format-number (mult (abs @data.changePercent) 100) precision=1) as |roundedChangePercentage|}}
{{#with (format-number (mult (abs @data.changePercentMarginOfError) 100) precision=1) as |roundedChangePercentageMarginOfError|}}

<td class="{{unless @data.changePercentIsReliable 'insignificant'}} change-percent">
<td class="{{unless (or @data.changePercentIsReliable this.decennial) 'insignificant'}} change-percent">
{{#unless (or
@data.isSpecial
(eq @data.changePercent null)
Expand Down
8 changes: 6 additions & 2 deletions app/templates/components/data-table-row-current.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
<td
class="cell-border-left
{{if
(and
(or
(not this.data.differenceIsReliable)
(and (eq this.data.sum 0) (eq this.data.comparisonSum 0)))
(and (eq this.data.sum 0) (eq this.data.comparisonSum 0))
)
(not this.decennial)
)
'insignificant'}}">
{{unless (eq this.data.differenceSum null)
(format-number
Expand Down Expand Up @@ -83,7 +87,7 @@
</td>
{{/if}}
<td
class="{{unless this.data.differencePercentIsReliable 'insignificant'}} difference-percent">
class="{{unless (or this.data.differencePercentIsReliable this.decennial) 'insignificant'}} difference-percent">
{{unless (or @data.isSpecial (eq this.data.differencePercent null))
(format-number
this.data.differencePercent
Expand Down
12 changes: 8 additions & 4 deletions app/templates/components/data-table-row-previous.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
<td
class="cell-border-left
{{if
(or
(not this.data.previous.differenceIsReliable)
(and (eq this.data.previous.sum 0) (eq this.data.previousComparison.sum 0)))
(and
(or
(not this.data.previous.differenceIsReliable)
(and (eq this.data.previous.sum 0) (eq this.data.previousComparison.sum 0))
)
(not this.decennial)
)
'insignificant'}}">
{{unless (eq this.data.previous.differenceSum null)
(format-number
Expand Down Expand Up @@ -83,7 +87,7 @@
{{/if}}

<td
class="{{unless this.data.previous.differencePercentIsReliable 'insignificant'}} difference-percent">
class="{{unless (or this.data.previous.differencePercentIsReliable this.decennial) 'insignificant'}} difference-percent">
{{unless (or @data.isSpecial (eq this.data.previous.differencePercent null))
(format-number
this.data.previous.differencePercent
Expand Down
2 changes: 2 additions & 0 deletions app/templates/components/data-table.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{{else}}
{{#if (eq this.mode 'current')}}
{{data-table-row-current
decennial=this.decennial
mode=this.mode
reliability=this.reliability
comparison=this.comparison
Expand All @@ -47,6 +48,7 @@
}}
{{else if (eq this.mode 'previous')}}
{{data-table-row-previous
decennial=this.decennial
mode=this.mode
reliability=this.reliability
comparison=this.comparison
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/default-modal.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RevealModal @open={{this.openModal}} @closeModal={{this.toggleModal}}>
<h1 class="header-large">
NYC Population FactFinder has been updated with 2017-2021 American Community Survey (ACS) data.
NYC Population FactFinder has been updated with data from the newly released 2020 Census Demographic & Housing Characteristics (DHC) file.
</h1>

<p class="lead">
Expand Down
2 changes: 0 additions & 2 deletions app/templates/components/population-pyramid-decennial.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
<g>

<rect x="0" y="9" height="11" width="20" rx="2" ry="2" class="bar"></rect>
<rect alighnment-baseline="middle" x="15" y="11.5" height="6" width="10" class="moe"></rect>
<text fill="#000" x="30" dy="18" style="text-anchor: start;">Selected Area percent</text>

<rect x="2.5" y="29.5" height="1" width="20" class="comparisonmoe"></rect>
<circle cx="12.5" cy="30" r="2.5" class="comparison"></circle>
<text fill="#000" x="30" dy="33" style="text-anchor: start;">Comparison Area percent</text>

Expand Down
29 changes: 19 additions & 10 deletions app/templates/explorer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,27 @@
subtopic.charts
this.showCharts
)}}
<div class="cell large-4 xxlarge-3">
{{#each subtopic.charts as |chart|}}
{{acs-bar
title=chart.chartLabel
config=chart.chartConfig
survey=this.source.type
mode=this.source.mode
data=this.surveyData
height=204
}}
{{!-- HACK: literally prevent the rendering of 2010 census household type
because data are not available. If more charts are configured for years that
do not have data, then a generalized solution is needed --}}
{{#unless (and
(eq chart.chartLabel "Percent Distribution of Household Types")
(eq this.source.type "census")
(eq this.source.mode "previous")
)}}
<div class="cell large-4 xxlarge-3">
{{acs-bar
title=chart.chartLabel
config=chart.chartConfig
survey=this.source.type
mode=this.source.mode
data=this.surveyData
height=204
}}
</div>
{{/unless}}
{{/each}}
</div>
{{/if}}
</div>

Expand Down