From f71f80b49d7812b78b8fb789c93494a189365a16 Mon Sep 17 00:00:00 2001 From: codecalm Date: Sun, 8 Dec 2019 22:06:50 +0100 Subject: [PATCH] editorconfig fixes, charts demo --- .editorconfig | 11 +------- pages/_data/charts.yml | 35 ++++++++++++++------------ pages/_includes/cards/charts/card.html | 10 -------- pages/_includes/layout/homepage.html | 4 +-- pages/_includes/ui/chart.html | 6 ++--- pages/charts.html | 17 ++++++++++--- 6 files changed, 38 insertions(+), 45 deletions(-) delete mode 100644 pages/_includes/cards/charts/card.html diff --git a/.editorconfig b/.editorconfig index d41b743d8..24c3d45f8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,8 +10,8 @@ indent_style=tab tab_width=3 [*.html] -indent_style=space indent_size=3 +insert_final_newline=false [*.md] indent_style=tab @@ -20,12 +20,3 @@ tab_width=3 [*.js.map] indent_style=tab indent_size=3 - -[{*.css,*.scss}] -indent_style=space -indent_size=2 -insert_final_newline = true - -[{*.yml,*.yaml}] -indent_style=space -indent_size=2 diff --git a/pages/_data/charts.yml b/pages/_data/charts.yml index aed917a83..b52d9efd8 100644 --- a/pages/_data/charts.yml +++ b/pages/_data/charts.yml @@ -1,5 +1,6 @@ total-sales: type: donut + demo: true sparkline: true hide-legend: true name: Total sales @@ -19,6 +20,7 @@ total-sales: campaigns: name: Campaigns + demo: true type: radialBar sparkline: true hide-legend: true @@ -35,6 +37,7 @@ campaigns: tasks: name: Tasks + demo: true type: line categories: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W'] groups: [1, 2, 3] @@ -71,7 +74,7 @@ development-activity: line: name: Employment Growth - display: true + demo: true type: line show-grid: true categories: ['2013', '2014', '2015', '2016', '2017', '2018'] @@ -88,7 +91,7 @@ line: line-stroke: name: Line chart - display: true + demo: true type: line stroke-curve: straight hide-legend: true @@ -107,7 +110,7 @@ line-stroke: stepline: name: Stepline - display: true + demo: true type: line hide-legend: true stroke-curve: stepline @@ -119,7 +122,7 @@ stepline: temperature: name: Monthly Average Temperature - display: true + demo: true type: line show-labels: true show-data-labels: true @@ -138,7 +141,7 @@ temperature: area: name: Lorem ipsum - display: true + demo: true type: area hide-legend: true categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'] @@ -153,7 +156,7 @@ area: area-spline: name: Lorem ipsum - display: true + demo: true type: area spline: true hide-legend: true @@ -169,7 +172,7 @@ area-spline: area-spline-stacked: name: Lorem ipsum - display: true + demo: true type: area spline: true hide-legend: true @@ -186,7 +189,7 @@ area-spline-stacked: spline: name: Wind speed during two days - display: true + demo: true type: line spline: true show-labels: true @@ -203,7 +206,7 @@ spline: spline-rotated: name: Lorem ipsum - display: true + demo: true type: line spline: true rotated: true @@ -220,7 +223,7 @@ spline-rotated: bar: name: Lorem ipsum - display: true + demo: true type: bar hide-legend: true categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'] @@ -234,7 +237,7 @@ bar: bar-rotated: name: Lorem ipsum - display: true + demo: true type: bar rotated: true hide-legend: true @@ -250,7 +253,7 @@ bar-rotated: bar-stacked: name: Lorem ipsum - display: true + demo: true type: bar stacked: true hide-legend: true @@ -266,7 +269,7 @@ bar-stacked: pie: name: Lorem ipsum - display: true + demo: true type: pie hide-legend: true show-data-labels: true @@ -287,7 +290,7 @@ pie: donut: name: Lorem ipsum - display: true + demo: true type: donut sparkline: true hide-legend: true @@ -302,7 +305,7 @@ donut: scatter: name: Lorem ipsum - display: true + demo: true type: scatter hide-legend: true categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'] @@ -317,7 +320,7 @@ scatter: combination: name: Combination chart - display: true + demo: true type: bar types: 2: 'line' diff --git a/pages/_includes/cards/charts/card.html b/pages/_includes/cards/charts/card.html deleted file mode 100644 index 65610037c..000000000 --- a/pages/_includes/cards/charts/card.html +++ /dev/null @@ -1,10 +0,0 @@ -{% assign data = site.data.charts[include.chart-id] %} -{% assign height = include.height | default: 10 %} -
-
- {% if include.title %} -

{{ include.title }}

- {% endif %} - {% include ui/chart.html height=height chart-id=include.chart-id %} -
-
diff --git a/pages/_includes/layout/homepage.html b/pages/_includes/layout/homepage.html index 64d3e084b..b52493991 100644 --- a/pages/_includes/layout/homepage.html +++ b/pages/_includes/layout/homepage.html @@ -43,10 +43,10 @@
- {% include cards/charts/card.html chart-id="temperature" height=10 %} + {% comment %}{% include cards/charts/card.html chart-id="temperature" height=10 %}{% endcomment %}
- {% include cards/charts/card.html chart-id="donut" height=10 %} + {% comment %}{% include cards/charts/card.html chart-id="donut" height=10 %}{% endcomment %}
diff --git a/pages/_includes/ui/chart.html b/pages/_includes/ui/chart.html index 3f5dae0d6..93965d516 100644 --- a/pages/_includes/ui/chart.html +++ b/pages/_includes/ui/chart.html @@ -105,10 +105,10 @@ {% endif %} {% if data.series %} - colors: [ //chart colors + colors: [ {% for serie in data.series %} - {{ serie.color | default: 'blue' | tabler_js_color }}{% unless forloop.last %},{% endunless %}{% endfor %} - ], + {{ serie.color | default: 'blue' | tabler_js_color }}{% unless forloop.last %},{% endunless %}{% endfor %} + ], {% endif %} {% if data.hide-legend %} diff --git a/pages/charts.html b/pages/charts.html index 1f26188a9..d04d73415 100644 --- a/pages/charts.html +++ b/pages/charts.html @@ -1,16 +1,25 @@ --- title: Charts +page-title: Charts menu: charts ---
{% for chart in site.data.charts %} - {% if chart[1].display %} - {% assign chart-name = chart[0] %} + {% if chart[1].demo %} + {% assign chart-id = chart[0] %}
- {% include cards/charts/card.html chart-id=chart-name %} +
+ {% if chart[1].name %} +
+

{{ chart[1].name }}

+
+ {% endif %} +
+ {% include ui/chart.html chart-id=chart-id height=15 %} +
+
{% endif %} {% endfor %} -