Skip to content

Commit

Permalink
Version 5.0.0-beta.29
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Oct 1, 2021
1 parent f1afdc0 commit cec7afe
Show file tree
Hide file tree
Showing 53 changed files with 1,041 additions and 796 deletions.
8 changes: 7 additions & 1 deletion examples/shared/xy-line/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ root.setThemes([
am5themes_Animated.new(root)
]);

// Specify date fields, so that they are formatted accordingly in tooltips
// https://www.amcharts.com/docs/v5/concepts/formatters/data-placeholders/#Formatting_placeholders
root.dateFormatter.setAll({
dateFields: ["valueX"]
});


// Create chart
// https://www.amcharts.com/docs/v5/charts/xy-chart/
Expand Down Expand Up @@ -87,7 +93,7 @@ const series = chart.series.push(am5xy.LineSeries.new(root, {
}));

const tooltip = series.set("tooltip", am5.Tooltip.new(root, {}));
tooltip.label.set("text", "{valueY}");
tooltip.label.set("text", "{valueX}: {valueY}");


// Add scrollbar
Expand Down
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.0.0-beta.28",
"version": "5.0.0-beta.29",
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
"description": "amCharts 5",
"homepage": "https://www.amcharts.com/",
Expand Down
3 changes: 3 additions & 0 deletions packages/geodata/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.

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

### Fixed
- Fixed area IDs in map of Slovenia.


## [5.0.2] - 2021-09-24

Expand Down
24 changes: 24 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,42 @@ 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.0.0-beta.29] - 2021-10-01

### Added
- Wherever date or number format can be set (`DateFormatter`, `NumberFormatter`, `DateAxis`, `ValueAxis`, `Exporting`) it can now be set as `Intl.DateTimeFormatOptions` (for date format) or `Intl.NumberFormatOptions` (for number format) object in additional to string-based format. [More info](https://www.amcharts.com/docs/v5/tutorials/formatting-date-time-and-numbers-using-intl-object/).
- New list type `ListAutoDispose` added.

### Changed
- `XYCursor` will now ignore mouse movement if chart is obstructed by other element, unless zoomin/panning.
- `series`, `xAxes`, and `yAxes` on an `XYChart` are now `ListAutoDispose`, which means that removing items from those lists will automatically dispose them. Set `autoDispose = false` on those lists if you are planning on removing and reusing items.

### Fixed
- `Sunburst` nodes were shown on drill-down when they were not supposed to in some cases.
- `Hierarchy` node elements were ignoring `templateField`.
- It was impossible to move `XYChart` scrollbars to some other container.
- Fixed memory leaking when scrolling `LineSeries`, and when disposing series or other items.
- `XYCursor` was not firing `selectended` event if `behavior` was set to `"selectX"`, `"selectY"`, or `"selectXY"`.
- `XYCursor` was hiding selection when when behavior was set to `"selectX"`, `"selectY"`, or `"selectXY"`.
- `SerialChart.series.clear()` was not working properly.


## [5.0.0-beta.28] - 2021-09-28

### Added
- Two new settings in `Pattern`: `strokeDasharray` and `strokeDashoffset`.
- `Graphics` and `Picture` can now have shadows with additional settings: `shadowColor`, `shadowBlur`, `shadowOffsetX`, `shadowOffsetY`, and `shadowOpacity`. [More info](https://www.amcharts.com/docs/v5/concepts/colors-gradients-and-patterns/shadows/).
- New setting in `ListTemplate`: `autoDispose` (default: `true`). If set to `true` will dispose items removed from the list.

### Changed
- `width` and `height` settings in `Pattern` are now optional.

### Fixed
- Fixed the priority of `template` and `templateField`.
- It's now possible for the user to override the `template` of the `ListTemplate`.
- Fixed a memory leak where series' entities were not properly disposed.
- `DataProcessor` was not parsing dates as `Date` objects unless `dateFormat` was also set (which is completely not needed).
- `setRaw` and `setPrivateRaw` no longer trigger events if the value didn't change.


## [5.0.0-beta.27] - 2021-09-27
Expand Down
8 changes: 4 additions & 4 deletions src/.internal/charts/flow/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ export abstract class Flow extends Series {
const target = dataItem.get("target");
const sourceFill = source.get("fill");
const targetFill = target.get("fill");
link.set("fillGradient", undefined);
link.set("strokeGradient", undefined);
link.remove("fillGradient");
link.remove("strokeGradient");

switch (fillStyle) {

Expand Down Expand Up @@ -354,7 +354,7 @@ export abstract class Flow extends Series {
link.set("fillGradient", gradient);
break;
case "none":
link.set("fill", undefined);
link.set("fill", undefined); // do not use remove!
break;
}

Expand Down Expand Up @@ -390,7 +390,7 @@ export abstract class Flow extends Series {
break;

case "none":
link.set("stroke", undefined);
link.remove("stroke");
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/.internal/charts/flow/SankeyLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ export class SankeyLink extends FlowLink {
const source = this.get("source");
if (source) {
const sourceNode = source.get("node");
sourceNode.events.on("positionchanged", () => {
this._disposers.push(sourceNode.events.on("positionchanged", () => {
this.markDirty();
})
}))
}
}
if (this.isDirty("target")) {
const target = this.get("target");
if (target) {
const targetNode = target.get("node");
targetNode.events.on("positionchanged", () => {
this._disposers.push(targetNode.events.on("positionchanged", () => {
this.markDirty();
})
}))
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/.internal/charts/hierarchy/Hierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,9 @@ export abstract class Hierarchy extends Series {
*/
public readonly nodes: ListTemplate<HierarchyNode> = new ListTemplate(
Template.new({}),
() => HierarchyNode._new(this._root, {
() => HierarchyNode.new(this._root, {
themeTags: $utils.mergeTags(this.nodes.template.get("themeTags", []), [this._tag, "hierarchy", "node"])
}, [this.nodes.template])
}, this.nodes.template)
);

/**
Expand Down Expand Up @@ -239,9 +239,9 @@ export abstract class Hierarchy extends Series {
*/
public readonly labels: ListTemplate<Label> = new ListTemplate(
Template.new({}),
() => Label._new(this._root, {
() => Label.new(this._root, {
themeTags: $utils.mergeTags(this.labels.template.get("themeTags", []), [this._tag, "hierarchy", "node"])
}, [this.labels.template])
}, this.labels.template)
);

public _currentDownDepth: number | undefined;
Expand Down
10 changes: 8 additions & 2 deletions src/.internal/charts/hierarchy/LinkedHierarchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ export abstract class LinkedHierarchy extends Hierarchy {

const d = circle.get("radius", this.width()) * 2;
label.setAll({ maxWidth: d, maxHeight: d });

circle._setDataItem(dataItem);
outerCircle._setDataItem(dataItem);

return node;
}
Expand Down Expand Up @@ -274,13 +277,16 @@ export abstract class LinkedHierarchy extends Hierarchy {
const fill = dataItem.get("fill");
const circle = dataItem.get("circle");
const children = dataItem.get("children");

if (circle) {
circle.setAll({ fill: fill, stroke: fill });
circle._setDefault("fill", fill);
circle._setDefault("stroke", fill);
}

const outerCircle = dataItem.get("outerCircle");
if (outerCircle) {
outerCircle.setAll({ fill: fill, stroke: fill });
outerCircle._setDefault("fill", fill);
outerCircle._setDefault("stroke", fill);

if (!children || children.length == 0) {
outerCircle.setPrivate("visible", false);
Expand Down
7 changes: 4 additions & 3 deletions src/.internal/charts/hierarchy/Pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@ export class Pack extends Hierarchy {
node.animate({ key: "x", to: x, duration: duration, easing: easing })
node.animate({ key: "y", to: y, duration: duration, easing: easing })

const fill = dataItem.get("fill");

if (circle) {
const fill = dataItem.get("fill");

circle.animate({ key: "radius", to: radius, duration: duration, easing: easing })
circle.setAll({ fill: fill });
circle._setDefault("fill", fill);
circle._setDefault("stroke", fill);
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/.internal/charts/hierarchy/Partition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ export class Partition extends Hierarchy {

if (rectangle) {
const fill = dataItem.get("fill");

rectangle.animate({ key: "width", to: w, duration: duration, easing: easing })
rectangle.animate({ key: "height", to: h, duration: duration, easing: easing })
rectangle.setAll({ fill: fill });
rectangle._setDefault("fill", fill);
rectangle._setDefault("stroke", fill);
}
}

Expand Down Expand Up @@ -256,6 +258,7 @@ export class Partition extends Hierarchy {
const rectangle = node.children.moveValue(this.rectangles.make(), 0);
node.setPrivate("tooltipTarget", rectangle);
dataItem.setRaw("rectangle", rectangle);
rectangle._setDataItem(dataItem);

const label = dataItem.get("label");

Expand Down
8 changes: 7 additions & 1 deletion src/.internal/charts/hierarchy/Sunburst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,11 @@ export class Sunburst extends Partition {
slice.animate({ key: "innerRadius", to: sliceInnerRadius, duration: duration, easing: easing })
slice.animate({ key: "startAngle", to: sliceStartAngle, duration: duration, easing: easing })
slice.animate({ key: "arc", to: arc, duration: duration, easing: easing })
slice.setAll({ fill: dataItem.get("fill") });

const fill = dataItem.get("fill");

slice._setDefault("fill", fill);
slice._setDefault("stroke", fill);
}
}

Expand Down Expand Up @@ -314,6 +318,8 @@ export class Sunburst extends Partition {
node.setPrivate("tooltipTarget", slice);
dataItem.setRaw("slice", slice);

slice._setDataItem(dataItem);

slice.on("arc", () => {
this._updateLabel(dataItem);
})
Expand Down
7 changes: 4 additions & 3 deletions src/.internal/charts/hierarchy/Treemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,13 @@ export class Treemap extends Hierarchy {
node.animate({ key: "width", to: w, duration: duration, easing: easing })
node.animate({ key: "height", to: h, duration: duration, easing: easing })

const fill = dataItem.get("fill");

if (rectangle) {
const fill = dataItem.get("fill");

rectangle.animate({ key: "width", to: w, duration: duration, easing: easing })
rectangle.animate({ key: "height", to: h, duration: duration, easing: easing })
rectangle.setAll({ fill: fill });
rectangle._setDefault("fill", fill);
rectangle._setDefault("stroke", fill);
}
}

Expand Down
8 changes: 1 addition & 7 deletions src/.internal/charts/map/MapChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,7 @@ export class MapChart extends SerialChart {
if (zoomControl !== previous) {
this._disposeProperty("zoomControl");
if (previous) {
previous.setPrivate("chart", undefined)
if (previous.get("autoDispose")) {
previous.dispose();
}
else {
this.children.removeValue(previous)
}
previous.dispose();
}
if (zoomControl) {
zoomControl.setPrivate("chart", this);
Expand Down
2 changes: 1 addition & 1 deletion src/.internal/charts/radar/AxisRendererCircular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class AxisRendererCircular extends AxisRenderer {
public _afterNew() {
this._settings.themeTags = $utils.mergeTags(this._settings.themeTags, ["renderer", "circular"]);
super._afterNew();
this._setPrivate("letter", "X");
this.setPrivateRaw("letter", "X");
this.setRaw("position", "absolute");
}

Expand Down
2 changes: 1 addition & 1 deletion src/.internal/charts/radar/AxisRendererRadial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class AxisRendererRadial extends AxisRenderer {
public _afterNew() {
this._settings.themeTags = $utils.mergeTags(this._settings.themeTags, ["renderer", "radial"]);
super._afterNew();
this._setPrivate("letter", "Y");
this.setPrivate("letter", "Y");
this.setRaw("position", "absolute");
}

Expand Down
2 changes: 1 addition & 1 deletion src/.internal/charts/radar/RadarChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class RadarChart extends XYChart {
this._updateMask(series.bulletsContainer, innerRadius, radius);
}
else {
series.bulletsContainer.set("mask", undefined);
series.bulletsContainer.remove("mask");
}
})

Expand Down
Loading

0 comments on commit cec7afe

Please sign in to comment.