Skip to content

Commit 509e97a

Browse files
committed
Version 5.3.6
1 parent 447f3c3 commit 509e97a

13 files changed

Lines changed: 84 additions & 25 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@amcharts/amcharts5",
4-
"version": "5.3.5",
4+
"version": "5.3.6",
55
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
66
"description": "amCharts 5",
77
"homepage": "https://www.amcharts.com/",

packages/geodata/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.
1313
### Changed
1414
- Map of the Pakistan was updated to adhere to local requirements.
1515

16+
### Fixed
17+
- Fixed IDs of lands in the map of Denmark.
18+
1619

1720
## [5.1.0] - 2022-12-07
1821

packages/shared/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55
Please note, that this project, while following numbering syntax, it DOES NOT
66
adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.
77

8+
## [5.3.6] - 2023-02-27
9+
10+
### Added
11+
- New `cors` setting for `Picture` (defaults to `"anonymous"`).
12+
- `beginPath` method added to `CanvasGraphics`.
13+
14+
### Fixed
15+
- Theme states no longer override user states.
16+
- In some specific cases with stacked axes series position could be shifted up.
17+
- In some specific cases a hairline of a column of a `ColumnSeries` could remain visible on the plot area even if the whole column was out of visible axis bounds.
18+
- A `ghostLabel` was causing some interfering issues with interactive labels of an axis.
19+
20+
821
## [5.3.5] - 2023-02-24
922

1023
### Changed

src/.internal/charts/xy/axes/Axis.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ export interface IAxisPrivate extends IComponentPrivate {
191191

192192
/**
193193
* @todo review
194-
* Width in pixels between grid lines (read-only). It might not be exact, as DateAxis can have grids at irregular intervals. Could be used to detect when size changes and to adjust labels for them not to overlap.
195-
*/
196-
cellWidth?:number;
194+
* Width in pixels between grid lines (read-only). It might not be exact, as DateAxis can have grids at irregular intervals. Could be used to detect when size changes and to adjust labels for them not to overlap.
195+
*/
196+
cellWidth?: number;
197197
}
198198

199199
export interface IAxisDataItem extends IComponentDataItem {
@@ -393,10 +393,11 @@ export abstract class Axis<R extends AxisRenderer> extends Component {
393393
this.children.push(renderer);
394394
this.ghostLabel = renderer.makeLabel(new DataItem(this, undefined, {}), []);
395395
this.ghostLabel.adapters.disable("text");
396-
this.ghostLabel.set("opacity", 0);
396+
this.ghostLabel.setAll({ opacity: 0, tooltipText: undefined, tooltipHTML: undefined, interactive: false });
397+
this.ghostLabel.events.disable();
397398
}
398399

399-
protected _updateFinals(_start:number, _end:number){
400+
protected _updateFinals(_start: number, _end: number) {
400401

401402
}
402403

src/.internal/charts/xy/series/BaseColumnSeries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export abstract class BaseColumnSeries extends XYSeries {
470470

471471
this._updateSeriesGraphics(dataItem, graphics!, l, r, t, b, fitW, fitH);
472472

473-
if ((l < xStart && r < xStart) || (l > xEnd && r > xEnd) || (t < yStart && b < yStart) || (t > yEnd && b > yEnd) || $type.isNaN(l) || $type.isNaN(t)) {
473+
if ((l < xStart && r < xStart) || (l > xEnd && r > xEnd) || (t < yStart && b <= yStart) || (t >= yEnd && b > yEnd) || $type.isNaN(l) || $type.isNaN(t)) {
474474
this._toggleColumn(dataItem, false);
475475
}
476476
else {

src/.internal/charts/xy/series/XYSeries.ts

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -961,10 +961,18 @@ export abstract class XYSeries extends Series {
961961
}
962962
}))
963963

964-
if (!this.get("baseAxis")) {
965-
const xAxis = this.get("xAxis");
966-
const yAxis = this.get("yAxis");
964+
const xAxis = this.get("xAxis");
965+
const yAxis = this.get("yAxis");
966+
967+
this._disposers.push(xAxis.events.on("positionchanged", () => {
968+
this._fixPosition();
969+
}))
970+
971+
this._disposers.push(yAxis.events.on("positionchanged", () => {
972+
this._fixPosition();
973+
}))
967974

975+
if (!this.get("baseAxis")) {
968976
if (yAxis.isType<CategoryAxis<any>>("CategoryAxis") || yAxis.isType<DateAxis<any>>("DateAxis")) {
969977
this.set("baseAxis", yAxis);
970978
}
@@ -1180,6 +1188,17 @@ export abstract class XYSeries extends Series {
11801188
}
11811189
}
11821190

1191+
protected _fixPosition() {
1192+
const xAxis = this.get("xAxis");
1193+
const yAxis = this.get("yAxis");
1194+
1195+
this.set("x", xAxis.x() - $utils.relativeToValue(xAxis.get("centerX", 0), xAxis.width()) - xAxis.parent!.get("paddingLeft", 0));
1196+
this.set("y", yAxis.y() - $utils.relativeToValue(yAxis.get("centerY", 0), yAxis.height()) - yAxis.parent!.get("paddingTop", 0));
1197+
1198+
this.bulletsContainer.set("y", this.y());
1199+
this.bulletsContainer.set("x", this.x());
1200+
}
1201+
11831202

11841203
public _prepareChildren() {
11851204
super._prepareChildren();
@@ -1239,10 +1258,7 @@ export abstract class XYSeries extends Series {
12391258
}
12401259

12411260

1242-
this.set("x", xAxis.x() - $utils.relativeToValue(xAxis.get("centerX", 0), xAxis.width()) - xAxis.parent!.get("paddingLeft", 0));
1243-
this.set("y", yAxis.y() - $utils.relativeToValue(yAxis.get("centerY", 0), yAxis.height()) - yAxis.parent!.get("paddingTop", 0));
1244-
this.bulletsContainer.set("y", this.y());
1245-
this.bulletsContainer.set("x", this.x());
1261+
this._fixPosition();
12461262

12471263
const stacked = this.get("stacked");
12481264

@@ -1311,7 +1327,7 @@ export abstract class XYSeries extends Series {
13111327
this._markStakedDirtyStack();
13121328

13131329
//this.updateLegendMarker(undefined); // causes legend marker to change color instantly when on
1314-
if(!this.get("tooltipDataItem")){
1330+
if (!this.get("tooltipDataItem")) {
13151331
this.updateLegendValue(undefined);
13161332
}
13171333
}
@@ -1759,7 +1775,7 @@ export abstract class XYSeries extends Series {
17591775
let bullets = dataItem.bullets;
17601776
if (bullets) {
17611777
$array.each(bullets, (bullet) => {
1762-
if(bullet){
1778+
if (bullet) {
17631779
let sprite = bullet.get("sprite");
17641780
if (sprite) {
17651781
sprite.setPrivate("visible", false);
@@ -1993,11 +2009,11 @@ export abstract class XYSeries extends Series {
19932009

19942010
public hideTooltip(): Promise<void> | undefined {
19952011
const tooltip = this.get("tooltip");
1996-
if(tooltip){
2012+
if (tooltip) {
19972013
tooltip.set("tooltipTarget", this);
19982014
}
19992015
return super.hideTooltip();
2000-
}
2016+
}
20012017

20022018
protected _getTooltipTarget(dataItem: DataItem<this["_dataItemSettings"]>): Sprite {
20032019
if (this.get("seriesTooltipTarget") == "bullet") {

src/.internal/core/Registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class Registry {
66
/**
77
* Currently running version of amCharts.
88
*/
9-
readonly version: string = "5.3.5";
9+
readonly version: string = "5.3.6";
1010

1111
/**
1212
* List of applied licenses.

src/.internal/core/render/Picture.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ export interface IPictureSettings extends ISpriteSettings {
1414
*/
1515
src?: string;
1616

17+
/**
18+
* CORS settings for loading the image. Defaults to "anonymous".
19+
*
20+
* @since 5.3.6
21+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/crossOrigin} for more info
22+
*/
23+
cors?: string | null;
24+
1725
/**
1826
* Color of the element's shadow.
1927
*
@@ -116,7 +124,7 @@ export class Picture extends Sprite {
116124
this._display.shadowOpacity = this.get("shadowOpacity");
117125
}
118126

119-
if (this.isDirty("src")) {
127+
if (this.isDirty("src") || this.isDirty("cors")) {
120128
this._display.clear();
121129
this._load();
122130
}
@@ -126,7 +134,7 @@ export class Picture extends Sprite {
126134
const src = this.get("src");
127135
if (src) {
128136
const image = new Image();
129-
//image.crossOrigin = "Anonymous";
137+
image.crossOrigin = this.get("cors", "anonymous");
130138
image.src = src!;
131139
image.decode().then(() => {
132140
this._display.image = image;

src/.internal/core/render/backend/CanvasRenderer.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,15 @@ abstract class Op {
706706
public addBounds(_bounds: IBounds): void { }
707707
}
708708

709+
/**
710+
* @ignore
711+
*/
712+
class BeginPath extends Op {
713+
public colorize(context: CanvasRenderingContext2D, _forceColor: string | undefined): void {
714+
context.beginPath();
715+
}
716+
}
717+
709718
/**
710719
* @ignore
711720
*/
@@ -1098,6 +1107,10 @@ export class CanvasGraphics extends CanvasDisplayObject implements IGraphics {
10981107
this._pushOp(new EndStroke());
10991108
}
11001109

1110+
beginPath(): void {
1111+
this._pushOp(new BeginPath());
1112+
}
1113+
11011114
lineStyle(width: number = 0, color?: Color | CanvasGradient | CanvasPattern, alpha: number = 1, lineJoin?: "miter" | "round" | "bevel"): void {
11021115
this._strokeAlpha = alpha;
11031116
if (color) {

src/.internal/core/render/backend/Renderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export interface IGraphics extends IDisplayObject {
171171

172172
beginFill(color?: Color | IGradient | IPattern, alpha?: number): void;
173173
endFill(): void;
174+
beginPath(): void;
174175

175176
lineStyle(width?: number, color?: Color | IGradient | IPattern, alpha?: number, lineJoin?: "miter" | "round" | "bevel"): void;
176177
setLineDash(dash?: number[]): void;

0 commit comments

Comments
 (0)