Skip to content

Commit

Permalink
Merge pull request #118 from Hexastack/fix/discontinued-line-chart
Browse files Browse the repository at this point in the history
fix: discontinued data for line charts
  • Loading branch information
marrouchi authored Apr 25, 2024
2 parents a85139a + d6ac450 commit 469c548
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/ez-core/src/utils/scale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const scaleDatumValue = <T = string | number>(
) => {
if (domainKey in datum) {
const value = datum[domainKey] as T;
const scaleValue = AnyScale.scale(value as NumberLike) || 0;
const scaleValue = AnyScale.scale(value as NumberLike);
return scaleValue;
}
throw new Error('Domain key does not exist in the supplied data');
Expand Down Expand Up @@ -143,9 +143,11 @@ export const scalePointData = (
xScale: AnyScale,
yScale: AnyScale
): PointDatum[] => {
return data.map(datum => {
return scalePointDatum(datum, xDomainKey, yDomainKey, xScale, yScale);
});
return data
.map(datum => {
return scalePointDatum(datum, xDomainKey, yDomainKey, xScale, yScale);
})
.filter(d => typeof d.x !== undefined && typeof d.y !== 'undefined');
};

export const scaleBubbleData = (
Expand Down

0 comments on commit 469c548

Please sign in to comment.