Skip to content

Commit

Permalink
Version 5.0.0-beta.26
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Sep 24, 2021
1 parent c27fd70 commit 4c393e4
Show file tree
Hide file tree
Showing 18 changed files with 81 additions and 30 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.0.0-beta.25",
"version": "5.0.0-beta.26",
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
"description": "amCharts 5",
"homepage": "https://www.amcharts.com/",
Expand Down
16 changes: 11 additions & 5 deletions packages/geodata/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.

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

### Fixed
- Fixed Svalbard map.
- Fixed Nigeria map.
- Fixed US Congressional maps: Alabama, Florida, Maine, Massachusetts, New Jersey, Michigan, Virginia, Washington.
- Fixing type errors with `GeoJSON`.

## [5.0.2] - 2021-09-24

### Added
- JSON versions of the geodata can now be found in the `json` folder.

### Changed
- Updated province IDs to recent changes in ISO in a map of South Africa.

### Fixed
- Fixed Svalbard map.
- Fixed Nigeria map.
- Fixed US Congressional maps: Alabama, Florida, Maine, Maryland, Massachusetts, New Jersey, Michigan, Rhode Island, Virginia, Washington.
- Fixed type errors with `GeoJSON`.


## [5.0.1] - 2021-08-25

Expand Down
2 changes: 1 addition & 1 deletion packages/geodata/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amcharts/amcharts5-geodata",
"version": "5.0.1",
"version": "5.0.2",
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
"description": "amCharts 5 Geo Data",
"homepage": "https://www.amcharts.com/",
Expand Down
6 changes: 6 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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.26] - 2021-09-24

### Fixed
- `MapLineSeries` with line geometry inside GeoJSON was not working properly.


## [5.0.0-beta.25] - 2021-09-24

### Added
Expand Down
1 change: 1 addition & 0 deletions src/.internal/charts/flow/Chord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export class Chord extends Flow {
*/
public makeLink(dataItem: DataItem<this["_dataItemSettings"]>): ChordLink {
const link = this.linksContainer.children.push(this.links.make());
this.links.push(link);
link._setDataItem(dataItem);
link.set("source", dataItem.get("source"));
link.set("target", dataItem.get("target"));
Expand Down
1 change: 1 addition & 0 deletions src/.internal/charts/flow/ChordNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ export class ChordNodes extends FlowNodes {
slice._setSoft("fill", dataItem.get("fill"));

const label = this.labels.make();
this.labels.push(label);
label.addTag("flow");
label.addTag("chord");
label.addTag("node");
Expand Down
1 change: 1 addition & 0 deletions src/.internal/charts/flow/Flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export abstract class Flow extends Series {
super.disposeDataItem(dataItem);
let link = dataItem.get("link");
if (link) {
this.links.removeValue(link);
link.dispose();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/.internal/charts/flow/FlowNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ export abstract class FlowNodes extends Series {
super.disposeDataItem(dataItem);
let node = dataItem.get("node");
if (node) {
node.dispose();
this.nodes.removeValue(node);
node.dispose();
}
let label = dataItem.get("label");
if (label) {
label.dispose();
this.labels.removeValue(label);
label.dispose();
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/.internal/charts/flow/Sankey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export class Sankey extends Flow {
link.set("source", source);
link.set("target", target);
link.series = this;

this.links.push(link);

return link;
}

Expand Down
6 changes: 4 additions & 2 deletions src/.internal/charts/flow/SankeyNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class SankeyNodes extends FlowNodes {

const rectangle = node.children.insertIndex(0, this.rectangles.make());
this.rectangles.push(rectangle);
rectangle._setSoft("fill", dataItem.get("fill"));
rectangle._setSoft("fill", dataItem.get("fill"));
dataItem.set("rectangle", rectangle);

node.events.on("dragged", () => {
Expand All @@ -96,6 +96,8 @@ export class SankeyNodes extends FlowNodes {
})

const label = this.labels.make();
this.labels.push(label);

if (flow) {
label.addTag(flow.get("orientation", ""));
}
Expand Down Expand Up @@ -134,8 +136,8 @@ export class SankeyNodes extends FlowNodes {
super.disposeDataItem(dataItem);
let rectangle = dataItem.get("rectangle");
if (rectangle) {
rectangle.dispose();
this.rectangles.removeValue(rectangle);
rectangle.dispose();
}
}
}
3 changes: 1 addition & 2 deletions src/.internal/charts/hierarchy/BreadcrumbBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,4 @@ export class BreadcrumbBar extends Container {
}
}
}
}

}
2 changes: 1 addition & 1 deletion src/.internal/charts/map/MapLineSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class MapLineSeries extends MapSeries {
mapLine = this.makeMapLine(dataItem);
}

dataItem.setRaw("mapLine", mapLine);
dataItem.set("mapLine", mapLine);
const pointsToConnect = dataItem.get("pointsToConnect");
if (pointsToConnect) {
$array.each(pointsToConnect, (point) => {
Expand Down
2 changes: 1 addition & 1 deletion src/.internal/charts/map/MapPolygonSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class MapPolygonSeries extends MapSeries {
mapPolygon = this.makeMapPolygon(dataItem);
}

dataItem.setRaw("mapPolygon", mapPolygon);
dataItem.set("mapPolygon", mapPolygon);
const geometry = dataItem.get("geometry")!;

if (geometry) {
Expand Down
17 changes: 15 additions & 2 deletions src/.internal/charts/xy/XYCursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,20 @@ export class XYCursor extends Container {
positionY = userPositionY;
}

if (Math.abs(positionX - this.getPrivate("downPositionX", 0)) > 0.002 || Math.abs(positionY - this.getPrivate("downPositionY", 0)) > 0.002) {
let dispatch = false;
if (behavior === "zoomX" || behavior === "zoomXY") {
if (Math.abs(positionX - this.getPrivate("downPositionX", 0)) > 0.003) {
dispatch = true;
}
}

if (behavior === "zoomY" || behavior === "zoomXY") {
if (Math.abs(positionY - this.getPrivate("downPositionY", 0)) > 0.003) {
dispatch = true;
}
}

if (dispatch) {
const type = "selectended";
if (this.events.isEnabled(type)) {
this.events.dispatch(type, { type: type, target: this });
Expand All @@ -384,7 +397,7 @@ export class XYCursor extends Container {
}

protected _handleMove(event: IPointerEvent) {
if(this.getPrivate("visible")){
if (this.getPrivate("visible")) {
// TODO: handle multitouch
const rootPoint = this._root.documentPointToRoot({ x: event.clientX, y: event.clientY });

Expand Down
5 changes: 5 additions & 0 deletions src/.internal/charts/xy/axes/Axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,20 +784,25 @@ export abstract class Axis<R extends AxisRenderer> extends Component {
*/
public disposeDataItem(dataItem: DataItem<this["_dataItemSettings"]>) {
super.disposeDataItem(dataItem);
const renderer = this.get("renderer");
const label = dataItem.get("label");
if (label) {
renderer.labels.removeValue(label);
label.dispose();
}
const tick = dataItem.get("tick");
if (tick) {
renderer.ticks.removeValue(tick);
tick.dispose();
}
const grid = dataItem.get("grid");
if (grid) {
renderer.grid.removeValue(grid);
grid.dispose();
}
const axisFill = dataItem.get("axisFill");
if (axisFill) {
renderer.axisFills.removeValue(axisFill);
axisFill.dispose();
}
}
Expand Down
20 changes: 13 additions & 7 deletions src/.internal/charts/xy/series/BaseColumnSeries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ export abstract class BaseColumnSeries extends XYSeries {

const rangeGraphics = this._makeGraphics(axisRange.columns, dataItem);
graphicsArray.push(rangeGraphics);
rangeGraphics.setPrivate("list", axisRange.columns);
container.children.push(rangeGraphics);
})
}
Expand Down Expand Up @@ -317,7 +318,7 @@ export abstract class BaseColumnSeries extends XYSeries {
t = yAxis.getDataItemPositionY(dataItem, yOpenField, startLocation, vcy);
b = yAxis.getDataItemPositionY(dataItem, yField, endLocation, vcy);

dataItem.set("point", { x: l + (r - l) / 2, y: t + (b - t) / 2 });
dataItem.setRaw("point", { x: l + (r - l) / 2, y: t + (b - t) / 2 });
}
else if (xAxis === baseAxis) {

Expand Down Expand Up @@ -352,7 +353,7 @@ export abstract class BaseColumnSeries extends XYSeries {
}
}

dataItem.set("point", { x: l + (r - l) / 2, y: t });
dataItem.setRaw("point", { x: l + (r - l) / 2, y: t });
}
else if (yAxis === baseAxis) {
let startLocation = this._aLocationY0 + openLocationY - 0.5;
Expand Down Expand Up @@ -386,7 +387,7 @@ export abstract class BaseColumnSeries extends XYSeries {
}
}

dataItem.set("point", { x: r, y: t + (b - t) / 2 });
dataItem.setRaw("point", { x: r, y: t + (b - t) / 2 });
}

this._updateSeriesGraphics(dataItem, graphics!, l, r, t, b);
Expand Down Expand Up @@ -453,10 +454,10 @@ export abstract class BaseColumnSeries extends XYSeries {
graphics.set("x", l);
graphics.set("y", b - (b - t));

dataItem.set("left", l);
dataItem.set("right", r);
dataItem.set("top", t);
dataItem.set("bottom", b);
dataItem.setRaw("left", l);
dataItem.setRaw("right", r);
dataItem.setRaw("top", t);
dataItem.setRaw("bottom", b);
}

protected _handleDataSetChange() {
Expand Down Expand Up @@ -532,12 +533,17 @@ export abstract class BaseColumnSeries extends XYSeries {
super.disposeDataItem(dataItem);
const graphics = dataItem.get("graphics");
if (graphics) {
this.columns.removeValue(graphics);
graphics.dispose();
}

const rangeGraphics = dataItem.get("rangeGraphics")!;
if (rangeGraphics) {
$array.each(rangeGraphics, (graphics) => {
const list = graphics.getPrivate("list");
if (list) {
list.removeValue(graphics);
}
graphics.dispose();
})
}
Expand Down
10 changes: 5 additions & 5 deletions src/.internal/core/render/Legend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,32 +383,32 @@ export class Legend extends Series {

let itemContainer = dataItem.get("itemContainer");
if (itemContainer) {
itemContainer.dispose();
this.itemContainers.removeValue(itemContainer);
itemContainer.dispose();
}

let marker = dataItem.get("marker");
if (marker) {
marker.dispose();
this.markers.removeValue(marker);
marker.dispose();
}

let markerRectangle = dataItem.get("markerRectangle");
if (markerRectangle) {
markerRectangle.dispose();
this.markerRectangles.removeValue(markerRectangle);
markerRectangle.dispose();
}

let label = dataItem.get("label");
if (label) {
label.dispose();
this.labels.removeValue(label);
label.dispose();
}

let valueLabel = dataItem.get("valueLabel");
if (valueLabel) {
valueLabel.dispose();
this.valueLabels.removeValue(valueLabel);
valueLabel.dispose();
}

}
Expand Down
10 changes: 9 additions & 1 deletion src/.internal/core/render/Sprite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Percent } from "../util/Percent";
import { EventDispatcher, Events, EventListener } from "../util/EventDispatcher";
import { IDisposer, MultiDisposer, CounterDisposer } from "../util/Disposer";
import { waitForAnimations } from "../util/Animation";
import type { ListTemplate } from "../util/List";

import * as $utils from "../util/Utils";
import * as $array from "../util/Array";
Expand Down Expand Up @@ -476,8 +477,15 @@ export interface ISpritePrivate extends IEntityPrivate {
*/
focusElement?: HTMLDivElement;


/**
* @todo review
*/
tooltipTarget?: Graphics;

/**
* @ignore
*/
list?:ListTemplate<Sprite>;
}

/**
Expand Down

0 comments on commit 4c393e4

Please sign in to comment.