Browse Source

Merge pull request 'rm abstact keyword and methods' (#36) from bad-abstract-onmouseclick-#35 into main

Reviewed-on: #36
0.6.24
Coin de Gamma 8 months ago
parent
commit
63bf4ca931
  1. 6
      demo/demo_pod.ts
  2. 16
      src/index.ts

6
demo/demo_pod.ts

@ -51,12 +51,6 @@ class DemoPod extends ChartwerkPod<Serie, Options> {
.attr('d', this.lineGenerator);
}
onMouseMove(): void {}
onMouseOver(): void {}
onMouseOut(): void {}
onMouseClick(): void {}
renderSharedCrosshair(values): void {}
hideSharedCrosshair(): void {}
}
export { DemoPod };

16
src/index.ts

@ -37,7 +37,7 @@ import debounce from 'lodash/debounce';
const DEFAULT_TICK_SIZE = 2;
abstract class ChartwerkPod<T extends Serie, O extends Options> {
class ChartwerkPod<T extends Serie, O extends Options> {
protected series: CoreSeries<T>;
protected options: CoreOptions<O>;
@ -151,13 +151,13 @@ abstract class ChartwerkPod<T extends Serie, O extends Options> {
this.series.updateSeries(newSeries);
}
protected abstract renderMetrics(): void;
protected abstract onMouseOver(): void;
protected abstract onMouseOut(): void;
protected abstract onMouseMove(): void;
protected abstract onMouseClick(): void;
public abstract renderSharedCrosshair(values: { x?: number, y?: number }): void;
public abstract hideSharedCrosshair(): void;
protected renderMetrics(): void {}
protected onMouseOver(): void {}
protected onMouseOut(): void {}
protected onMouseMove(): void {}
protected onMouseClick(): void { }
public renderSharedCrosshair(values: { x?: number, y?: number }): void {}
public hideSharedCrosshair(): void {}
protected initPodState(): void {
const boxPararms = {

Loading…
Cancel
Save