From b9e5c5549b8137daebe982c50e9a89eafaa03f11 Mon Sep 17 00:00:00 2001 From: Andi Staub Date: Tue, 12 Dec 2017 10:20:53 +0100 Subject: [PATCH] Just pass an array as argument to web-component --- README.md | 10 ++++------ src/components/EmployeesContainer.jsx | 2 +- src/components/SalariesContainer.jsx | 2 +- src/webcomponents/pan-employees-graph.js | 4 ++-- src/webcomponents/pan-salaries-graph.js | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9d099d8..d1b9339 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,15 @@ To use those components, add `dashboard-components.js` and needed polyfills to y "data":[["2017 September","70%"]]}" > - - ``` diff --git a/src/components/EmployeesContainer.jsx b/src/components/EmployeesContainer.jsx index 800fa23..ee5c205 100644 --- a/src/components/EmployeesContainer.jsx +++ b/src/components/EmployeesContainer.jsx @@ -74,7 +74,7 @@ class EmployeesContainer extends Component {
people
diff --git a/src/components/SalariesContainer.jsx b/src/components/SalariesContainer.jsx index 1b4e3b5..87485a8 100644 --- a/src/components/SalariesContainer.jsx +++ b/src/components/SalariesContainer.jsx @@ -35,7 +35,7 @@ class SalariesContainer extends Component { return (
diff --git a/src/webcomponents/pan-employees-graph.js b/src/webcomponents/pan-employees-graph.js index 635f4aa..9dd6e5f 100644 --- a/src/webcomponents/pan-employees-graph.js +++ b/src/webcomponents/pan-employees-graph.js @@ -79,7 +79,7 @@ class PanEmployeesGraph extends StatelessWebComponent {
- ${this.dataJson && this.dataJson.data.map(column => ` + ${this.dataJson && this.dataJson.map(column => `
@@ -101,7 +101,7 @@ class PanEmployeesGraph extends StatelessWebComponent { get scaleMax() { // Extend the height of the scale with 1 element - return (Math.max(...this.dataJson.data.map(element => element.value)) + 1); + return (Math.max(...this.dataJson.map(element => element.value)) + 1); } itemHeight(value) { diff --git a/src/webcomponents/pan-salaries-graph.js b/src/webcomponents/pan-salaries-graph.js index 6b7f560..8171ec5 100644 --- a/src/webcomponents/pan-salaries-graph.js +++ b/src/webcomponents/pan-salaries-graph.js @@ -17,7 +17,7 @@ class PanSalariesGraph extends StatelessWebComponent { } get salaries() { - return JSON.parse(this.data).data; + return JSON.parse(this.data); } get scaleStep() { return 1000; } -- GitLab