Browse Source

new renderStart event

merge-requests/15/head
rozetko 3 years ago
parent
commit
1580bf047e
  1. 6
      src/VueChartwerkPodMixin.ts
  2. 4
      src/index.ts
  3. 1
      src/types.ts

6
src/VueChartwerkPodMixin.ts

@ -78,6 +78,9 @@ export default {
if(has(this.$listeners, 'sharedCrosshairMove')) { if(has(this.$listeners, 'sharedCrosshairMove')) {
this.options.eventsCallbacks.sharedCrosshairMove = this.sharedCrosshairMove.bind(this); this.options.eventsCallbacks.sharedCrosshairMove = this.sharedCrosshairMove.bind(this);
} }
if(has(this.$listeners, 'renderStart')) {
this.options.eventsCallbacks.renderStart = this.renderStart.bind(this);
}
if(has(this.$listeners, 'renderEnd')) { if(has(this.$listeners, 'renderEnd')) {
this.options.eventsCallbacks.renderEnd = this.renderEnd.bind(this); this.options.eventsCallbacks.renderEnd = this.renderEnd.bind(this);
} }
@ -109,6 +112,9 @@ export default {
sharedCrosshairMove(event) { sharedCrosshairMove(event) {
this.$emit('sharedCrosshairMove', event); this.$emit('sharedCrosshairMove', event);
}, },
renderStart() {
this.$emit('renderStart');
},
renderEnd() { renderEnd() {
this.$emit('renderEnd'); this.$emit('renderEnd');
}, },

4
src/index.ts

@ -178,6 +178,10 @@ abstract class ChartwerkPod<T extends TimeSerie, O extends Options> {
} }
public render(): void { public render(): void {
if(has(this.options.eventsCallbacks, 'renderStart')) {
this.options.eventsCallbacks.renderStart();
}
this.renderClipPath(); this.renderClipPath();
this.addEvents(); this.addEvents();

1
src/types.ts

@ -25,6 +25,7 @@ export type Options = {
onLegendLabelClick?: (idx: number) => void, onLegendLabelClick?: (idx: number) => void,
contextMenu?: (evt: any) => void, // the same name as in d3.events contextMenu?: (evt: any) => void, // the same name as in d3.events
sharedCrosshairMove?: (event: any) => void, sharedCrosshairMove?: (event: any) => void,
renderStart?: () => void,
renderEnd?: () => void, renderEnd?: () => void,
}; };
axis?: { axis?: {

Loading…
Cancel
Save