Browse Source

Merge branch 'render-start-event' into 'main'

new renderStart event

See merge request chartwerk/core!15
merge-requests/16/head
rozetko 3 years ago
parent
commit
900ae79a55
  1. 1
      dist/VueChartwerkPodMixin.d.ts
  2. 2
      dist/index.js
  3. 1
      dist/types.d.ts
  4. 6
      src/VueChartwerkPodMixin.ts
  5. 4
      src/index.ts
  6. 1
      src/types.ts

1
dist/VueChartwerkPodMixin.d.ts vendored

@ -41,6 +41,7 @@ declare const _default: {
panning(range: any): void;
contextMenu(evt: any): void;
sharedCrosshairMove(event: any): void;
renderStart(): void;
renderEnd(): void;
};
};

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

1
dist/types.d.ts vendored

@ -33,6 +33,7 @@ export declare type Options = {
onLegendLabelClick?: (idx: number) => void;
contextMenu?: (evt: any) => void;
sharedCrosshairMove?: (event: any) => void;
renderStart?: () => void;
renderEnd?: () => void;
};
axis?: {

6
src/VueChartwerkPodMixin.ts

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

4
src/index.ts

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

1
src/types.ts

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

Loading…
Cancel
Save