Skip to content

Commit

Permalink
adds logic to default to 1-year estimates in viz builder and map
Browse files Browse the repository at this point in the history
  • Loading branch information
davelandry committed Mar 29, 2019
1 parent 910ddb6 commit a1132a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/pages/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ class Map extends Component {
defaultGroup={["Geography.County", "Origin State.Origin State"]}
defaultMeasure="Uninsured"
measureConfig={measureConfig}
tableLogic={cubes => {
const cube = cubes.find(d => d.name.match(/_1/));
return cube || cubes[0];
}}
config={{
colorScaleConfig: {color: colors.colorScaleGood},
colorScalePosition: "bottom",
Expand Down
6 changes: 5 additions & 1 deletion app/pages/Visualize.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const examples = [
title: "Black Females working in the Software Industry by State",
group: "Labor",
image: "/api/profile/soc/151131/thumb",
link: "/visualize?groups=0-z9TnC&groups=1-Z1Oby8M-2&groups=2-1mjmRl-5112&groups=3-1dQe8s-2&measure=1qWfo"
link: "/visualize?groups=0-1LK22m&groups=1-2rAHKG-2&groups=2-ZJJp1G-5112&groups=3-Z5TtG5-2&measure=ZkH9RT"
},
{
title: "German-Borns Working in the Performing Arts Industry",
Expand Down Expand Up @@ -384,6 +384,10 @@ class Visualize extends Component {
defaultGroup={["Geography.State", "Origin State.Origin State", "Gender.Gender", "Age.Age"]}
defaultMeasure="Total Population"
measureConfig={measureConfig}
tableLogic={cubes => {
const cube = cubes.find(d => d.name.match(/_1/));
return cube || cubes[0];
}}
config={{
colorScaleConfig: {
color: colors.colorScaleGood
Expand Down

0 comments on commit a1132a4

Please sign in to comment.