From a0cc639a9283c27c2bef2f794444b6444ef185ce Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Mon, 13 May 2024 23:20:02 +0100 Subject: [PATCH] fix: eazychart-[react & vue] - empty tooltip v0.01 --- .../snapshots/components/Chart.spec.tsx.snap | 5 +-- .../components/addons/Tooltip.spec.tsx.snap | 5 +-- .../recipes/area/AreaChart.spec.tsx.snap | 5 +-- .../recipes/area/MultiAreaChart.spec.tsx.snap | 5 +-- .../recipes/bar/BarChart.spec.tsx.snap | 5 +-- .../recipes/column/ColumnChart.spec.tsx.snap | 5 +-- .../column/LineColumnChart.spec.tsx.snap | 5 +-- .../recipes/line/LineChart.spec.tsx.snap | 5 +-- .../line/LineErrorMarginChart.spec.tsx.snap | 5 +-- .../recipes/line/MultiLineChart.spec.tsx.snap | 5 +-- .../recipes/map/MapChart.spec.tsx.snap | 5 +-- .../pie/IrregularPieChart.spec.tsx.snap | 5 +-- .../recipes/pie/PieChart.spec.tsx.snap | 5 +-- .../recipes/pie/RadialChart.spec.tsx.snap | 5 +-- .../recipes/pie/SemiCircleChart.spec.tsx.snap | 5 +-- .../recipes/scatter/BubbleChart.spec.tsx.snap | 5 +-- .../scatter/ScatterChart.spec.tsx.snap | 5 +-- .../src/components/addons/tooltip/Tooltip.tsx | 43 +++++++++++-------- .../src/components/addons/tooltip/Tooltip.tsx | 4 +- 19 files changed, 45 insertions(+), 87 deletions(-) diff --git a/packages/ez-dev/jest/snapshots/components/Chart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/components/Chart.spec.tsx.snap index 53c324d4..dfdbd0e3 100644 --- a/packages/ez-dev/jest/snapshots/components/Chart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/components/Chart.spec.tsx.snap @@ -50,10 +50,7 @@ exports[`Chart should provide the chart data to the children components 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/components/addons/Tooltip.spec.tsx.snap b/packages/ez-dev/jest/snapshots/components/addons/Tooltip.spec.tsx.snap index be39a809..8e3ba355 100644 --- a/packages/ez-dev/jest/snapshots/components/addons/Tooltip.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/components/addons/Tooltip.spec.tsx.snap @@ -1,10 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Tooltip renders no tooltip when shape is being hovered 1`] = ` -
+
`; diff --git a/packages/ez-dev/jest/snapshots/recipes/area/AreaChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/area/AreaChart.spec.tsx.snap index 3031dbb8..de9acb1f 100644 --- a/packages/ez-dev/jest/snapshots/recipes/area/AreaChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/area/AreaChart.spec.tsx.snap @@ -479,10 +479,7 @@ exports[`AreaChart renders an area chart 1`] = `
-
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/area/MultiAreaChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/area/MultiAreaChart.spec.tsx.snap index bb9314df..153594dd 100644 --- a/packages/ez-dev/jest/snapshots/recipes/area/MultiAreaChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/area/MultiAreaChart.spec.tsx.snap @@ -647,10 +647,7 @@ exports[`MultiAreaChart renders a multiarea chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/bar/BarChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/bar/BarChart.spec.tsx.snap index 1e1cb3f1..59112a3e 100644 --- a/packages/ez-dev/jest/snapshots/recipes/bar/BarChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/bar/BarChart.spec.tsx.snap @@ -396,10 +396,7 @@ exports[`BarChart renders a bar chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/column/ColumnChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/column/ColumnChart.spec.tsx.snap index 25d8631f..80d32d70 100644 --- a/packages/ez-dev/jest/snapshots/recipes/column/ColumnChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/column/ColumnChart.spec.tsx.snap @@ -396,10 +396,7 @@ exports[`ColumnChart renders a column chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/column/LineColumnChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/column/LineColumnChart.spec.tsx.snap index 9e73e50d..ab2365fd 100644 --- a/packages/ez-dev/jest/snapshots/recipes/column/LineColumnChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/column/LineColumnChart.spec.tsx.snap @@ -643,10 +643,7 @@ exports[`LineColumnChart renders a line & column chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/line/LineChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/line/LineChart.spec.tsx.snap index d71aa7a7..8f01c746 100644 --- a/packages/ez-dev/jest/snapshots/recipes/line/LineChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/line/LineChart.spec.tsx.snap @@ -468,10 +468,7 @@ exports[`LineChart renders a line chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/line/LineErrorMarginChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/line/LineErrorMarginChart.spec.tsx.snap index d5297eac..0f42e75e 100644 --- a/packages/ez-dev/jest/snapshots/recipes/line/LineErrorMarginChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/line/LineErrorMarginChart.spec.tsx.snap @@ -579,10 +579,7 @@ exports[`LineErrorMarginChart renders a line error margin chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/line/MultiLineChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/line/MultiLineChart.spec.tsx.snap index 9cea1edc..7f918bd5 100644 --- a/packages/ez-dev/jest/snapshots/recipes/line/MultiLineChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/line/MultiLineChart.spec.tsx.snap @@ -625,10 +625,7 @@ exports[`MultiLineChart renders a multiline chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/map/MapChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/map/MapChart.spec.tsx.snap index 5c3d19c0..a78d5e94 100644 --- a/packages/ez-dev/jest/snapshots/recipes/map/MapChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/map/MapChart.spec.tsx.snap @@ -51,10 +51,7 @@ exports[`MapChart renders a map chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/pie/IrregularPieChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/pie/IrregularPieChart.spec.tsx.snap index b401dc40..5cbca184 100644 --- a/packages/ez-dev/jest/snapshots/recipes/pie/IrregularPieChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/pie/IrregularPieChart.spec.tsx.snap @@ -94,10 +94,7 @@ exports[`IrregularPieChart renders a irregular pie chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/pie/PieChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/pie/PieChart.spec.tsx.snap index e6f568b5..42ead5d3 100644 --- a/packages/ez-dev/jest/snapshots/recipes/pie/PieChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/pie/PieChart.spec.tsx.snap @@ -92,10 +92,7 @@ exports[`PieChart renders a pie chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/pie/RadialChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/pie/RadialChart.spec.tsx.snap index 252f8797..eb65c32c 100644 --- a/packages/ez-dev/jest/snapshots/recipes/pie/RadialChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/pie/RadialChart.spec.tsx.snap @@ -94,10 +94,7 @@ exports[`RadialChart renders a Radial chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/pie/SemiCircleChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/pie/SemiCircleChart.spec.tsx.snap index e8e27ff3..fced98af 100644 --- a/packages/ez-dev/jest/snapshots/recipes/pie/SemiCircleChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/pie/SemiCircleChart.spec.tsx.snap @@ -92,10 +92,7 @@ exports[`SemiCircleChart renders a semi-circle chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/scatter/BubbleChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/scatter/BubbleChart.spec.tsx.snap index b5b6f845..1a02b71c 100644 --- a/packages/ez-dev/jest/snapshots/recipes/scatter/BubbleChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/scatter/BubbleChart.spec.tsx.snap @@ -515,10 +515,7 @@ exports[`BubbleChart renders a bubble chart 1`] = ` -
+
diff --git a/packages/ez-dev/jest/snapshots/recipes/scatter/ScatterChart.spec.tsx.snap b/packages/ez-dev/jest/snapshots/recipes/scatter/ScatterChart.spec.tsx.snap index c5d51b1b..0378249f 100644 --- a/packages/ez-dev/jest/snapshots/recipes/scatter/ScatterChart.spec.tsx.snap +++ b/packages/ez-dev/jest/snapshots/recipes/scatter/ScatterChart.spec.tsx.snap @@ -516,10 +516,7 @@ exports[`ScatterChart renders a scatter chart 1`] = ` -
+
diff --git a/packages/ez-react/src/components/addons/tooltip/Tooltip.tsx b/packages/ez-react/src/components/addons/tooltip/Tooltip.tsx index 27846620..35f9883b 100644 --- a/packages/ez-react/src/components/addons/tooltip/Tooltip.tsx +++ b/packages/ez-react/src/components/addons/tooltip/Tooltip.tsx @@ -50,24 +50,31 @@ export const Tooltip: FC = ({ color: undefined, }; - return datum ? ( -
- {shapeDatum?.color && ( -
- )} -
- {Object.keys(attributes).map((attribute) => ( -
-
{attribute} :
-
- {datum[attribute] as string} -
+ return ( +
+ {datum ? ( + <> + {shapeDatum?.color && ( +
+ )} +
+ {Object.keys(attributes).map((attribute) => ( +
+
{attribute} :
+
+ {datum[attribute] as string} +
+
+ ))}
- ))} -
+ + ) : null}
- ) : null; + ); }; diff --git a/packages/ez-vue/src/components/addons/tooltip/Tooltip.tsx b/packages/ez-vue/src/components/addons/tooltip/Tooltip.tsx index 7cdc624d..c8ea0f67 100644 --- a/packages/ez-vue/src/components/addons/tooltip/Tooltip.tsx +++ b/packages/ez-vue/src/components/addons/tooltip/Tooltip.tsx @@ -128,6 +128,8 @@ export default class Tooltip extends mixins(AnimationMixin) { ))}
- ) : null; + ) : ( +
+ ); } }