diff --git a/src/web/questions/components/HistoryChart/InnerChart.tsx b/src/web/questions/components/HistoryChart/InnerChart.tsx index 872c9d6..bd11714 100644 --- a/src/web/questions/components/HistoryChart/InnerChart.tsx +++ b/src/web/questions/components/HistoryChart/InnerChart.tsx @@ -13,8 +13,10 @@ import { VictoryVoronoiContainer, } from "victory"; -import { chartColors, ChartData, ChartSeries, height, width } from "./utils"; +import { chartColors, ChartData, ChartSeries, goldenRatio } from "./utils"; +const height = 400 +const width = height * goldenRatio let dateFormat = "MMM do y"; // "yyyy-MM-dd" // can't be replaced with React component, VictoryChart requires VictoryGroup elements to be immediate children diff --git a/src/web/questions/components/HistoryChart/utils.ts b/src/web/questions/components/HistoryChart/utils.ts index 839bcbb..1ee6b12 100644 --- a/src/web/questions/components/HistoryChart/utils.ts +++ b/src/web/questions/components/HistoryChart/utils.ts @@ -18,7 +18,7 @@ export const chartColors = [ "#F59E0B", // amber-500 ]; -const goldenRatio = (1 + Math.sqrt(5)) / 2; +export const goldenRatio = (1 + Math.sqrt(5)) / 2; // used both for chart and for ssr placeholder export const width = 750; export const height = width / goldenRatio; diff --git a/src/web/questions/pages/EmbedQuestionPage.tsx b/src/web/questions/pages/EmbedQuestionPage.tsx index 7bc3ce9..5b51df6 100644 --- a/src/web/questions/pages/EmbedQuestionPage.tsx +++ b/src/web/questions/pages/EmbedQuestionPage.tsx @@ -40,7 +40,7 @@ const EmbedQuestionPage: NextPage = ({ id }) => { {({ data: { result: question } }) => question ? ( -
+