d3/d3-brush

brush().touchable not a function

japrescott opened this issue · 2 comments

I am trying to override the touch detector to disable the brush on touch enabled devices.
when setting up the brush, I get an error that touchable is not a function

			brush = d3.brushX()
				.touchable(()=>{ // <-- throws error
					return false;
				})
				.filter(()=>{
					return !d3.event.shiftKey;
				})
				.extent([[0, 0], [width, height]])
				.on("start", () => {
					console.log('brush started');
				})

looking at the sourcecode doesn't seem to correlate with the information provided in the Readme. Is this a relic of the past or will this be exposed in the future?

It looks like the touchable logic was implemented internally, but the brush.touchable accessor wasn’t exposed as intended. brush.touchable was intended to be added in d3-brush 1.1.0 (d3 5.10.0).

Fixed in 1.1.5.