- {column.nodes.map(({ name, total, selected, paths, from }, nodeIndex) => {
- const active =
- selected && activeNode?.paths.find(path => path.items[columnIndex] === name);
+ {column.nodes.map(
+ ({ name, total, selected, paths, from, selectedCount }, nodeIndex) => {
+ const active =
+ selected && activeNode?.paths.find(path => path.items[columnIndex] === name);
- const lines = from?.reduce((arr, { name }: any) => {
- const fromIndex = columns[columnIndex - 1]?.nodes.findIndex(node => {
- return node.name === name && node.selected;
- });
+ const lines = from?.reduce((arr, { name }: any) => {
+ const fromIndex = columns[columnIndex - 1]?.nodes.findIndex(node => {
+ return node.name === name && node.selected;
+ });
- if (fromIndex > -1) {
- arr.push([fromIndex, nodeIndex]);
- }
+ if (fromIndex > -1) {
+ arr.push([fromIndex, nodeIndex]);
+ }
- return arr;
- }, []);
+ return arr;
+ }, []);
- return (
-
handleClick(name, columnIndex, paths)}
- onMouseEnter={() => selected && setActiveNode({ name, columnIndex, paths })}
- onMouseLeave={() => selected && setActiveNode(null)}
- >
-
{name}
-
{total}
- {columnIndex < columns.length &&
- lines.map(([fromIndex, nodeIndex], i) => {
- const height =
- (Math.abs(nodeIndex - fromIndex) + 1) * (NODE_HEIGHT + NODE_GAP) -
- NODE_GAP;
- const midHeight =
- (Math.abs(nodeIndex - fromIndex) - 1) * (NODE_HEIGHT + NODE_GAP) +
- NODE_GAP +
- LINE_WIDTH;
- const nodeName = columns[columnIndex - 1]?.nodes[fromIndex].name;
-
- return (
-
- path.items[columnIndex] === name &&
- path.items[columnIndex - 1] === nodeName,
- ),
- [styles.up]: fromIndex < nodeIndex,
- [styles.down]: fromIndex > nodeIndex,
- [styles.flat]: fromIndex === nodeIndex,
- })}
- style={{ height }}
- >
-
-
-
-
- );
+ return (
+
- );
- })}
+ onClick={() => handleClick(name, columnIndex, paths)}
+ onMouseEnter={() => selected && setActiveNode({ name, columnIndex, paths })}
+ onMouseLeave={() => selected && setActiveNode(null)}
+ >
+
{name}
+
+ {selected || active ? selectedCount : total}
+
+ {columnIndex < columns.length &&
+ lines.map(([fromIndex, nodeIndex], i) => {
+ const height =
+ (Math.abs(nodeIndex - fromIndex) + 1) * (NODE_HEIGHT + NODE_GAP) -
+ NODE_GAP;
+ const midHeight =
+ (Math.abs(nodeIndex - fromIndex) - 1) * (NODE_HEIGHT + NODE_GAP) +
+ NODE_GAP +
+ LINE_WIDTH;
+ const nodeName = columns[columnIndex - 1]?.nodes[fromIndex].name;
+
+ return (
+
+ path.items[columnIndex] === name &&
+ path.items[columnIndex - 1] === nodeName,
+ ),
+ [styles.up]: fromIndex < nodeIndex,
+ [styles.down]: fromIndex > nodeIndex,
+ [styles.flat]: fromIndex === nodeIndex,
+ })}
+ style={{ height }}
+ >
+
+
+
+
+ );
+ })}
+
+ );
+ },
+ )}
);
diff --git a/src/queries/analytics/reports/getJourney.ts b/src/queries/analytics/reports/getJourney.ts
index 34d166a5..04e36549 100644
--- a/src/queries/analytics/reports/getJourney.ts
+++ b/src/queries/analytics/reports/getJourney.ts
@@ -10,7 +10,7 @@ interface JourneyResult {
e5: string;
e6: string;
e7: string;
- count: string;
+ count: number;
}
export async function getJourney(
@@ -267,6 +267,6 @@ function combineSequentialDuplicates(array: any) {
function parseResult(data: any) {
return data.map(({ e1, e2, e3, e4, e5, e6, e7, count }) => ({
items: combineSequentialDuplicates([e1, e2, e3, e4, e5, e6, e7]),
- count,
+ count: +count,
}));
}