Skip to content

Commit

Permalink
Version 4.10.20
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Jun 17, 2021
1 parent a46bbb9 commit d917386
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 68 deletions.
6 changes: 6 additions & 0 deletions dist/ember/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.

## [4.10.20] - 2021-06-17

### Fixed
- In-line formatting of labels was triggering errors on pages with strict CSP rules.


## [4.10.19] - 2021-06-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/ember/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amcharts/amcharts4-ember",
"version": "4.10.19",
"version": "4.10.20",
"description": "Ember add-on for amCharts 4",
"keywords": [
"ember-addon",
Expand Down
6 changes: 6 additions & 0 deletions dist/ember/vendor/script/amcharts4/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.

## [4.10.20] - 2021-06-17

### Fixed
- In-line formatting of labels was triggering errors on pages with strict CSP rules.


## [4.10.19] - 2021-06-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/ember/vendor/script/amcharts4/core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ember/vendor/script/amcharts4/core.js.map

Large diffs are not rendered by default.

30 changes: 8 additions & 22 deletions dist/es2015/.internal/charts/axes/Axis.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,20 @@ export declare class AxisDataItem extends DataItem {
*
* ```TypeScript
* // Hide all ticks and labels closer than 20% to axis beginning.
* axis.renderer.ticks.template.minPosition = 0.2;
* axis.renderer.labels.template.minPosition = 0.2;
* axis.dataItems.template.minPosition = 0.2;
* ```
* ```JavaScript
* // Hide all ticks and labels closer than 20% to axis beginning.
* axis.renderer.ticks.template.minPosition = 0.2;
* axis.renderer.labels.template.minPosition = 0.2;
* axis.dataItems.template.minPosition = 0.2;
* ```
* ```JSON
* {
* // ...
* "xAxes": [{
* // ...
* // Hide all ticks and labels closer than 20% to axis beginning.
* "renderer": {
* "ticks": {
* "minPosition": 0.2
* },
* "labels": {
* "minPosition": 0.2
* }
* "dataItems": {
* "minPosition": 0.2
* }
* }]
* }
Expand All @@ -146,27 +139,20 @@ export declare class AxisDataItem extends DataItem {
*
* ```TypeScript
* // Hide all ticks and labels closer than 20% to axis end.
* axis.renderer.ticks.template.maxPosition = 0.8;
* axis.renderer.labels.template.maxPosition = 0.8;
* axis.dataItems.template.maxPosition = 0.8;
* ```
* ```JavaScript
* // Hide all ticks and labels closer than 20% to axis end.
* axis.renderer.ticks.template.maxPosition = 0.8;
* axis.renderer.labels.template.maxPosition = 0.8;
* axis.dataItems.template.maxPosition = 0.8;
* ```
* ```JSON
* {
* // ...
* "xAxes": [{
* // ...
* // Hide all ticks and labels closer than 20% to axis end.
* "renderer": {
* "ticks": {
* "maxPosition": 0.8
* },
* "labels": {
* "maxPosition": 0.8
* }
* "dataItems": {
* "maxPosition": 0.8
* }
* }]
* }
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/.internal/charts/axes/Axis.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es2015/.internal/core/System.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es2015/.internal/core/System.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/es2015/.internal/core/elements/Label.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ export declare class Label extends Container {
* @return Available height (px)
*/
readonly availableHeight: number;
getSvgElement(text: string, style?: string): AMElement;
getSvgElement(text: string, style?: string, parent?: Group): AMElement;
/**
* Invalidates the whole element, including layout AND all its child
* elements.
Expand Down
27 changes: 22 additions & 5 deletions dist/es2015/.internal/core/elements/Label.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/es2015/.internal/core/elements/Label.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/es2015/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.

## [4.10.20] - 2021-06-17

### Fixed
- In-line formatting of labels was triggering errors on pages with strict CSP rules.


## [4.10.19] - 2021-06-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/es2015/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amcharts/amcharts4",
"version": "4.10.19",
"version": "4.10.20",
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
"description": "amCharts 4",
"homepage": "https://www.amcharts.com/",
Expand Down
6 changes: 6 additions & 0 deletions dist/script/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.

## [4.10.20] - 2021-06-17

### Fixed
- In-line formatting of labels was triggering errors on pages with strict CSP rules.


## [4.10.19] - 2021-06-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion dist/script/core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/script/core.js.map

Large diffs are not rendered by default.

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/amcharts4",
"version": "4.10.19",
"version": "4.10.20",
"repository": {
"type": "git",
"url": "https://github.com/amcharts/amcharts4.git"
Expand Down
30 changes: 8 additions & 22 deletions src/.internal/charts/axes/Axis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,20 @@ export class AxisDataItem extends DataItem {
*
* ```TypeScript
* // Hide all ticks and labels closer than 20% to axis beginning.
* axis.renderer.ticks.template.minPosition = 0.2;
* axis.renderer.labels.template.minPosition = 0.2;
* axis.dataItems.template.minPosition = 0.2;
* ```
* ```JavaScript
* // Hide all ticks and labels closer than 20% to axis beginning.
* axis.renderer.ticks.template.minPosition = 0.2;
* axis.renderer.labels.template.minPosition = 0.2;
* axis.dataItems.template.minPosition = 0.2;
* ```
* ```JSON
* {
* // ...
* "xAxes": [{
* // ...
* // Hide all ticks and labels closer than 20% to axis beginning.
* "renderer": {
* "ticks": {
* "minPosition": 0.2
* },
* "labels": {
* "minPosition": 0.2
* }
* "dataItems": {
* "minPosition": 0.2
* }
* }]
* }
Expand All @@ -185,27 +178,20 @@ export class AxisDataItem extends DataItem {
*
* ```TypeScript
* // Hide all ticks and labels closer than 20% to axis end.
* axis.renderer.ticks.template.maxPosition = 0.8;
* axis.renderer.labels.template.maxPosition = 0.8;
* axis.dataItems.template.maxPosition = 0.8;
* ```
* ```JavaScript
* // Hide all ticks and labels closer than 20% to axis end.
* axis.renderer.ticks.template.maxPosition = 0.8;
* axis.renderer.labels.template.maxPosition = 0.8;
* axis.dataItems.template.maxPosition = 0.8;
* ```
* ```JSON
* {
* // ...
* "xAxes": [{
* // ...
* // Hide all ticks and labels closer than 20% to axis end.
* "renderer": {
* "ticks": {
* "maxPosition": 0.8
* },
* "labels": {
* "maxPosition": 0.8
* }
* "dataItems": {
* "maxPosition": 0.8
* }
* }]
* }
Expand Down
2 changes: 1 addition & 1 deletion src/.internal/core/System.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class System {
*
* @see {@link https://docs.npmjs.com/misc/semver}
*/
static VERSION: string = "4.10.19";
static VERSION: string = "4.10.20";

/**
* @todo Description
Expand Down
34 changes: 28 additions & 6 deletions src/.internal/core/elements/Label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import * as $type from "../utils/Type";
import { Paper } from "../rendering/Paper";
import * as $dom from "../utils/DOM";
import { defaultRules, ResponsiveBreakpoints } from "../utils/Responsive";
import { options } from "../Options";


/**
Expand Down Expand Up @@ -675,13 +676,11 @@ export class Label extends Container {
lineInfo.style = getTextFormatter().translateStyleShortcuts(currentFormat);


let tspan = this.getSvgElement(lineInfo.text, lineInfo.style);

if (this.textPathElement) {
this.textPathElement.add(tspan);
this.getSvgElement(lineInfo.text, lineInfo.style, this.textPathElement);
}
else {
lineInfo.element.add(tspan);
this.getSvgElement(lineInfo.text, lineInfo.style, lineInfo.element);
}

this.getLineBBox(lineInfo);
Expand Down Expand Up @@ -1747,12 +1746,35 @@ export class Label extends Container {
}

// temp, replacing textFormatter method
public getSvgElement(text: string, style?: string): AMElement {
public getSvgElement(text: string, style?: string, parent?: Group): AMElement {
let element = this.paper.add("tspan");
element.textContent = text;
if (style) {
element.node.setAttribute("style", style);

if (options.nonce && parent) {
//element.node.setAttribute("nonce", "test123");
const classid = "amcharts_element_style_" + btoa(style).replace(/[^\w]*/g, "");
element.node.setAttribute("class", classid);

const defs = <SVGDefsElement>document.createElementNS($dom.SVGNS, "defs");
parent.node.appendChild(defs);

const e = document.createElement("style");
e.type = "text/css";
e.innerHTML = "." + classid + " { " + style + "}";
e.setAttribute("nonce", options.nonce)
defs.appendChild(e);
}
else {
element.node.setAttribute("style", style);
}

}

if (parent) {
parent.add(element);
}

return element;
}

Expand Down

0 comments on commit d917386

Please sign in to comment.