Skip to content

Commit

Permalink
See #1. Add dependencies, more foundational work.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozenfire92 committed May 26, 2014
1 parent 465066c commit 46c9a7c
Show file tree
Hide file tree
Showing 17 changed files with 292 additions and 49 deletions.
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"smarttabs": true,
"white": true,
"globals": {
"EmberC3": true,
"jQuery": true,
"$": true,
"Ember": true,
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Generated on 2014-04-12 using generator-ember 0.8.3
'use strict';
var LIVERELOAD_PORT = 35729;
var LIVERELOAD_PORT = 35731;
var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT});
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
Expand Down Expand Up @@ -72,7 +72,7 @@ module.exports = function (grunt) {
},
connect: {
options: {
port: 9000,
port: 9002,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
Expand Down
17 changes: 12 additions & 5 deletions app/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>ember-c3</title>
<title>Ember C3</title>

<!-- build:css styles/main.css -->
<link rel="stylesheet" href="styles/style.css">
<!-- endbuild -->

<!-- build:css(build) styles/lib.css -->
<link rel="stylesheet" href="lib.css">
<!-- build:css(app) styles/components.css -->
<link rel="stylesheet" href="bower_components/c3/c3.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap-theme.min.css" type="text/css" media="screen" title="no title" charset="utf-8">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" type="text/css" media="screen" title="no title" charset="utf-8">
<!-- endbuild -->

</head>
</head>

<body>
<!-- build:js(app) scripts/components.js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/handlebars/handlebars.runtime.js"></script>
<script src="bower_components/d3/d3.min.js"></script>
<script src="bower_components/c3/c3.min.js"></script>
<script src="@@ember"></script>
<script src="@@ember_data"></script>
<!-- endbuild -->
Expand All @@ -33,5 +39,6 @@
<script src="scripts/combined-scripts.js"></script>
<!-- endbuild -->

</body>
</body>

</html>
2 changes: 1 addition & 1 deletion app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var App = window.App = Ember.Application.create();
var EmberC3 = window.EmberC3 = Ember.Application.create();

/* Order and include as you please. */
require('scripts/controllers/*');
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/index_controller.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
App.IndexController = Ember.ArrayController.extend({
EmberC3.IndexController = Ember.ArrayController.extend({

});
2 changes: 1 addition & 1 deletion app/scripts/router.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
App.Router.map(function () {
EmberC3.Router.map(function () {
// Add your routes here
});
2 changes: 1 addition & 1 deletion app/scripts/routes/index_route.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
App.IndexRoute = Ember.Route.extend({
EmberC3.IndexRoute = Ember.Route.extend({
model: function () {
return ['red', 'yellow', 'blue'];
}
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/store.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
App.ApplicationAdapter = DS.FixtureAdapter;
EmberC3.ApplicationAdapter = DS.FixtureAdapter;
9 changes: 2 additions & 7 deletions app/styles/style.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
// SASS!

.well {
background-color: gray;
border-radius: 5px;

li {
padding: 5px;
}
html, body {
margin: 50px 0px;
}
24 changes: 24 additions & 0 deletions app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Ember C3</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/Glavin001/ember-c3">Source</a></li>
<li><a href="https://github.com/Glavin001/ember-c3/issues">Issues/Suggestions</a></li>
</ul>
<div class="collapse navbar-collapse navbar-ex1-collapse">
</div>
</nav>

<div class="container" id="main">
{{outlet}}
</div>

</div>
24 changes: 17 additions & 7 deletions app/templates/index.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
<div class="">
<h1 class="">Welcome to ember-c3</h1>

<ul class="well">
{{#each color in model}}
<li style="color: {{color}}">
{{color}}
</li>
{{/each}}
</ul>
<button class="form-control" {{action "refresh"}}>Reload with random data</button>

<h2>Donut</h2>
{{!-- c3-donut data= --}}

<h2>Area Spline</h2>
{{!-- c3-area-spline data= --}}

<h2>Timeseries</h2>
{{!-- c3-timeseries data= --}}

<h2>Bar Chart</h2>
{{!-- c3-bar-chart data= --}}

<h2>Line Chart</h2>
{{!-- c3-line-chart data= --}}

</div>
7 changes: 4 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "ember-c3",
"version": "0.0.0",
"dependencies": {},
"dependencies": {
"ember": "^1.3.2",
"handlebars": "^1.2.1",
"ember-data": "^1.0.0-beta.5"
"ember-data": "^1.0.0-beta.5",
"c3": "~0.1.42"
},
"devDependencies": {
"ember-mocha-adapter": "0.1.2"
"ember-mocha-adapter": "0.1.2",
"bootstrap": "~3.1.1"
},
"main": "build/ember-plugin.js"
}
116 changes: 112 additions & 4 deletions build/lib.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,124 @@
(function() {

Ember.emberC3 = Ember.Namespace.create();
Ember.emberC3.VERSION = '0.0.0';
Ember.C3 = Ember.Namespace.create();
Ember.C3.VERSION = '0.0.0';

Ember.libraries.register('ember-c3', Ember.emberC3.VERSION);
Ember.libraries.register('ember-c3', Ember.C3.VERSION);


})();

(function() {

/* Order and include as you please. */
'use strict';
/**
C3 Chart component
*/
Ember.C3.ChartComponent = Ember.Component.extend({
/**
Element tag name
*/
tagName: 'div',

/**
Element classes
*/
classNames: [],

/**
The element to bind the chart to
*/
bindTo: null,

/**
The data to display
*/
data: {},

/**
Axis specifications
*/
axis: {},

/**
Region specifications
*/
regions: {},

/**
Type of chart
*/
type: null,
bar: {},
pie: {},
donut: {},

/**
Grid lines
*/
grid:{},

/**
Legend
*/
legend: {},

/**
Tooltip
*/
tooltip: {}

/**
Subchart
*/
subchart: {},

/**
Zoom
*/
zoom: {},

/**
Size
*/
size: {},

/**
Padding
*/
padding: {},

/**
Color
*/
color: {},


/**
Transition
*/
transition: {},

/**
The Chart
*/
chart: function() {
var self = this;
var chart = c3.generate({

});
},

/**
Data Observer
*/
dataDidChange: function() {

}.observes('data')

});

Ember.Handlebars.helper('c3-chart', Ember.C3.ChartComponent);


})();
Loading

0 comments on commit 46c9a7c

Please sign in to comment.