@@ -1642,6 +1642,7 @@ export async function force(context) {
1642
1642
const material = new MeshPhongMaterial ( device , {
1643
1643
shininess : 30 ,
1644
1644
} ) ;
1645
+ // material.polygonOffset = true;
1645
1646
1646
1647
// @see https://antv.vision/en/docs/specification/language/palette#%E5%88%86%E7%B1%BB%E8%89%B2%E6%9D%BF
1647
1648
const colorPalette = [
@@ -1683,78 +1684,78 @@ export async function force(context) {
1683
1684
sphere . style . fill = fill ;
1684
1685
} ) ;
1685
1686
1686
- const icon = new Image ( {
1687
- style : {
1688
- x : node . x + 310 ,
1689
- y : node . y + 250 ,
1690
- z : node . z - 1 ,
1691
- width : 10 ,
1692
- height : 10 ,
1693
- src : 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*N4ZMS7gHsUIAAAAAAAAAAABkARQnAQ' ,
1694
- isBillboard : true ,
1695
- } ,
1696
- } ) ;
1697
- canvas . appendChild ( icon ) ;
1687
+ // const icon = new Image({
1688
+ // style: {
1689
+ // x: node.x + 310,
1690
+ // y: node.y + 250,
1691
+ // z: node.z - 1,
1692
+ // width: 10,
1693
+ // height: 10,
1694
+ // src: 'https://gw.alipayobjects.com/mdn/rms_6ae20b/afts/img/A*N4ZMS7gHsUIAAAAAAAAAAABkARQnAQ',
1695
+ // isBillboard: true,
1696
+ // },
1697
+ // });
1698
+ // canvas.appendChild(icon);
1698
1699
1699
- const circle = new Circle ( {
1700
- style : {
1701
- cx : node . x + 310 ,
1702
- cy : node . y + 250 ,
1703
- cz : node . z - 2 ,
1704
- r : 2.5 ,
1705
- fill : 'red' ,
1706
- isBillboard : true ,
1707
- } ,
1708
- } ) ;
1709
- canvas . appendChild ( circle ) ;
1700
+ // const circle = new Circle({
1701
+ // style: {
1702
+ // cx: node.x + 310,
1703
+ // cy: node.y + 250,
1704
+ // cz: node.z - 2,
1705
+ // r: 2.5,
1706
+ // fill: 'red',
1707
+ // isBillboard: true,
1708
+ // },
1709
+ // });
1710
+ // canvas.appendChild(circle);
1710
1711
1711
- const label = new Text ( {
1712
- style : {
1713
- x : node . x + 310 ,
1714
- y : node . y + 250 ,
1715
- z : node . z + 1 ,
1716
- fontFamily : 'sans-serif' ,
1717
- text : node . id ,
1718
- fontSize : 6 ,
1719
- fill : 'black' ,
1720
- isBillboard : true ,
1721
- } ,
1722
- } ) ;
1712
+ // const label = new Text({
1713
+ // style: {
1714
+ // x: node.x + 310,
1715
+ // y: node.y + 250,
1716
+ // z: node.z + 1,
1717
+ // fontFamily: 'sans-serif',
1718
+ // text: node.id,
1719
+ // fontSize: 6,
1720
+ // fill: 'black',
1721
+ // isBillboard: true,
1722
+ // },
1723
+ // });
1723
1724
1724
- const rect = new Rect ( {
1725
- style : {
1726
- x : node . x + 310 ,
1727
- y : node . y + 250 ,
1728
- z : node . z ,
1729
- width : label . getBBox ( ) . width ,
1730
- height : 8 ,
1731
- fill : 'grey' ,
1732
- isBillboard : true ,
1733
- fillOpacity : 0.6 ,
1734
- } ,
1735
- } ) ;
1736
- canvas . appendChild ( rect ) ;
1737
- canvas . appendChild ( label ) ;
1725
+ // const rect = new Rect({
1726
+ // style: {
1727
+ // x: node.x + 310,
1728
+ // y: node.y + 250,
1729
+ // z: node.z,
1730
+ // width: label.getBBox().width,
1731
+ // height: 8,
1732
+ // fill: 'grey',
1733
+ // isBillboard: true,
1734
+ // fillOpacity: 0.6,
1735
+ // },
1736
+ // });
1737
+ // canvas.appendChild(rect);
1738
+ // canvas.appendChild(label);
1738
1739
} ) ;
1739
1740
1740
- dataset . links . forEach ( ( edge ) => {
1741
- const { source, target } = edge ;
1742
- const line = new Line ( {
1743
- style : {
1744
- x1 : source . x + 300 ,
1745
- y1 : source . y + 250 ,
1746
- z1 : source . z ,
1747
- x2 : target . x + 300 ,
1748
- y2 : target . y + 250 ,
1749
- z2 : target . z ,
1750
- stroke : 'black' ,
1751
- lineWidth : 2 ,
1752
- opacity : 0.5 ,
1753
- isBillboard : true , // 始终面向屏幕
1754
- } ,
1755
- } ) ;
1756
- canvas . appendChild ( line ) ;
1757
- } ) ;
1741
+ // dataset.links.forEach((edge) => {
1742
+ // const { source, target } = edge;
1743
+ // const line = new Line({
1744
+ // style: {
1745
+ // x1: source.x + 300,
1746
+ // y1: source.y + 250,
1747
+ // z1: source.z,
1748
+ // x2: target.x + 300,
1749
+ // y2: target.y + 250,
1750
+ // z2: target.z,
1751
+ // stroke: 'black',
1752
+ // lineWidth: 2,
1753
+ // opacity: 0.5,
1754
+ // isBillboard: true, // 始终面向屏幕
1755
+ // },
1756
+ // });
1757
+ // canvas.appendChild(line);
1758
+ // });
1758
1759
1759
1760
// add a directional light into scene
1760
1761
const light = new DirectionalLight ( {
0 commit comments