Skip to content

Commit

Permalink
fix(area): one missing point (#5229)
Browse files Browse the repository at this point in the history
  • Loading branch information
pearmini authored Jun 25, 2023
1 parent 3eb6b61 commit 4977031
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions __tests__/plots/static/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,3 +264,4 @@ export { weatherLineMultiAxesLegend } from './weather-line-multi-axes-legend';
export { population2015IntervalDonutTextAnnotationInset } from './population2015-interval-donut-text-annotation-inset';
export { stocksLineSeriesGradient } from './stocks-line-series-gradient';
export { aaplLineMissingDataTrial } from './aapl-line-missing-data-trial';
export { mockAreaMissingData } from './mock-area-missing-data';
19 changes: 19 additions & 0 deletions __tests__/plots/static/mock-area-missing-data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { G2Spec } from '../../../src';

export function mockAreaMissingData(): G2Spec {
return {
type: 'area',
padding: 'auto',
data: [
{ province: 'A', city: 'a', categories: 'Q1', gross: null },
{ province: 'B', city: 'b', categories: 'Q2', gross: 2610.5 },
{ province: 'B', city: 'c', categories: 'Q2', gross: 417.23 },
],
encode: {
x: 'city',
y: 'gross',
shape: 'smooth',
color: (d) => `${d.province}+${d.categories}`,
},
};
}
2 changes: 1 addition & 1 deletion src/shape/area/curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const Curve: SC<CurveOptions> = (options, context) => {

const getPathNode = (path) => {
return select(document.createElement('path', {}))
.style('d', path)
.style('d', path || '')
.call(applyStyle, finalStyle)
.node();
};
Expand Down

0 comments on commit 4977031

Please sign in to comment.