代码之家  ›  专栏  ›  技术社区  ›  Basj

Plotly Zoom工具:如果选择宽度或选择高度太小,则拖放不会生成选择矩形(热图)

  •  0
  • Basj  · 技术社区  · 2 年前

    与Plotly。JS,当在工具栏中选择缩放工具时,有一个功能使得,当进行拖放以绘制选择矩形时, 如果选定的宽度或选定的高度低于常数 ,选择框不是矩形:

    image

    但还有其他事情:

    image

    如何禁用此功能?

    const z = Array.from({length: 500}, () => Array.from({length: 100}, () => Math.floor(Math.random() * 255)));
    Plotly.newPlot('plot', [{type: 'heatmap', z: z}], {});
    <script src="https://cdn.plot.ly/plotly-2.16.2.min.js"></script>
    <div id="plot"></div>
    0 回复  |  直到 2 年前