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

Method positionCenter

js/src/Pie.ts:190–213  ·  view source on GitHub ↗
(animate?: boolean)

Source from the content-addressed store, hash-verified

188 }
189
190 private positionCenter(animate?: boolean) {
191 const animation_duration =
192 animate === true ? this.parent.model.get('animation_duration') : 0;
193 const x_scale = this.scales.x ? this.scales.x : this.parent.scale_x;
194 const y_scale = this.scales.y ? this.scales.y : this.parent.scale_y;
195 const x =
196 x_scale.model.type === 'date'
197 ? getDate(this.model.get('x'))
198 : this.model.get('x');
199 const y =
200 y_scale.model.type === 'date'
201 ? getDate(this.model.get('y'))
202 : this.model.get('y');
203 const transform =
204 'translate(' +
205 (x_scale.scale(x) + x_scale.offset) +
206 ', ' +
207 (y_scale.scale(y) + y_scale.offset) +
208 ')';
209 this.pieSelection
210 .transition('positionCenter')
211 .duration(animation_duration)
212 .attr('transform', transform);
213 }
214
215 private updateRadius(animate?: boolean) {
216 const animation_duration =

Callers 3

create_listenersMethod · 0.95
relayoutMethod · 0.95
drawMethod · 0.95

Calls 1

getDateFunction · 0.90

Tested by

no test coverage detected