Skip to content

Commit

Permalink
Version 5.10.8
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Nov 21, 2024
1 parent c32fbe3 commit 521f1a4
Show file tree
Hide file tree
Showing 97 changed files with 416 additions and 249 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.10.7",
"version": "5.10.8",
"author": "amCharts <[email protected]> (https://www.amcharts.com/)",
"description": "amCharts 5",
"homepage": "https://www.amcharts.com/",
Expand Down
6 changes: 5 additions & 1 deletion packages/geodata/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ 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.

## [UNRELEASED] - ????-??-??
## [UNRELEASED] - ????-??-?

### Changed
- Updated the name of North Macedonia in transaltion files.
- Updated Shannon county (South Dakota) name/FIPS to Oglala Lakota (FIPS 46102).


## [5.1.4] - 2024-07-03
Expand Down
18 changes: 18 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.10.8] - 2024-11-21

### Added
- New setting `lineCap` (default `"butt"`) added to `Graphics`. Allows specifying how line ends should be drawn. Possible values: `"butt"` (default), `"round"`, `"square"`.
- New setting `clickAnnounceText` added to `Sprite`. If set will announce the text when focused element is triggered with a press of ENTER or SPACE.

### Changed
- Pressing Shift-TAB while focus on non-first member of the focusabel group will now jump to a previous group or focusable element, rather than current group's first element.
- When an `XYChart` is zoomed using mouse wheel it will no longer stop page scroll when its fully zoomed out or zoomed in.

### Fixed
- HTML content was ignoring `dx`/`dy` position adjustment settings.
- Pressing the UP key was being ignored when navigating within a group of focusable objects.
- Last label of `GaplessDateAxis` was in wrong position when baseInterval was week and minorGrid was enabled.
- Setting data item's value to null (if previous was a valid number) did not remove the column of a ColumnSeries.
- The `maxWidth`/`maxHeight` recaculation of vertical labels was not correctly factoring in its padding.


## [5.10.7] - 2024-10-12

### Fixed
Expand Down
25 changes: 21 additions & 4 deletions src/.internal/charts/stock/drawing/HorizontalLineSeries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ISpritePointerEvent } from "../../../core/render/Sprite";
import type { DataItem } from "../../../core/render/Component";
import * as $array from "../../../core/util/Array";

import { SimpleLineSeries, ISimpleLineSeriesSettings, ISimpleLineSeriesPrivate, ISimpleLineSeriesDataItem } from "./SimpleLineSeries";

Expand Down Expand Up @@ -55,9 +56,9 @@ export class HorizontalLineSeries extends SimpleLineSeries {
this._setContext(diP2, "valueY", valueY, true);
this._setContext(diP3, "valueY", valueY, true);

this._setContext(diP1, "valueX", min - (max - min) * 200);
this._setContext(diP1, "valueX", min - (max - min));
this._setContext(diP2, "valueX", valueX);
this._setContext(diP3, "valueX", max + (max - min) * 200);
this._setContext(diP3, "valueX", max + (max - min));

this._setXLocation(diP2, diP2.get("valueX", 0));

Expand All @@ -70,6 +71,22 @@ export class HorizontalLineSeries extends SimpleLineSeries {

}

public _prepareChildren(): void {
super._prepareChildren();

const xAxis = this.get("xAxis");

const min = xAxis.getPrivate("min", 0);
const max = xAxis.getPrivate("max", 1);

$array.each(this._di, (di) => {
if(di){
this._setContext(di["p1"], "valueX", min - (max - min), true);
this._setContext(di["p3"], "valueX", max + (max - min), true);
}
});
}

protected _updateSegment(index: number) {
if (this._di[index]) {
const diP1 = this._di[index]["p1"];
Expand All @@ -80,8 +97,8 @@ export class HorizontalLineSeries extends SimpleLineSeries {
const min = xAxis.getPrivate("min", 0);
const max = xAxis.getPrivate("max", 1);

this._setContext(diP1, "valueX", min - (max - min) * 200, true);
this._setContext(diP3, "valueX", max + (max - min) * 200, true);
this._setContext(diP1, "valueX", min - (max - min), true);
this._setContext(diP3, "valueX", max + (max - min), true);
}
}
}
Expand Down
21 changes: 19 additions & 2 deletions src/.internal/charts/stock/drawing/HorizontalRaySeries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ISpritePointerEvent } from "../../../core/render/Sprite";
import type { DataItem } from "../../../core/render/Component";
import * as $array from "../../../core/util/Array";

import { SimpleLineSeries, ISimpleLineSeriesSettings, ISimpleLineSeriesPrivate, ISimpleLineSeriesDataItem } from "./SimpleLineSeries";

Expand Down Expand Up @@ -55,7 +56,7 @@ export class HorizontalRaySeries extends SimpleLineSeries {
this._setContext(diP2, "valueY", valueY, true);

this._setContext(diP1, "valueX", valueX);
this._setContext(diP2, "valueX", max + (max - min) * 100);
this._setContext(diP2, "valueX", max + (max - min));

this._setXLocation(diP1, diP1.get("valueX", 0));

Expand All @@ -64,6 +65,21 @@ export class HorizontalRaySeries extends SimpleLineSeries {
}
}

public _prepareChildren(): void {
super._prepareChildren();

const xAxis = this.get("xAxis");

const min = xAxis.getPrivate("min", 0);
const max = xAxis.getPrivate("max", 1);

$array.each(this._di, (di) => {
if(di){
this._setContext(di["p2"], "valueX", max + (max - min), true);
}
});
}

protected _handlePointerMoveReal() {

}
Expand All @@ -78,10 +94,11 @@ export class HorizontalRaySeries extends SimpleLineSeries {
const max = xAxis.getPrivate("max", 1);


this._setContext(diP2, "valueX", max + (max - min) * 100, true);
this._setContext(diP2, "valueX", max + (max - min), true);
}
}
}


protected _handlePointerClickReal(event: ISpritePointerEvent) {
if (this._drawingEnabled) {
Expand Down
52 changes: 51 additions & 1 deletion src/.internal/charts/xy/XYChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,9 @@ export class XYChart extends SerialChart {

// Ignore wheel event if it is happening on a non-chart element, e.g. if
// some page element is over the chart.
let prevent = false;
if ($utils.isLocalEvent(wheelEvent, this)) {
wheelEvent.preventDefault();
prevent = true;
}
else {
return;
Expand Down Expand Up @@ -542,9 +543,17 @@ export class XYChart extends SerialChart {

let newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftX * position));
let newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftX * (1 - position)));

if (newStart == start && newEnd == end) {
prevent = false;
}

if (1 / (newEnd - newStart) < axis.getPrivate("maxZoomFactor", Infinity) / axis.get("minZoomCount", 1)) {
this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
else {
prevent = false;
}
}
})
}
Expand All @@ -566,9 +575,16 @@ export class XYChart extends SerialChart {
let newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftY * position));
let newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftY * (1 - position)));

if (newStart == start && newEnd == end) {
prevent = false;
}

if (1 / (newEnd - newStart) < axis.getPrivate("maxZoomFactor", Infinity) / axis.get("minZoomCount", 1)) {
this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
else {
prevent = false;
}
}
})
}
Expand All @@ -591,9 +607,16 @@ export class XYChart extends SerialChart {
let newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftX * position));
let newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftX * (1 - position)));

if (newStart == start && newEnd == end) {
prevent = false;
}

if (1 / (newEnd - newStart) < axis.getPrivate("maxZoomFactor", Infinity) / axis.get("minZoomCount", 1)) {
this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
else {
prevent = false;
}
}
})
}
Expand All @@ -615,9 +638,16 @@ export class XYChart extends SerialChart {
let newStart = Math.min(1 + maxDeviation, Math.max(-maxDeviation, start - wheelStep * (end - start) * shiftY * position));
let newEnd = Math.max(-maxDeviation, Math.min(1 + maxDeviation, end + wheelStep * (end - start) * shiftY * (1 - position)));

if (newStart == start && newEnd == end) {
prevent = false;
}

if (1 / (newEnd - newStart) < axis.getPrivate("maxZoomFactor", Infinity) / axis.get("minZoomCount", 1)) {
this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
else {
prevent = false;
}
}
})
}
Expand All @@ -637,6 +667,10 @@ export class XYChart extends SerialChart {
newStart = se[0];
newEnd = se[1];

if (newStart == start && newEnd == end) {
prevent = false;
}

this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
})
Expand All @@ -656,6 +690,10 @@ export class XYChart extends SerialChart {
newStart = se[0];
newEnd = se[1];

if (newStart == start && newEnd == end) {
prevent = false;
}

this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
})
Expand All @@ -675,6 +713,10 @@ export class XYChart extends SerialChart {
newStart = se[0];
newEnd = se[1];

if (newStart == start && newEnd == end) {
prevent = false;
}

this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
})
Expand All @@ -694,10 +736,18 @@ export class XYChart extends SerialChart {
newStart = se[0];
newEnd = se[1];

if (newStart == start && newEnd == end) {
prevent = false;
}

this._handleWheelAnimation(axis.zoom(newStart, newEnd));
}
})
}

if (prevent) {
wheelEvent.preventDefault();
}
}

protected _handleSetWheel() {
Expand Down
17 changes: 10 additions & 7 deletions src/.internal/charts/xy/axes/DateAxis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,9 @@ export class DateAxis<R extends AxisRenderer> extends ValueAxis<R> {
if (this.getPrivate("baseInterval")?.timeUnit != "week") {
minorGridInterval = { timeUnit: "day", count: 1 };
}
else {
minorGridInterval = { timeUnit: "week", count: 1 };
}
}
return minorGridInterval;
}
Expand Down Expand Up @@ -1278,13 +1281,13 @@ export class DateAxis<R extends AxisRenderer> extends ValueAxis<R> {
return 0.05;
}

public nextPosition(count?:number){
if(count == null){
public nextPosition(count?: number) {
if (count == null) {
count = 1;
}

let dtime = this.get("tooltipLocation", 0.5) * this.baseDuration();
if(this.get("renderer").getPrivate("letter") == "Y"){
let dtime = this.get("tooltipLocation", 0.5) * this.baseDuration();
if (this.get("renderer").getPrivate("letter") == "Y") {
count *= -1;
}

Expand All @@ -1299,13 +1302,13 @@ export class DateAxis<R extends AxisRenderer> extends ValueAxis<R> {
let min = $time.roun(selectionMin, baseInterval.timeUnit, baseInterval.count, this._root);
let max = $time.roun(selectionMax, baseInterval.timeUnit, baseInterval.count, this._root);

time += dtime;
time += dtime;
time = $math.fitToRange(time, min + dtime, max - dtime);

return this.toGlobalPosition(this.valueToPosition(time));
}
}

protected _nextTime(time:number, count:number, baseInterval:ITimeInterval){
protected _nextTime(time: number, count: number, baseInterval: ITimeInterval) {
return $time.roun(time + count * this.baseDuration(), baseInterval.timeUnit, baseInterval.count, this._root);
}
}
5 changes: 4 additions & 1 deletion src/.internal/charts/xy/series/BaseColumnSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export abstract class BaseColumnSeries extends XYSeries {
if (columnsTemplate.get("fillPattern") == null) {
columnsTemplate.set("fillPattern", this.get("fillPattern"));
}
}
}

if (this.isDirty("stroke")) {
if (columnsTemplate.get("stroke") == null) {
Expand Down Expand Up @@ -521,6 +521,9 @@ export abstract class BaseColumnSeries extends XYSeries {

this._applyGraphicsStates(dataItem, previousDataItem);
}
else {
this._toggleColumn(dataItem, false);
}
}

protected _updateSeriesGraphics(dataItem: DataItem<this["_dataItemSettings"]>, graphics: Graphics, l: number, r: number, t: number, b: number, fitW: boolean, fitH: boolean) {
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.10.7";
readonly version: string = "5.10.8";

/**
* List of applied licenses.
Expand Down
Loading

0 comments on commit 521f1a4

Please sign in to comment.