本文介绍了禁用d3刷子调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能有一个静态宽度的画笔,即不可调整大小的画笔?它仍然需要可拖动。

Is it possible to have a brush that is a static width ie a brush that is not resizable? It would still need to be draggable. There doesn't seem to be anything indicating whether it's possible in the documentation.

推荐答案

没有明确的选项,但所有你需要做的是在刷新事件处理程序中重置域,例如

There's no explicit option for that, but all you need to do is reset the domain in the brush event handler, for example

var brush = d3.svg.brush().on("brush", brushed);

function brushed() {
  brush.extent(desiredDomain);
}

这篇关于禁用d3刷子调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 16:47