Skip to content

Commit

Permalink
Merge pull request #189 from sgratzl/release/v4.2.4
Browse files Browse the repository at this point in the history
Release v4.2.4
  • Loading branch information
sgratzl committed Jul 13, 2023
2 parents a6fbc35 + f2edb2d commit 7bb0bef
Show file tree
Hide file tree
Showing 9 changed files with 728 additions and 719 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-geo",
"description": "Chart.js module for charting maps",
"version": "4.2.3",
"version": "4.2.4",
"author": {
"name": "Samuel Gratzl",
"email": "[email protected]",
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/BubbleMapController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class BubbleMapController extends GeoController<'bubbleMap', MyPointEleme
static readonly id = 'bubbleMap';

/**
* @internal
* @hidden
*/
static readonly defaults: any = /* #__PURE__ */ merge({}, [
geoDefaults,
Expand All @@ -120,7 +120,7 @@ export class BubbleMapController extends GeoController<'bubbleMap', MyPointEleme
]);

/**
* @internal
* @hidden
*/
static readonly overrides: any = /* #__PURE__ */ merge({}, [
geoOverrides,
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/ChoroplethController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ChoroplethController extends GeoController<'choropleth', GeoFeature
static readonly id = 'choropleth';

/**
* @internal
* @hidden
*/
static readonly defaults: any = /* #__PURE__ */ merge({}, [
geoDefaults,
Expand All @@ -105,7 +105,7 @@ export class ChoroplethController extends GeoController<'choropleth', GeoFeature
]);

/**
* @internal
* @hidden
*/
static readonly overrides: any = /* #__PURE__ */ merge({}, [
geoOverrides,
Expand Down
32 changes: 16 additions & 16 deletions src/elements/GeoFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export interface IGeoFeatureProps {

export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> implements VisualElement {
/**
* @internal
* @hidden
*/
cache?:
| {
Expand All @@ -84,27 +84,27 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
| undefined = undefined;

/**
* @internal
* @hidden
*/
projectionScale!: ProjectionScale;

/**
* @internal
* @hidden
*/
feature!: Feature;

/**
* @internal
* @hidden
*/
center?: { longitude: number; latitude: number };

/**
* @internal
* @hidden
*/
pixelRatio?: number;

/**
* @internal
* @hidden
*/
inRange(mouseX: number, mouseY: number): boolean {
const bb = this.getBounds();
Expand All @@ -123,21 +123,21 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
}

/**
* @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 } {
if (this.cache && this.cache.center) {
Expand All @@ -162,7 +162,7 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
}

/**
* @internal
* @hidden
*/
getBounds(): { x: number; y: number; x2: number; y2: number; width: number; height: number } {
if (this.cache && this.cache.bounds) {
Expand All @@ -182,7 +182,7 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
}

/**
* @internal
* @hidden
*/
_drawInCache(doc: Document): void {
const bounds = this.getBounds();
Expand Down Expand Up @@ -217,15 +217,15 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
}

/**
* @internal
* @hidden
*/
_optionsToKey(): string {
const { options } = this;
return `${options.backgroundColor};${options.borderColor};${options.borderWidth};${this.pixelRatio}`;
}

/**
* @internal
* @hidden
*/
_drawImpl(ctx: CanvasRenderingContext2D): void {
const { feature } = this;
Expand All @@ -244,7 +244,7 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
}

/**
* @internal
* @hidden
*/
draw(ctx: CanvasRenderingContext2D): void {
const { feature } = this;
Expand Down Expand Up @@ -275,7 +275,7 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
static id = 'geoFeature';

/**
* @internal
* @hidden
*/
static defaults = /* #__PURE__ */ {
...BarElement.defaults,
Expand All @@ -287,7 +287,7 @@ export class GeoFeature extends Element<IGeoFeatureProps, IGeoFeatureOptions> im
};

/**
* @internal
* @hidden
*/
static defaultRoutes = /* #__PURE__ */ {
outlineBorderColor: 'borderColor',
Expand Down
22 changes: 11 additions & 11 deletions src/scales/ColorScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const colorScaleDefaults = {

export class ColorScale extends LegendScale<IColorScaleOptions & LinearScaleOptions> {
/**
* @internal
* @hidden
*/
get interpolate(): (v: number) => string {
const o = this.options as IColorScaleOptions & LinearScaleOptions;
Expand All @@ -193,7 +193,7 @@ export class ColorScale extends LegendScale<IColorScaleOptions & LinearScaleOpti
}

/**
* @internal
* @hidden
*/
getColorForValue(value: number): string {
const v = this._getNormalizedValue(value);
Expand All @@ -204,7 +204,7 @@ export class ColorScale extends LegendScale<IColorScaleOptions & LinearScaleOpti
}

/**
* @internal
* @hidden
*/
getColor(normalized: number): string {
let v = normalized;
Expand All @@ -215,7 +215,7 @@ export class ColorScale extends LegendScale<IColorScaleOptions & LinearScaleOpti
}

/**
* @internal
* @hidden
*/
_drawIndicator(): void {
const { indicatorWidth: indicatorSize } = this.options.legend;
Expand Down Expand Up @@ -261,12 +261,12 @@ export class ColorScale extends LegendScale<IColorScaleOptions & LinearScaleOpti
static readonly id = 'color';

/**
* @internal
* @hidden
*/
static readonly defaults: any = /* #__PURE__ */ merge({}, [LinearScale.defaults, baseDefaults, colorScaleDefaults]);

/**
* @internal
* @hidden
*/
static readonly descriptors = /* #__PURE__ */ {
_scriptable: (name: string): boolean => name !== 'interpolate',
Expand All @@ -278,7 +278,7 @@ export class ColorLogarithmicScale extends LogarithmicLegendScale<IColorScaleOpt
private interpolate = (v: number) => `rgb(${v},${v},${v})`;

/**
* @internal
* @hidden
*/
init(options: IColorScaleOptions & LinearScaleOptions): void {
super.init(options);
Expand All @@ -290,14 +290,14 @@ export class ColorLogarithmicScale extends LogarithmicLegendScale<IColorScaleOpt
}

/**
* @internal
* @hidden
*/
getColorForValue(value: number): string {
return ColorScale.prototype.getColorForValue.call(this, value);
}

/**
* @internal
* @hidden
*/
getColor(normalized: number): string {
let v = normalized;
Expand All @@ -314,7 +314,7 @@ export class ColorLogarithmicScale extends LogarithmicLegendScale<IColorScaleOpt
static readonly id = 'colorLogarithmic';

/**
* @internal
* @hidden
*/
static readonly defaults: any = /* #__PURE__ */ merge({}, [
LogarithmicScale.defaults,
Expand All @@ -323,7 +323,7 @@ export class ColorLogarithmicScale extends LogarithmicLegendScale<IColorScaleOpt
]);

/**
* @internal
* @hidden
*/
static readonly descriptors = /* #__PURE__ */ {
_scriptable: (name: string): boolean => name !== 'interpolate',
Expand Down
30 changes: 15 additions & 15 deletions src/scales/LegendScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ function computeLegendPosition(

export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> extends LinearScale<O> {
/**
* @internal
* @hidden
*/
legendSize: { w: number; h: number } = { w: 0, h: 0 };

/**
* @internal
* @hidden
*/
init(options: O): void {
// eslint-disable-next-line no-param-reassign
Expand All @@ -162,7 +162,7 @@ export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> ext
}

/**
* @internal
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
parse(raw: any, index: number): number {
Expand All @@ -173,7 +173,7 @@ export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> ext
}

/**
* @internal
* @hidden
*/
isHorizontal(): boolean {
return this.options.legend.align === 'top' || this.options.legend.align === 'bottom';
Expand All @@ -187,7 +187,7 @@ export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> ext
}

/**
* @internal
* @hidden
*/
update(maxWidth: number, maxHeight: number, margins: ChartArea): void {
const ch = Math.min(maxHeight, this.bottom == null ? Number.POSITIVE_INFINITY : this.bottom);
Expand All @@ -214,15 +214,15 @@ export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> ext
}

/**
* @internal
* @hidden
*/
// eslint-disable-next-line class-methods-use-this
_computeLabelArea(): void {
return undefined;
}

/**
* @internal
* @hidden
*/
draw(chartArea: ChartArea): void {
if (!(this as any)._isVisible()) {
Expand Down Expand Up @@ -258,7 +258,7 @@ export class LegendScale<O extends ILegendScaleOptions & LinearScaleOptions> ext
}

/**
* @internal
* @hidden
*/
// eslint-disable-next-line class-methods-use-this
protected _drawIndicator(): void {
Expand All @@ -270,27 +270,27 @@ export class LogarithmicLegendScale<
O extends ILegendScaleOptions & LogarithmicScaleOptions
> extends LogarithmicScale<O> {
/**
* @internal
* @hidden
*/
legendSize: { w: number; h: number } = { w: 0, h: 0 };

/**
* @internal
* @hidden
*/
init(options: O): void {
LegendScale.prototype.init.call(this, options);
}

/**
* @internal
* @hidden
*/
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
parse(raw: any, index: number): number {
return LegendScale.prototype.parse.call(this, raw, index);
}

/**
* @internal
* @hidden
*/
isHorizontal(): boolean {
return this.options.legend.align === 'top' || this.options.legend.align === 'bottom';
Expand All @@ -304,22 +304,22 @@ export class LogarithmicLegendScale<
}

/**
* @internal
* @hidden
*/
update(maxWidth: number, maxHeight: number, margins: ChartArea): void {
return LegendScale.prototype.update.call(this, maxWidth, maxHeight, margins);
}

/**
* @internal
* @hidden
*/
// eslint-disable-next-line class-methods-use-this
_computeLabelArea(): void {
return undefined;
}

/**
* @internal
* @hidden
*/
draw(chartArea: ChartArea): void {
return LegendScale.prototype.draw.call(this, chartArea);
Expand Down
Loading

0 comments on commit 7bb0bef

Please sign in to comment.