Skip to content

Commit

Permalink
Version 5.9.4
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Apr 26, 2024
1 parent 864581f commit 9f60a3b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@amcharts/amcharts5",
"version": "5.9.3",
"version": "5.9.4",
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
"description": "amCharts 5",
"homepage": "https://www.amcharts.com/",
Expand Down
8 changes: 8 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
Please note, that this project, while following numbering syntax, it DOES NOT
adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.

## [5.9.4] - 2024-04-26

### Fixed
- `StockChart` with `VolumeProfile` indicator was snapping scrollbar's left grip to the start.
- Logarithmic axis was not showing labels less than 10e-5.
- `Treemap`'s labels would sometimes not adjust its size (usually with a lot of data).


## [5.9.3] - 2024-04-23

### Added
Expand Down
8 changes: 6 additions & 2 deletions src/.internal/charts/xy/XYChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,9 @@ export class XYChart extends SerialChart {

this._pushPropertyDisposer("scrollbarX", scrollbarX.events.on("released", () => {
this.xAxes.each((axis) => {
this._handleAxisSelection(axis);
if(axis.get("zoomable")){
this._handleAxisSelection(axis);
}
})
}))

Expand Down Expand Up @@ -1225,7 +1227,9 @@ export class XYChart extends SerialChart {

this._pushPropertyDisposer("scrollbarY", scrollbarY.events.on("released", () => {
this.yAxes.each((axis) => {
this._handleAxisSelection(axis);
if(axis.get("zoomable")){
this._handleAxisSelection(axis);
}
})
}))

Expand Down
5 changes: 0 additions & 5 deletions src/.internal/charts/xy/axes/Axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,6 @@ export abstract class Axis<R extends AxisRenderer> extends Component {
else {
this.set("start", start);
this.set("end", end);
// otherwise bullets and line out of sync, as series is not redrawn
this._root.events.once("frameended", () => {
this._markDirtyKey("start");
this._root._markDirty();
})
}
}
else {
Expand Down
9 changes: 5 additions & 4 deletions src/.internal/charts/xy/axes/ValueAxis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export class ValueAxis<R extends AxisRenderer> extends Axis<R> {
differencePower = Math.log(selectionMax - step) * Math.LOG10E - Math.log(minLog) * Math.LOG10E;

if (differencePower > 2) {
value = Math.pow(10, Math.log(minLog) * Math.LOG10E - 5);
value = Math.pow(10, Math.log(minLog) * Math.LOG10E - 50);
}
}

Expand Down Expand Up @@ -549,7 +549,7 @@ export class ValueAxis<R extends AxisRenderer> extends Axis<R> {
}
else {
if (differencePower > 2) {
nextValue = Math.pow(10, Math.log(minLog) * Math.LOG10E + i - 5);
nextValue = Math.pow(10, Math.log(minLog) * Math.LOG10E + i - 50);
}
else {
nextValue += step;
Expand Down Expand Up @@ -1353,7 +1353,7 @@ export class ValueAxis<R extends AxisRenderer> extends Axis<R> {
// add extras
min -= (max - min) * extraMin;
max += (max - min) * extraMax;

if (this.get("logarithmic")) {
// don't let min go below 0 if real min is >= 0
if (min < 0 && initialMin >= 0) {
Expand All @@ -1364,9 +1364,10 @@ export class ValueAxis<R extends AxisRenderer> extends Axis<R> {
max = 0;
}
}

this._minReal = min;
this._maxReal = max;

let strictMinMax = this.get("strictMinMax");
let strictMinMaxSelection = this.get("strictMinMaxSelection", false);
if (strictMinMaxSelection) {
Expand Down
2 changes: 1 addition & 1 deletion src/.internal/core/Registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class Registry {
/**
* Currently running version of amCharts.
*/
readonly version: string = "5.9.3";
readonly version: string = "5.9.4";

/**
* List of applied licenses.
Expand Down
38 changes: 19 additions & 19 deletions src/.internal/core/render/Label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,28 +323,22 @@ export class Label extends Container {
public _updateChildren() {
super._updateChildren();

const text = this._text;

$array.each(this._textKeys, (property) => {
this._text.set(property as any, this.get(property as any));
})

if (this.isDirty("maxWidth")) {
this._setMaxDimentions();
}

if (this.isDirty("maxHeight")) {
this._setMaxDimentions();
}

if (this.isDirty("rotation")) {
if (this.isDirty("maxWidth") || this.isDirty("maxHeight") || this.isDirty("rotation")) {
this._setMaxDimentions();
}

// Do not show regular text if HTML is used
if (this.get("html", "") !== "") {
this._text.set("text", "");
text.set("text", "");
}
else {
this._text.set("text", this.get("text"));
text.set("text", this.get("text"));
this._maybeUpdateHTMLColor();
}

Expand Down Expand Up @@ -375,12 +369,12 @@ export class Label extends Container {
}
}

this.text.set("x", x);
text.set("x", x);
}

const background = this.get("background");
if (background) {
background.setPrivate("visible", this.text._display.textVisible);
background.setPrivate("visible", text._display.textVisible);
}
}

Expand All @@ -394,29 +388,35 @@ export class Label extends Container {
protected _setMaxDimentions() {
const rotation = this.get("rotation");
const vertical = rotation == 90 || rotation == 270 || rotation == -90;
const text = this._text;

const maxWidth = this.get("maxWidth", this.getPrivate("maxWidth", Infinity));
if ($type.isNumber(maxWidth)) {
this.text.set(vertical ? "maxHeight" : "maxWidth", maxWidth - this.get("paddingLeft", 0) - this.get("paddingRight", 0));
text.set(vertical ? "maxHeight" : "maxWidth", maxWidth - this.get("paddingLeft", 0) - this.get("paddingRight", 0));
}
else {
this.text.set(vertical ? "maxHeight" : "maxWidth", undefined);
text.set(vertical ? "maxHeight" : "maxWidth", undefined);
}

const maxHeight = this.get("maxHeight", this.getPrivate("maxHeight", Infinity));
if ($type.isNumber(maxHeight)) {
this.text.set(vertical ? "maxWidth" : "maxHeight", maxHeight - this.get("paddingTop", 0) - this.get("paddingBottom", 0));
text.set(vertical ? "maxWidth" : "maxHeight", maxHeight - this.get("paddingTop", 0) - this.get("paddingBottom", 0));
}
else {
this.text.set(vertical ? "maxWidth" : "maxHeight", undefined);
text.set(vertical ? "maxWidth" : "maxHeight", undefined);
}

this.root.events.once("frameended", () => {
text.markDirtyBounds();
})
}

public _setDataItem(dataItem?: DataItem<IComponentDataItem>): void {
super._setDataItem(dataItem);
this._markDirtyKey("text")
if (this.text.get("populateText")) {
this.text.markDirtyText();
const text = this._text;
if (text.get("populateText")) {
text.markDirtyText();
}
const html = this.get("html");
if (html && html !== "") {
Expand Down

0 comments on commit 9f60a3b

Please sign in to comment.