如何确定3D散点图(Plotly.js)上是否隐藏了点?

时间:2019-07-12 10:30:24

标签: d3.js svg plotly plotly-dash plotly.js

我正在使用Plotly.js绘制3-D散点图。在缩放时,我要检查哪些点可见。可以在svg级别完成此操作吗?还是任何阴谋专家?

摘要:

var myPlot = document.getElementById("myDiv");

var trace = {
  x: [1, 7, 2, 4,1],
  y: [12, 9, 15, 12,2],
  z: [1, 2, 4, 8,4],

  //  x: [1,2],
  //y: [12,15],
  //z: [1, 4],
mode: 'markers' ,
type: 'scatter3d' ,
marker: {size:5 }
}


var data = [trace];
var layout = {
  margin: {
    l: 0,
    r: 0,
    b: 0,
    t: 0} ,
  //title: {text: 'ReOptim8 Scatter Plot'},
  scene: {
    yaxis:{title: 'X-axis'},
    xaxis:{title: 'y-axis'},
    zaxis:{title: 'z-axis'},
        camera: {eye: {x:1.25, y:1.25, z:1.25}}
        }
};

var config = {
  displayModebar : true,
  displaylogo: false,
  responsive: true
  };

Plotly.plot( myPlot, data, layout, config );

下面的电笔链接:

https://codepen.io/aniwar/pen/wLOzZv

0 个答案:

没有答案