Skip to content

Commit

Permalink
fix: merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
wb-xcf804241 committed Apr 9, 2024
2 parents 88a6110 + 9ad51a2 commit 974b4f1
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 133 deletions.
Binary file modified 3d/__tests__/e2e/snapshots/Bar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/BarPerspective.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/Line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/LinePerspective.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/Scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/ScatterLegend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/ScatterPerspective.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/ScatterPoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/ScatterTriangle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 3d/__tests__/e2e/snapshots/Surface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions 3d/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g2-extension-3d",
"version": "0.1.6",
"version": "0.2.0",
"main": "lib/index.js",
"module": "esm/index.js",
"unpkg": "dist/index.umd.min.js",
Expand All @@ -26,9 +26,10 @@
},
"dependencies": {
"d3-array": "^3.2.2",
"@antv/g": "^5.18.19",
"@antv/coord": "^0.4.7",
"@antv/g": "^6.0.0",
"@antv/g2": "^5.1.8",
"@antv/g-plugin-3d": "^1.9.5",
"@antv/g-plugin-3d": "^2.0.0",
"@antv/util": "^3.3.5",
"ndarray": "^1.0.19",
"ndarray-ops": "^1.2.2",
Expand All @@ -37,8 +38,8 @@
"colormap": "^2.3.2"
},
"devDependencies": {
"@antv/g-webgl": "^1.9.8",
"@antv/g-plugin-control": "^1.9.5",
"@antv/g-webgl": "^2.0.0",
"@antv/g-plugin-control": "^2.0.0",
"@types/d3-array": "3.0.5",
"@types/node": "^16.11.7",
"@types/ndarray": "^1.0.14",
Expand Down
3 changes: 0 additions & 3 deletions 3d/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { runtime } from "@antv/g";
import { Interval3D } from "./mark/interval3D";
import { Point3D } from "./mark/point3D";
import { Line3D } from "./mark/line3D";
import { Surface3D } from "./mark/surface3D";
import { Cartesian3D } from "./coordinate/coordinate3D";
import { AxisZ } from "./component/axisZ";

runtime.enableCSSParsing = false;

export function threedlib() {
return {
"coordinate.cartesian3D": Cartesian3D,
Expand Down
5 changes: 1 addition & 4 deletions 3d/src/shape/interval3D/cone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,12 @@ export const Cone: SC<ConeOptions> = (options, context) => {

const cone = new Mesh({
style: {
x: cx,
y: cy,
z: cz,
geometry: context!.coneGeometry,
material: context!.coneMaterial,
},
});
cone.setOrigin(0, 0, 0);
cone.scale([width, height, depth]);
cone.setPosition(cx, cy, cz);

const selection = select(cone)
.call(applyStyle, defaults)
Expand Down
8 changes: 1 addition & 7 deletions 3d/src/shape/interval3D/cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const Cube: SC<CubeOptions> = (options, context) => {
const plugin = renderer.getPlugin("device-renderer");
const device = plugin.getDevice();
// create a cube geometry
// @ts-ignore
context.cubeGeometry = new CubeGeometry(device, {
width: 1,
height: 1,
Expand All @@ -38,17 +37,12 @@ export const Cube: SC<CubeOptions> = (options, context) => {

const cube = new Mesh({
style: {
x: cx,
y: cy,
z: cz,
// @ts-ignore
geometry: context.cubeGeometry,
// @ts-ignore
material: context.cubeMaterial,
},
});
cube.setOrigin(0, 0, 0);
cube.scale([width, height, depth]);
cube.setPosition(cx, cy, cz);

const selection = select(cube)
.call(applyStyle, defaults)
Expand Down
5 changes: 1 addition & 4 deletions 3d/src/shape/interval3D/cylinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,12 @@ export const Cylinder: SC<CylinderOptions> = (options, context) => {

const cylinder = new Mesh({
style: {
x: cx,
y: cy,
z: cz,
geometry: context!.cylinderGeometry,
material: context!.cylinderMaterial,
},
});
cylinder.setOrigin(0, 0, 0);
cylinder.scale([width, height, depth]);
cylinder.setPosition(cx, cy, cz);

const selection = select(cylinder)
.call(applyStyle, defaults)
Expand Down
4 changes: 2 additions & 2 deletions 3d/src/shape/point3D/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const Color: SC<ColorOptions> = (options, context) => {
const p = select(document.createElement("path", {}))
.call(applyStyle, defaults)
.style("fill", "transparent")
.style("d", path(cx, cy, finalRadius))
.style("d", path(0, 0, finalRadius))
.style("isBillboard", true)
.style("lineWidth", finalLineWidth)
.style("transform", transform)
Expand All @@ -51,7 +51,7 @@ export const Color: SC<ColorOptions> = (options, context) => {
.call(applyStyle, style)
.node();

p.translateLocal(0, 0, cz);
p.translateLocal(cx, cy, cz);

return p;
};
Expand Down
5 changes: 1 addition & 4 deletions 3d/src/shape/point3D/cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ export const Cube: SC<CubeOptions> = (options, context) => {

const cube = new Mesh({
style: {
x: cx,
y: cy,
z: cz,
geometry: context!.cubeGeometry,
material: context!.cubeMaterial,
},
});
cube.setOrigin(0, 0, 0);
const scaling = finalRadius / GEOMETRY_SIZE;
cube.scale(scaling);
cube.setPosition(cx, cy, cz);

return select(cube)
.call(applyStyle, defaults)
Expand Down
5 changes: 1 addition & 4 deletions 3d/src/shape/point3D/sphere.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ export const Sphere: SC<SphereOptions> = (options, context) => {

const sphere = new Mesh({
style: {
x: cx,
y: cy,
z: cz,
geometry: context!.sphereGeometry,
material: context!.sphereMaterial,
},
});
sphere.setOrigin(0, 0, 0);
const scaling = finalRadius / GEOMETRY_SIZE;
sphere.scale(scaling);
sphere.setPosition(cx, cy, cz);

return select(sphere)
.call(applyStyle, defaults)
Expand Down
8 changes: 4 additions & 4 deletions plot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@antv/g2-extension-plot",
"version": "0.1.1",
"version": "0.2.0",
"description": "The mark plot in antv/g2",
"main": "lib/index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -28,13 +28,13 @@
},
"dependencies": {
"@antv/g2": "^5.1.8",
"@antv/g": "^5.18.19",
"@antv/util": "^3.3.5",
"d3-array": "^3.2.4",
"d3-hierarchy": "^3.1.2"
},
"devDependencies": {
"@antv/g-pattern": "^1.2.19",
"@antv/g": "^6.0.0",
"@antv/g-pattern": "^2.0.0",
"@types/node": "^16.11.7",
"@types/d3-array": "3.0.5",
"@rollup/plugin-commonjs": "^25.0.7",
Expand All @@ -60,4 +60,4 @@
"vite": "^4.3.9"
},
"repository": "https://github.com/antvis/g2-extensions.git"
}
}
Loading

0 comments on commit 974b4f1

Please sign in to comment.