Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: projection null #5381

Merged
merged 1 commit into from
Aug 9, 2023
Merged
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
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"test:unit": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/unit/ --coverage -i --logHeapUsage",
"test:integration": "node --expose-gc --max-old-space-size=4096 --unhandled-rejections=strict node_modules/jest/bin/jest __tests__/integration/ --coverage -i --logHeapUsage",
"test:treeshaking": "vite build -c ./__tests__/treeshaking/vite.config.js",
"test-live": "cross-env DEBUG_MODE=1 jest --watch",
"build:umd": "rimraf ./dist && rollup -c && npm run size",
"build:cjs": "rimraf ./lib && tsc --module commonjs --outDir lib",
"build:esm": "rimraf ./esm && tsc --module ESNext --outDir esm",
Expand Down
2 changes: 1 addition & 1 deletion src/geo/geoView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
function normalizeProjection(type: string) {
if (typeof type === 'function') return type;
const name = `geo${upperFirst(type)}`;
const projection = d3Projection[name];

Check warning on line 16 in src/geo/geoView.ts

View workflow job for this annotation

GitHub Actions / build

Unable to validate computed reference to imported namespace 'd3Projection'
if (!projection) throw new Error(`Unknown coordinate: ${type}`);
return projection;
}
Expand Down Expand Up @@ -184,7 +184,7 @@
});
const normalize = (point) => {
const visualPoint = visual(point);
if (!visualPoint) return null;
if (!visualPoint) return [null, null];
const [vx, vy] = visualPoint;
return [scaleX.map(vx), scaleY.map(vy)];
};
Expand Down
14 changes: 11 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
import { defineConfig } from 'vite';
import { deepMix } from '@antv/util';

const { LINK, MODULE } = process.env;

if (LINK === '1' && !MODULE) {
throw new Error(
`Please specify MODULE, for example: $ MODULE=@antv/gui npm run dev:link.`,
);
}

const linkOptions =
process.env.LINK === '1'
LINK === '1'
? {
server: {
watch: {
ignored: ['!**/node_modules/@antv/gui/**'],
ignored: [`!**/node_modules/${MODULE}/**`],
},
},
optimizeDeps: {
exclude: ['@antv/gui'],
exclude: [`${MODULE}`],
},
}
: {};
Expand Down
Loading