Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve readability of sample app templates #92

Merged
merged 24 commits into from
Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addon/components/c3-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default Component.extend({
tagName: "div",
classNames: ["c3-chart-component"],
_transition: 350,
dtitle: null,

// triggered when data is updated by didUpdateAttrs
_reload() {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "ember-c3",
"version": "1.2.1",
"version": "1.2.2",
"description": "Ember addon library for C3, a D3-based reusable chart library.",
"keywords": [
Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
{{#link-to "index" class="navbar-brand"}}
<img src="images/ember-logo.png" alt="">
<span>
C3
</span>
<span>C3</span>
{{/link-to}}
<button
class="navbar-toggler"
Expand Down
4 changes: 1 addition & 3 deletions tests/dummy/app/templates/chart-events.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
</div>

<div class="mt-5">
<h5>
controllers/index.js
</h5>
<h5>controllers/index.js</h5>
{{code-snippet name="chart-events.js"}}
</div>
22 changes: 12 additions & 10 deletions tests/dummy/app/templates/chart-obj.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
{{chartTitle}}
</h3>
<h3>{{chartTitle}}</h3>
{{/panel.header}}
{{#panel.content}}{{c3-chart data=data c3chart=chart}}{{/panel.content}}

{{#panel.content}}
{{c3-chart data=data c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "toggleLegend"}}>
Toggle Legend
Expand All @@ -16,6 +18,7 @@
<button class="btn btn-sm btn-primary" onclick={{action "transform"}}>
Transform
</button>

{{#if isBar}}
<button class="btn btn-sm btn-primary" onclick={{action "stackBars"}}>
Stack Bars
Expand All @@ -25,19 +28,18 @@
Combo
</button>
{{/if}}

<button class="btn btn-sm btn-primary" onclick={{action "changeColors"}}>
Change Colors
</button>
</div>

<div class="mt-5">
<h5>
templates/index.hbs
</h5>
<h5>templates/index.hbs</h5>
{{code-snippet name="index.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/index.js
</h5>
<h5>controllers/index.js</h5>
{{code-snippet name="chart-events.js"}}
</div>
16 changes: 7 additions & 9 deletions tests/dummy/app/templates/donut.hbs
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Donut Chart
</h3>
<h3>Donut Chart</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart data=data donut=donut title=title padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "animate"}}>
Animate
</button>
</div>

<div class="mt-5">
<h5>
templates/donut.hbs
</h5>
<h5>templates/donut.hbs</h5>
{{code-snippet name="donut.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/donut.js
</h5>
<h5>controllers/donut.js</h5>
{{code-snippet name="donut.js"}}
</div>
16 changes: 7 additions & 9 deletions tests/dummy/app/templates/drilldown.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Drill Down
</h3>
<h3>Drill Down</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart data=data title=title dtitle=dtitle padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<span class="pull-right text-primary">
Click on pie segments to drill down
Expand All @@ -22,15 +22,13 @@
Change Title
</button>
</div>

<div class="mt-5">
<h5>
templates/drilldown.hbs
</h5>
<h5>templates/drilldown.hbs</h5>
{{code-snippet name="drilldown.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/drilldown.js
</h5>
<h5>controllers/drilldown.js</h5>
{{code-snippet name="drilldown.js"}}
</div>
22 changes: 9 additions & 13 deletions tests/dummy/app/templates/events.hbs
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
C3 Data Events
</h3>
<h3>C3 Data Events</h3>
{{/panel.header}}

{{#panel.content}}
<br>
<div class="text-center">
<p>
Mouseover:
{{hoverMsg}}
Mouseover: {{hoverMsg}}
</p>
<p>
Mouse Click:
{{message}}
Mouse Click: {{message}}
</p>
</div>
{{c3-chart data=data title=title padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<span class="pull-left text-primary">
Hover and click on pies to trigger events
</span>
</div>

<div class="mt-5">
<h5>
templates/events.hbs
</h5>
<h5>templates/events.hbs</h5>
{{code-snippet name="events.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/events.js
</h5>
<h5>controllers/events.js</h5>
{{code-snippet name="events.js"}}
</div>
18 changes: 8 additions & 10 deletions tests/dummy/app/templates/gauge.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Gauge Chart
</h3>
<h3>Gauge Chart</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart
data=data
Expand All @@ -16,20 +15,19 @@
}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "animate"}}>
Animate
</button>
</div>
</div

<div class="mt-5">
<h5>
templates/gauge.hbs
</h5>
<h5>templates/gauge.hbs</h5>
{{code-snippet name="gauge.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/gauge.js
</h5>
<h5>controllers/gauge.js</h5>
{{code-snippet name="gauge.js"}}
</div>
19 changes: 9 additions & 10 deletions tests/dummy/app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Combination Chart
</h3>
<h3>Combination Chart</h3>
{{/panel.header}}
{{#panel.content}}{{c3-chart data=model c3chart=chart}}{{/panel.content}}

{{#panel.content}}
{{c3-chart data=model c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="mt-5">
<h5>
templates/index.hbs
</h5>
<h5>templates/index.hbs</h5>
{{code-snippet name="index.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/index.js
</h5>
<h5>controllers/index.js</h5>
{{code-snippet name="index.js"}}
</div>
16 changes: 7 additions & 9 deletions tests/dummy/app/templates/no-data.hbs
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
No Data
</h3>
<h3>No Data</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart data=data title=title padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "animate"}}>
Add Data
</button>
</div>

<div class="mt-5">
<h5>
templates/no-data.hbs
</h5>
<h5>templates/no-data.hbs</h5>
{{code-snippet name="no-data.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/no-data.js
</h5>
<h5>controllers/no-data.js</h5>
{{code-snippet name="no-data.js"}}
</div>
16 changes: 7 additions & 9 deletions tests/dummy/app/templates/pie.hbs
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Pie Chart
</h3>
<h3>Pie Chart</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart data=data title=title padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "animate"}}>
Animate
</button>
</div>

<div class="mt-5">
<h5>
templates/pie.hbs
</h5>
<h5>templates/pie.hbs</h5>
{{code-snippet name="pie.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/pie.js
</h5>
<h5>controllers/pie.js</h5>
{{code-snippet name="pie.js"}}
</div>
16 changes: 7 additions & 9 deletions tests/dummy/app/templates/timeseries.hbs
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
{{#collapsable-panel as |panel|}}
{{#panel.header}}
<h3>
Timeseries
</h3>
<h3>Timeseries</h3>
{{/panel.header}}

{{#panel.content}}
{{c3-chart data=data axis=axis title=title padding=padding c3chart=chart}}
{{/panel.content}}
{{/collapsable-panel}}

<div class="container mt-2">
<button class="btn btn-sm btn-primary" onclick={{action "animate"}}>
Animate
</button>
</div>

<div class="mt-5">
<h5>
templates/timeseries.hbs
</h5>
<h5>templates/timeseries.hbs</h5>
{{code-snippet name="timeseries.hbs"}}
</div>

<div class="mt-5">
<h5>
controllers/timeseries.js
</h5>
<h5>controllers/timeseries.js</h5>
{{code-snippet name="timeseries.js"}}
</div>