-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: support cartesian3d transform #44
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实我在想,是不是直接新增一个 Coordinate3d 会好一点?2d 和 3d 不会同时出现,2d 有 2d 的 transform,3d 有 3d 的 transform,架构更清晰和干净一点,也对打包体积更友好。
const coord3 = new Coordinate3D({});
coord3.transform('cartesian3D');
有点类似 gl-matrix 也有 mat3,mat4。
echarts-gl 也采用了同样的方式扩展 coord: https://github.com/ecomfe/echarts-gl/blob/master/src/coord/grid3D/Cartesian3D.js |
新增 Coordinate3D,目前支持 cartesian3D、translate3D 和 scale3D 三个 transform const coord = new Coordinate3D({
width: 100,
height: 50,
depth: 100,
transformations: [['cartesian3D']],
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀🚀🚀
@@ -53,7 +54,7 @@ | |||
"rollup-plugin-typescript": "^1.0.1", | |||
"rollup-plugin-uglify": "^6.0.4", | |||
"ts-jest": "^26.5.1", | |||
"typescript": "^4.1.5" | |||
"typescript": "4.8.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用最新的 typescript 4.9.x 构建会直接报错,暂时退回 4.8.x
microsoft/TypeScript#51644
报错信息:
[!] (plugin typescript) TypeError: hostOrText.readFile is not a function
新增加了一种 transform,以便支持 3D 场景:
暂不支持和其他 transform 进行 compose,因为参数数目不同(多出来了 z 和 depth)。
测试用例已补充。
另外移除了
@antv/matrix-util
,替换成了gl-matrix
,前者其实也就是 export 了后者。