Skip to content

Commit

Permalink
adjust chart sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
macfarlandian committed Jan 30, 2021
1 parent 3a1b035 commit 04e19e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import FiltersWrapper from "../FiltersWrapper";
import NoMetricData from "../NoMetricData";
import { zIndex } from "../UiLibrary";

const SECTION_HEIGHT = 450;
const GUTTER = 42;
const bubbleChartHeight = 325;

const barChartsHeight = 460;
const barChartsGutter = 42;

const ChartWrapper = styled.div`
position: relative;
Expand All @@ -54,8 +56,8 @@ const VizDemographicsByCategory: React.FC<VizDemographicsByCategoryProps> = ({
const { demographicView, dataSeries } = metric;

const [chartContainerStyles, setChartContainerStyles] = useSpring(() => ({
from: { height: SECTION_HEIGHT },
height: SECTION_HEIGHT,
from: { height: bubbleChartHeight },
height: bubbleChartHeight,
config: { friction: 40, tension: 280, clamp: true },
}));

Expand Down Expand Up @@ -99,7 +101,7 @@ const VizDemographicsByCategory: React.FC<VizDemographicsByCategoryProps> = ({
item.dataSeries &&
(item.demographicView === "total" ? (
<BubbleChart
height={SECTION_HEIGHT}
height={bubbleChartHeight}
data={item.dataSeries[0].records}
/>
) : (
Expand All @@ -116,7 +118,8 @@ const VizDemographicsByCategory: React.FC<VizDemographicsByCategoryProps> = ({
<ProportionalBar
data={records}
height={
SECTION_HEIGHT / categories.length - GUTTER
barChartsHeight / categories.length -
barChartsGutter
}
title={label}
showLegend={index === categories.length - 1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class DemographicsByCategoryMetric extends Metric<
records: records
.filter((record) =>
demographicView === "total"
? recordIsTotalByDimension(demographicView)
? true
: record[demographicView] === identifier
)
.map((record, index) => {
Expand Down

0 comments on commit 04e19e8

Please sign in to comment.