+
+
+
+ {/*
{question.title}
-
-
`${datum.x}: ${Math.round(datum.y * 100)}%`}
- labelComponent={
-
- }
- voronoiBlacklist={
- ["line0", "line1", "line2", "line3", "line4"]
+ */}
+
+
+ `${datum.x}: ${Math.round(datum.y * 100)}%`
+ }
+ labelComponent={
+
+ }
+ voronoiBlacklist={
+ ["line-0", "line-1", "line-2", "line-3", "line-4"]
- //Array.from(Array(5).keys()).map((x, i) => `line${i}`)
- // see: https://github.com/FormidableLabs/victory/issues/545
- }
- />
- }
- domain={{
- y: [0, 1],
- }}
- >
- ({
- name: dataSetsNames[i],
- symbol: { fill: colors[i] },
- }))
- /*[
+ //Array.from(Array(5).keys()).map((x, i) => `line${i}`)
+ // see: https://github.com/FormidableLabs/victory/issues/545
+ }
+ />
+ }
+ domain={{
+ y: [0, 1],
+ }}
+ >
+ ({
+ name: dataSetsNames[i],
+ symbol: { fill: colors[i] },
+ }))
+ /*[
{ name: "One", symbol: { fill: "tomato", type: "star" } },
{ name: "Two", symbol: { fill: "orange" } },
{ name: "Three", symbol: { fill: "gold" } },
]*/
- }
- />
+ }
+ />
- {dataSets.slice(0, 5).map((dataset, i) => getVictoryGroup(dataset, i))}
- datum.x)}
- // tickFormat={dataAsXy.map((datum) => datum.x)}
- tickCount={7}
- style={{
- grid: { stroke: null, strokeWidth: 0.5 },
- }}
- //axisLabelComponent={
- //
- //}
- // label="Date (dd/mm/yy)"
- tickLabelComponent={
-
- }
- />
- `${x * 100}%`}
- style={{
- grid: { stroke: "#D3D3D3", strokeWidth: 0.5 },
- }}
- tickLabelComponent={
-
- }
- />
-
+ {dataSets
+ .slice(0, 5)
+ .map((dataset, i) => getVictoryGroup(dataset, i))}
+ datum.x)}
+ // tickFormat={dataAsXy.map((datum) => datum.x)}
+ tickCount={7}
+ style={{
+ grid: { stroke: null, strokeWidth: 0.5 },
+ }}
+ //axisLabelComponent={
+ //
+ //}
+ // label="Date (dd/mm/yy)"
+ tickLabelComponent={
+
+ }
+ />
+ `${x * 100}%`}
+ style={{
+ grid: { stroke: "#D3D3D3", strokeWidth: 0.5 },
+ }}
+ tickLabelComponent={
+
+ }
+ />
+
+
);
};
diff --git a/src/web/questions/components/QuestionOptions.tsx b/src/web/questions/components/QuestionOptions.tsx
index d984747..4a5ff9b 100644
--- a/src/web/questions/components/QuestionOptions.tsx
+++ b/src/web/questions/components/QuestionOptions.tsx
@@ -112,7 +112,8 @@ export const QuestionOptions: React.FC<{ options: Option[] }> = ({
const isBinary =
options.length === 2 &&
(options[0].name === "Yes" || options[0].name === "No");
-
+ const getYesOption = (options) =>
+ options.find((option) => option.name == "Yes");
const optionsSorted = options.sort((a, b) => b.probability - a.probability);
const optionsMax5 = !!optionsSorted.slice ? optionsSorted.slice(0, 5) : []; // display max 5 options.
@@ -121,17 +122,17 @@ export const QuestionOptions: React.FC<{ options: Option[] }> = ({
- {formatProbability(options[0].probability)}
+ {formatProbability(getYesOption(options).probability)}
- {primaryEstimateAsText(options[0].probability)}
+ {primaryEstimateAsText(getYesOption(options).probability)}
);
diff --git a/src/web/questions/pages/QuestionPage.tsx b/src/web/questions/pages/QuestionPage.tsx
index 4b2b926..739c251 100644
--- a/src/web/questions/pages/QuestionPage.tsx
+++ b/src/web/questions/pages/QuestionPage.tsx
@@ -40,8 +40,8 @@ export const getServerSideProps: GetServerSideProps = async (
const QuestionCardContents: React.FC<{
question: QuestionWithHistoryFragment;
}> = ({ question }) => (
-
-
+
+
-
+
+ {/*
+
-
+ */}
+
+
+ {"Question description"}
+
+
+
{question.description}
-
-
);
const QuestionPage: NextPage = ({ id }) => {
return (
-