Skip to content

Commit

Permalink
Merge pull request #51 from sgratzl/release/v4.2.3
Browse files Browse the repository at this point in the history
Release v4.2.3
  • Loading branch information
sgratzl authored Jul 13, 2023
2 parents 8b382b6 + c95363a commit 91beec0
Show file tree
Hide file tree
Showing 4 changed files with 646 additions and 636 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chartjs-chart-wordcloud",
"description": "Chart.js module for word clouds",
"version": "4.2.2",
"version": "4.2.3",
"author": {
"name": "Samuel Gratzl",
"email": "[email protected]",
Expand Down
14 changes: 7 additions & 7 deletions src/controllers/WordCloudController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
static readonly id = 'wordCloud';

/**
* @internal
* @hidden
*/
static readonly defaults = {
datasets: {
Expand All @@ -55,7 +55,7 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
};

/**
* @internal
* @hidden
*/
static readonly overrides = {
scales: {
Expand Down Expand Up @@ -84,12 +84,12 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
.fontWeight((d) => d.options.weight ?? 1);

/**
* @internal
* @hidden
*/
rand: () => number = Math.random;

/**
* @internal
* @hidden
*/
update(mode: UpdateMode): void {
super.update(mode);
Expand All @@ -101,7 +101,7 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
}

/**
* @internal
* @hidden
*/
updateElements(elems: WordElement[], start: number, count: number, mode: UpdateMode): void {
this.wordLayout.stop();
Expand Down Expand Up @@ -184,7 +184,7 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
}

/**
* @internal
* @hidden
*/
draw(): void {
const elements = this._cachedMeta.data as unknown as VisualElement[];
Expand All @@ -193,7 +193,7 @@ export class WordCloudController extends DatasetController<'wordCloud', WordElem
}

/**
* @internal
* @hidden
*/
getLabelAndValue(index: number): { label: string; value: any } {
const r = super.getLabelAndValue(index);
Expand Down
18 changes: 9 additions & 9 deletions src/elements/WordElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class WordElement extends Element<IWordElementProps, IWordElementOptions>
static readonly id = 'word';

/**
* @internal
* @hidden
*/
static readonly defaults: any = /* #__PURE__ */ {
// rotate: 0,
Expand All @@ -89,7 +89,7 @@ export class WordElement extends Element<IWordElementProps, IWordElementOptions>
} as Partial<ScriptableAndArrayOptions<IWordElementOptions, ScriptableContext<'wordCloud'>>>;

/**
* @internal
* @hidden
*/
static readonly defaultRoutes = {
color: 'color',
Expand All @@ -100,7 +100,7 @@ export class WordElement extends Element<IWordElementProps, IWordElementOptions>
};

/**
* @internal
* @hidden
*/
static computeRotation(o: IWordElementOptions, rnd: () => number): number {
if (o.rotationSteps <= 1) {
Expand All @@ -115,7 +115,7 @@ export class WordElement extends Element<IWordElementProps, IWordElementOptions>
}

/**
* @internal
* @hidden
*/
inRange(mouseX: number, mouseY: number): boolean {
const p = this.getProps(['x', 'y', 'width', 'height', 'scale']);
Expand All @@ -128,35 +128,35 @@ export class WordElement extends Element<IWordElementProps, IWordElementOptions>
}

/**
* @internal
* @hidden
*/
inXRange(mouseX: number): boolean {
return this.inRange(mouseX, Number.NaN);
}

/**
* @internal
* @hidden
*/
inYRange(mouseY: number): boolean {
return this.inRange(Number.NaN, mouseY);
}

/**
* @internal
* @hidden
*/
getCenterPoint(): { x: number; y: number } {
return this.getProps(['x', 'y']);
}

/**
* @internal
* @hidden
*/
tooltipPosition(): { x: number; y: number } {
return this.getCenterPoint();
}

/**
* @internal
* @hidden
*/
draw(ctx: CanvasRenderingContext2D): void {
const { options } = this;
Expand Down
Loading

0 comments on commit 91beec0

Please sign in to comment.