MCPcopy Index your code
hub / github.com/bqplot/bqplot / zoomed

Method zoomed

js/src/Map.ts:239–252  ·  view source on GitHub ↗
(that)

Source from the content-addressed store, hash-verified

237 }
238
239 zoomed(that) {
240 const tr = d3GetEvent().transform;
241 const h = that.height / 3;
242 const w = 2 * that.width;
243 tr.x = Math.min(
244 (that.width / 2) * (tr.k - 1),
245 Math.max((w / 2) * (1 - tr.k), tr.x)
246 );
247 tr.y = Math.min(
248 (that.height / 2) * (tr.k - 1) + this.height * tr.k,
249 Math.max((h / 2) * (1 - tr.k) - that.width * tr.k, tr.y)
250 );
251 that.transformed_g.style('stroke-width', 1 / tr.k).attr('transform', tr);
252 }
253
254 create_listeners() {
255 this.d3el

Callers 1

drawMethod · 0.95

Calls 1

d3GetEventFunction · 0.90

Tested by

no test coverage detected