Skip to content

Mixins - Typescript way - Take 1 #1704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/base/base-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class BaseMixin {
private _transitionDelay: number;
private _filterPrinter: (filters) => string;
private _mandatoryAttributesList: string[];
private _chartGroup: string;
protected _chartGroup: string;
// TODO: the typing seems to be inconsistent with https://github.com/d3/d3-dispatch example as well as our use
private _listeners: any; // TODO: external PR - https://github.com/DefinitelyTyped/DefinitelyTyped/pull/45869
private _legend; // TODO: figure out actual type
Expand All @@ -112,7 +112,7 @@ export class BaseMixin {
private _removeFilterHandler: (filters, filter) => any;
private _addFilterHandler: (filters, filter) => any;
private _resetFilterHandler: (filters) => any[];
private _groupName: string;
protected _groupName: string; // StackMixin needs it

constructor () {
this.__dcFlag__ = utils.uniqueId();
Expand Down Expand Up @@ -393,8 +393,8 @@ export class BaseMixin {
* @returns {crossfilter.group|BaseMixin}
*/
public group ();
public group (group, name?): this;
public group (group?, name?) {
public group (group, name?, accessor?): this;
public group (group?, name?, accessor?) {
if (!arguments.length) {
return this._group;
}
Expand Down Expand Up @@ -1227,19 +1227,19 @@ export class BaseMixin {
return [];
}

protected legendHighlight () {
protected legendHighlight (d?) {
// do nothing in base, should be overridden by sub-function
}

protected legendReset () {
protected legendReset (d?) {
// do nothing in base, should be overridden by sub-function
}

protected legendToggle () {
protected legendToggle (d?) {
// do nothing in base, should be overriden by sub-function
}

protected isLegendableHidden () {
protected isLegendableHidden (d?) {
// do nothing in base, should be overridden by sub-function
return false;
}
Expand Down
Loading