Skip to content

Commit

Permalink
Version 5.2.33
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Nov 18, 2022
1 parent d174284 commit de2d98b
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 186 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.2.32",
"version": "5.2.33",
"author": "amCharts <[email protected]> (https://www.amcharts.com/)",
"description": "amCharts 5",
"homepage": "https://www.amcharts.com/",
Expand Down
15 changes: 15 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ 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.2.33] - 2022-11-18

### Added
- New pattern type `PathPattern`. Allows using SVG paths as patterns. [More info](https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/patterns/).

### Changed
- Circular labels (`RadialLabel` with `textType: "circular"`) now have a limited support for `oversizedBehavior`. `"hide"` and `"truncate"` are now supported. The latter will not respect `breakWords` setting, though.

### Fixed
- Hovering, clicking, and unhovering a `PieSeries` slice would not reset its size properly.
- `Label` background was not being sized properly when `fontWeight: bold` was set.
- Dynamically setting `include` or `exclude` on a `MapPolygonSeries` was not updating it until data was re-validated.
- Circular labels on a `Sunburst` diagram were not being positioned properly.


## [5.2.32] - 2022-11-15

### Added
Expand Down
2 changes: 2 additions & 0 deletions src/.internal/charts/hierarchy/HierarchyDefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ export class HierarchyDefaultTheme extends Theme {
const rule = r("RadialLabel", ["sunburst", "node"]);

rule.setAll({
x: 0,
y: 0,
textType: "radial",
paddingBottom: 1,
paddingTop: 1,
Expand Down
11 changes: 7 additions & 4 deletions src/.internal/charts/hierarchy/Sunburst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,24 @@ export class Sunburst extends Partition {
let angle = slice.get("startAngle", 0);
let arc = Math.abs(slice.get("arc", 0));
let labelAngle = angle + arc / 2;
let textType = label.get("textType");

let maxWidth = radius - innerRadius;
let maxHeight = radius * arc * $math.RADIANS;
let maxHeight = radius * arc * $math.RADIANS;

if (innerRadius == 0 && arc >= 360) {
if (innerRadius == 0 && arc >= 360 && textType == "radial") {
radius = 1;
labelAngle = 0;
}

label.set("labelAngle", labelAngle);
if (textType == "circular") {
maxWidth = arc * $math.RADIANS * (innerRadius + (radius - innerRadius) / 2) - 10;
}

label.setAll({ labelAngle: labelAngle });
label.setPrivate("radius", radius);
label.setPrivate("innerRadius", innerRadius);


if (arc >= 360) {
maxWidth *= 2;
maxHeight = maxWidth;
Expand Down
3 changes: 2 additions & 1 deletion src/.internal/charts/map/MapChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class MapChart extends SerialChart {
protected _dirtyGeometries: boolean = false;
protected _geometryColection: GeoJSON.GeometryCollection = { type: "GeometryCollection", geometries: [] };

protected _centerLocation: [number, number] | null = null;
public _centerLocation: [number, number] | null = null;

protected _za?: Animation<this["_settings"]["zoomLevel"]>;
protected _rxa?: Animation<this["_settings"]["rotationX"]>;
Expand Down Expand Up @@ -432,6 +432,7 @@ export class MapChart extends SerialChart {
this.series.each((series) => {
$array.pushAll(this._geometryColection.geometries, series._geometries);
})


this._fitMap();
}
Expand Down
32 changes: 29 additions & 3 deletions src/.internal/charts/map/MapSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ export interface IMapSeriesSettings extends ISeriesSettings {
* An array of map object ids from geodata to include in the map.
*
* If set, only those objects listed in `include` will be shown.
* If you want to change this after the map is initialized, you should call series.data.clear() before setting `include`
*/
include?: Array<string>;

/**
* An array of map object ids from geodata to omit when showing the map.
* If you want to change this after the map is initialized, you should call series.data.clear() before setting `exclude`
*/
exclude?: Array<string>;

Expand Down Expand Up @@ -134,6 +132,34 @@ export abstract class MapSeries extends Series {
this._parseGeoJSON();
this._geoJSONparsed = true;
}

const chart = this.chart;
const exclude = this.get("exclude");

if (exclude) {
if (chart) {
chart._centerLocation = null;
}
$array.each(exclude, (id) => {
const dataItem = this.getDataItemById(id);
if (dataItem) {
this.disposeDataItem(dataItem);
}
})
}

const include = this.get("include");
if (include) {
if (chart) {
chart._centerLocation = null;
}
$array.each(this.dataItems, (dataItem) => {
const id = dataItem.get("id");
if (id && include.indexOf(id) == -1) {
this.disposeDataItem(dataItem);
}
})
}
}
}

Expand Down Expand Up @@ -310,5 +336,5 @@ export abstract class MapSeries extends Series {
protected _onDataClear() {
super._onDataClear();
this._geoJSONparsed = false;
}
}
}
4 changes: 2 additions & 2 deletions src/.internal/charts/percent/PercentDefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ export class PercentDefaultTheme extends Theme {
lineJoin:"round"
});

r("Slice", ["pie"]).states.create("active", { shiftRadius: 20 });
r("Slice", ["pie"]).states.create("hoverActive", { scale: 1 });
r("Slice", ["pie"]).states.create("active", { shiftRadius: 20, scale: 1 });
r("Slice", ["pie"]).states.create("hoverActive", { scale: 1.04 });
r("Slice", ["pie"]).states.create("hover", { scale: 1.04 });

r("RadialLabel", ["pie"]).setAll({
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.2.32";
readonly version: string = "5.2.33";

/**
* List of applied licenses.
Expand Down
3 changes: 3 additions & 0 deletions src/.internal/core/render/Label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export interface ILabelSettings extends IContainerSettings {
/**
* How to handle labels that do not fit into its designated space.
*
* LIMITATIONS: on circular labels, the only values supported are `"hide"` and
* `"truncate"`. The latter will ignore `breakWords` setting.
*
* @see {@link https://www.amcharts.com/docs/v5/concepts/common-elements/labels/#Oversized_text} for more info
*/
oversizedBehavior?: "none" | "hide" | "fit" | "wrap" | "wrap-no-break" | "truncate";
Expand Down
14 changes: 0 additions & 14 deletions src/.internal/core/render/Series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,15 @@ export interface IHeatRule {

export interface ISeriesDataItem extends IComponentDataItem {
id?: string;

value?: number;

/**
* @ignore
*/
valueWorking?:number;

valueChange?: number;
valueChangePercent?: number;
valueChangeSelection?: number;
valueChangeSelectionPercent?: number;
valueChangePrevious?: number;
valueChangePreviousPercent?: number;

/**
* @ignore
*/
valueWorkingOpen?: number;

/**
* @ignore
*/
valueWorkingClose?: number;
}

Expand Down
Loading

0 comments on commit de2d98b

Please sign in to comment.