Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ exports[`Chart should provide the chart data to the children components 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Tooltip renders no tooltip when shape is being hovered 1`] = `
<div
class="ez-tooltip"
style="left: 416px; top: 284px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,7 @@ exports[`AreaChart renders an area chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,10 +647,7 @@ exports[`MultiAreaChart renders a multiarea chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,7 @@ exports[`BarChart renders a bar chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,7 @@ exports[`ColumnChart renders a column chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,7 @@ exports[`LineColumnChart renders a line & column chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,7 @@ exports[`LineChart renders a line chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,7 @@ exports[`LineErrorMarginChart renders a line error margin chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,7 @@ exports[`MultiLineChart renders a multiline chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@ exports[`MapChart renders a map chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ exports[`IrregularPieChart renders a irregular pie chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ exports[`PieChart renders a pie chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ exports[`RadialChart renders a Radial chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,7 @@ exports[`SemiCircleChart renders a semi-circle chart 1`] = `
</div>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,7 @@ exports[`BubbleChart renders a bubble chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,7 @@ exports[`ScatterChart renders a scatter chart 1`] = `
</svg>
</div>
</div>
<div
class="ez-tooltip"
style="left: 0px; top: 0px; opacity: 0;"
>
<div class="ez-tooltip">
</div>
</div>
</div>
Expand Down
26 changes: 11 additions & 15 deletions packages/ez-react/src/components/addons/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const Tooltip: FC<TooltipProps> = ({
};

return (
<div className="ez-tooltip" style={animatedStyle} {...rest}>
<div className="ez-tooltip" style={datum && animatedStyle} {...rest}>
{datum ? (
<>
{shapeDatum?.color && (
Expand All @@ -61,21 +61,17 @@ export const Tooltip: FC<TooltipProps> = ({
></div>
)}
<div className="ez-tooltip-text">
{Object.keys(attributes).map((attribute) => {
return (
<div
key={attribute}
className={`ez-tooltip-attribute ${attribute}`}
>
<div className="ez-tooltip-attribute--name">
{attribute} :
</div>
<div className="ez-tooltip-attribute--value">
{datum[attribute] as string}
</div>
{Object.keys(attributes).map((attribute) => (
<div
key={attribute}
className={`ez-tooltip-attribute ${attribute}`}
>
<div className="ez-tooltip-attribute--name">{attribute} :</div>
<div className="ez-tooltip-attribute--value">
{datum[attribute] as string}
</div>
);
})}
</div>
))}
</div>
</>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion packages/ez-vue/src/components/addons/tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class Tooltip extends mixins(AnimationMixin) {
</div>
</div>
) : (
<div class="ez-tooltip" style={animatedStyle}></div>
<div class="ez-tooltip"></div>
);
}
}