Skip to content

Commit

Permalink
solves the 'use strict' issues in speced#184.
Browse files Browse the repository at this point in the history
  • Loading branch information
hamilton committed Nov 20, 2014
1 parent 51de308 commit 42fd2e7
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 7 deletions.
5 changes: 2 additions & 3 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

$(document).ready(function() {
'use strict';
//json data that we intend to update later on via on-screen controls
var split_by_data;

Expand Down Expand Up @@ -30,7 +29,6 @@ $(document).ready(function() {
//few observations
d3.json('data/missing-y.json', function(data) {
data = convert_dates(data, 'date');

//add a line chart that has a few observations
data_graphic({
title: "Few Observations",
Expand Down Expand Up @@ -392,6 +390,7 @@ $(document).ready(function() {
title: "Glorious Graphic",
error: 'This data is blocked by Lorem Ipsum. Get your stuff together, Ipsum.',
chart_type: 'missing-data',
missing_text: 'This is an example of a missing chart',
description: "This is an example of a graphic whose data is currently missing. We've also set the <i>error</i> option, which appends an error icon to the title and logs an error to the browser's console.",
target: '#glorious_chart',
width: torso.width,
Expand Down
1 change: 1 addition & 0 deletions src/charts/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// - need a way of changing the y axis and x axis
// - need to sort out rollovers
charts.bar = function(args) {
'use strict';
this.args = args;

this.init = function(args) {
Expand Down
1 change: 1 addition & 0 deletions src/charts/histogram.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
charts.histogram = function(args) {
'use strict';
this.args = args;

this.init = function(args) {
Expand Down
1 change: 1 addition & 0 deletions src/charts/line.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
charts.line = function(args) {
'use strict';
this.args = args;

this.init = function(args) {
Expand Down
1 change: 1 addition & 0 deletions src/charts/missing.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
charts.missing = function(args) {
'use strict';
this.args = args;

this.init = function(args) {
Expand Down
1 change: 1 addition & 0 deletions src/charts/point.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
charts.point = function(args) {
'use strict';
this.args = args;

this.init = function(args) {
Expand Down
1 change: 1 addition & 0 deletions src/charts/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var table = New data_table(data)
*/

function data_table(args){
'use strict';
this.args = args;
this.args.standard_col = {width:150, font_size:12};
this.args.columns = [];
Expand Down
1 change: 1 addition & 0 deletions src/common/chart_title.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function chart_title(args) {
//is chart title different than existing, if so, clear the fine
//gentleman, otherwise, move along
'use strict';
var currentTitle = $(args.target).find('h2.chart_title');
if(args.title && args.title !== currentTitle.text())
currentTitle.remove();
Expand Down
3 changes: 2 additions & 1 deletion src/common/data_graphic.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
'use strict';


var charts = {};
var globals = {};
globals.link = false;
globals.version = "1.0";

function data_graphic() {
'use strict';
var moz = {};
moz.defaults = {};
moz.defaults.all = {
Expand Down
1 change: 1 addition & 0 deletions src/common/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function init(args) {
'use strict';
var defaults = {
target: null,
title: null,
Expand Down
1 change: 1 addition & 0 deletions src/common/markers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function markers(args) {
'use strict';
var svg = d3.select($(args.target).find('svg').get(0));
var gm;
var gb;
Expand Down
3 changes: 2 additions & 1 deletion src/common/x_axis.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function x_rug(args) {

'use strict';
var buffer_size = args.chart_type =='point'
? args.buffer / 2
: args.buffer;
Expand Down Expand Up @@ -30,6 +30,7 @@ function x_rug(args) {
}

function x_axis(args) {
'use strict';
var svg = d3.select($(args.target).find('svg').get(0));
var g;
var min_x;
Expand Down
1 change: 1 addition & 0 deletions src/common/y_axis.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function y_rug(args) {
'use strict';
var svg = d3.select($(args.target).find('svg').get(0));
var buffer_size = args.chart_type == 'point'
? args.buffer / 2
Expand Down
1 change: 1 addition & 0 deletions src/layout/button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var button_layout = function(target) {
'use strict';
this.target = target;
this.feature_set = {};
this.public_name = {};
Expand Down
7 changes: 5 additions & 2 deletions src/misc/process.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
function raw_data_transformation(args){
'use strict';
//do we need to turn json data to 2d array?

if(!$.isArray(args.data[0]))
Expand Down Expand Up @@ -37,6 +38,7 @@ function raw_data_transformation(args){
}

function process_line(args) {
'use strict';
//are we replacing missing y values with zeros?

//do we have a time-series?
Expand Down Expand Up @@ -103,6 +105,7 @@ function process_line(args) {
}

function process_histogram(args){
'use strict';
// if args.binned=False, then we need to bin the data appropriately.
// if args.binned=True, then we need to make sure to compute the relevant computed data.
// the outcome of either of these should be something in args.computed_data.
Expand Down Expand Up @@ -170,7 +173,7 @@ function process_histogram(args){

function process_categorical_variables(args){
// For use with bar charts, etc.

'use strict';
var extracted_data, processed_data={}, pd=[];
var our_data = args.data[0];
args.categorical_variables = [];
Expand Down Expand Up @@ -212,7 +215,7 @@ function process_categorical_variables(args){
}

function process_point(args){

'use strict';
var data = args.data[0];
var x = data.map(function(d){return d[args.x_accessor]});
var y = data.map(function(d){return d[args.y_accessor]});
Expand Down

0 comments on commit 42fd2e7

Please sign in to comment.