New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-cli-chartist

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-chartist - npm Package Compare versions

Comparing version 0.2.8 to 0.2.9

blueprints/ember-cli-chartist/index.js

316

dist/assets/dummy.js

@@ -1,3 +0,7 @@

define('dummy/app', ['exports', 'ember', 'ember/resolver', 'ember/load-initializers', './config/environment'], function (exports, Ember, Resolver, loadInitializers, config) {
/* jshint ignore:start */
/* jshint ignore:end */
define('dummy/app', ['exports', 'ember', 'ember/resolver', 'ember/load-initializers', 'dummy/config/environment'], function (exports, Ember, Resolver, loadInitializers, config) {
'use strict';

@@ -18,3 +22,3 @@

});
define('dummy/components/chart-fish-over-time', ['exports', 'ember', './chartist-chart'], function (exports, Ember, ChartistChart) {
define('dummy/components/chart-fish-over-time', ['exports', 'ember', 'dummy/components/chartist-chart'], function (exports, Ember, ChartistChart) {

@@ -28,6 +32,6 @@ 'use strict';

labels: [
'Salmon', 'Yellowtail', 'Dolphin', 'Cow'
"Salmon", "Yellowtail", "Dolphin", "Cow"
],
series: [
['2', '8', '3', '9']
["2", "8", "3", "9"]
]

@@ -42,3 +46,3 @@ });

getData().then(function (data) {
this.set('data', data);
this.set("data", data);
}.bind(this));

@@ -52,14 +56,14 @@

labels: [
'Salmon', 'Yellowtail', 'Dolphin', 'Cow'
"Salmon", "Yellowtail", "Dolphin", "Cow"
],
series: [
['22', '18', '0', '19']
["22", "18", "0", "19"]
]
};
this.set('data', newData);
this.set("data", newData);
}.bind(this), 4000);
},
ratio: 'ct-minor-seventh',
ratio: "ct-minor-seventh",
options: {

@@ -78,3 +82,3 @@ showPoint: false,

responsiveOptions: [
['screen and (min-width: 640px)', {
["screen and (min-width: 640px)", {
showPoint: true,

@@ -94,5 +98,3 @@ axisY: {

var UNDEF,
// This is the structure that chartist is expecting
defaultDataStructure = {labels: [], series: []};
var UNDEF;

@@ -102,5 +104,9 @@ exports['default'] = Ember['default'].Component.extend({

classNameBindings: ['ratio'],
classNames: ['ct-chart'],
// This is the structure that chartist is expecting, it can be overidden in
// your components which extend this one.
defaultDataStructure: { labels: [], series: [[0]] },
classNameBindings: ["ratio"],
classNames: ["ct-chart"],
// The ratio of the chart as it scales up/down in size.

@@ -128,32 +134,36 @@ //

// ct-double-octave 1:4
ratio: 'ct-square',
ratio: "ct-square",
type: 'line',
type: "line",
chartType: function () {
return this.get('type').capitalize();
}.property('type'),
return this.get("type").capitalize();
}.property("type"),
data: defaultDataStructure,
data: null,
options: UNDEF,
responsiveOptions: UNDEF,
updateOnData: true,
// This is where the business happens. This will only run if checkForReqs
// doesn't find any problems.
renderChart: function () {
var chart = new (Chartist[this.get('chartType')])(
this.get('element'),
this.get('data'),
this.get('options'),
this.get('responsiveOptions')
var data = this.get("data") || this.get("defaultDataStructure");
var chart = new (Chartist[this.get("chartType")])(
this.get("element"),
data,
this.get("options"),
this.get("responsiveOptions")
);
this.set("chart", chart);
}.on("didInsertElement"),
this.set('chart', chart);
}.on('didInsertElement'),
onData: function () {
if (this.get('updateOnData')) {
this.get('chart').update(this.get('data'));
if (this.get("updateOnData")) {
var opts = this.get("options") || {};
this.get("chart").update(
this.get("data"),
opts
);
}
}.observes('data'),
}.observes("data"),

@@ -168,19 +178,19 @@ // Before trying to do anything else, let's check to see if any necessary

checkForReqs: function () {
var data = this.get('data'),
type = this.get('type');
var data = this.get("data"),
type = this.get("type");
if (typeof data === 'string') {
console.info('Chartist-chart: The value of the "data" attribute on should be an object, it\'s a string.');
this.set('data', defaultDataStructure);
if (typeof data === "string") {
console.info("Chartist-chart: The value of the \"data\" attribute on should be an object, it's a string.");
this.set("data", defaultDataStructure);
}
if (!type || !Chartist[this.get('chartType')]) {
console.info('Chartist-chart: Invalid or missing "type" attribute, defaulting to "line".');
this.set('type', 'line');
if (!type || !Chartist[this.get("chartType")]) {
console.info("Chartist-chart: Invalid or missing \"type\" attribute, defaulting to \"line\".");
this.set("type", "line");
}
}.on('init')
}.on("init")
});
});
define('dummy/components/pie-i-like', ['exports', './chartist-chart'], function (exports, ChartistChart) {
define('dummy/components/pie-i-like', ['exports', 'dummy/components/chartist-chart'], function (exports, ChartistChart) {

@@ -190,5 +200,5 @@ 'use strict';

exports['default'] = ChartistChart['default'].extend({
type: 'pie',
type: "pie",
data: {
labels: ['Chocolate', 'Apple', 'Pumpkin'],
labels: ["Chocolate", "Apple", "Pumpkin"],
series: [30, 15, 65]

@@ -205,3 +215,3 @@ }

chartResOptions: [
['screen and (min-width: 640px)', {
["screen and (min-width: 640px)", {
showArea: true,

@@ -218,3 +228,3 @@ lineSmooth: false,

});
define('dummy/initializers/export-application-global', ['exports', 'ember', '../config/environment'], function (exports, Ember, config) {
define('dummy/initializers/export-application-global', ['exports', 'ember', 'dummy/config/environment'], function (exports, Ember, config) {

@@ -228,3 +238,3 @@ 'use strict';

if (config['default'].exportApplicationGlobal) {
if (config['default'].exportApplicationGlobal && !window[classifiedName]) {
window[classifiedName] = application;

@@ -235,3 +245,3 @@ }

exports['default'] = {
name: 'export-application-global',
name: "export-application-global",

@@ -242,3 +252,3 @@ initialize: initialize

});
define('dummy/router', ['exports', 'ember', './config/environment'], function (exports, Ember, config) {
define('dummy/router', ['exports', 'ember', 'dummy/config/environment'], function (exports, Ember, config) {

@@ -265,3 +275,3 @@ 'use strict';

chartData: {
labels: ['Week1', 'Week2', 'Week3', 'Week4', 'Week5', 'Week6'],
labels: ["Week1", "Week2", "Week3", "Week4", "Week5", "Week6"],
series: [

@@ -380,60 +390,30 @@ [5, 4, 3, 7, 5, 10],

});
define('dummy/tests/dummy/tests/helpers/resolver.jshint', function () {
define('dummy/tests/helpers/resolver', ['exports', 'ember/resolver', 'dummy/config/environment'], function (exports, Resolver, config) {
'use strict';
module('JSHint - dummy/tests/helpers');
test('dummy/tests/helpers/resolver.js should pass jshint', function() {
ok(true, 'dummy/tests/helpers/resolver.js should pass jshint.');
});
var resolver = Resolver['default'].create();
});
define('dummy/tests/dummy/tests/helpers/start-app.jshint', function () {
resolver.namespace = {
modulePrefix: config['default'].modulePrefix,
podModulePrefix: config['default'].podModulePrefix
};
'use strict';
exports['default'] = resolver;
module('JSHint - dummy/tests/helpers');
test('dummy/tests/helpers/start-app.js should pass jshint', function() {
ok(true, 'dummy/tests/helpers/start-app.js should pass jshint.');
});
});
define('dummy/tests/dummy/tests/test-helper.jshint', function () {
define('dummy/tests/helpers/resolver.jshint', function () {
'use strict';
module('JSHint - dummy/tests');
test('dummy/tests/test-helper.js should pass jshint', function() {
ok(true, 'dummy/tests/test-helper.js should pass jshint.');
module('JSHint - helpers');
test('helpers/resolver.js should pass jshint', function() {
ok(true, 'helpers/resolver.js should pass jshint.');
});
});
define('dummy/tests/dummy/tests/unit/components/chartist-chart-test.jshint', function () {
define('dummy/tests/helpers/start-app', ['exports', 'ember', 'dummy/app', 'dummy/router', 'dummy/config/environment'], function (exports, Ember, Application, Router, config) {
'use strict';
module('JSHint - dummy/tests/unit/components');
test('dummy/tests/unit/components/chartist-chart-test.js should pass jshint', function() {
ok(true, 'dummy/tests/unit/components/chartist-chart-test.js should pass jshint.');
});
});
define('dummy/tests/helpers/resolver', ['exports', 'ember/resolver', '../../config/environment'], function (exports, Resolver, config) {
'use strict';
var resolver = Resolver['default'].create();
resolver.namespace = {
modulePrefix: config['default'].modulePrefix,
podModulePrefix: config['default'].podModulePrefix
};
exports['default'] = resolver;
});
define('dummy/tests/helpers/start-app', ['exports', 'ember', '../../app', '../../router', '../../config/environment'], function (exports, Ember, Application, Router, config) {
'use strict';
function startApp(attrs) {

@@ -456,2 +436,12 @@ var application;

});
define('dummy/tests/helpers/start-app.jshint', function () {
'use strict';
module('JSHint - helpers');
test('helpers/start-app.js should pass jshint', function() {
ok(true, 'helpers/start-app.js should pass jshint.');
});
});
define('dummy/tests/router.jshint', function () {

@@ -477,3 +467,3 @@

});
define('dummy/tests/test-helper', ['./helpers/resolver', 'ember-qunit'], function (resolver, ember_qunit) {
define('dummy/tests/test-helper', ['dummy/tests/helpers/resolver', 'ember-qunit'], function (resolver, ember_qunit) {

@@ -484,9 +474,44 @@ 'use strict';

document.write('<div id="ember-testing-container"><div id="ember-testing"></div></div>');
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
var containerVisibility = QUnit.urlParams.nocontainer ? 'hidden' : 'visible';
document.getElementById('ember-testing-container').style.visibility = containerVisibility;
// This is to save PhantomJS from itself, because PhantomJS < 2.0 doesn't have
// Function.prototype.bind for _reasons_
if (!Function.prototype.bind) {
Function.prototype.bind = function(oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
FNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof FNOP && oThis? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
};
FNOP.prototype = this.prototype;
fBound.prototype = new FNOP();
return fBound;
};
}
document.write("<div id=\"ember-testing-container\"><div id=\"ember-testing\"></div></div>");
QUnit.config.urlConfig.push({ id: "nocontainer", label: "Hide container"});
var containerVisibility = QUnit.urlParams.nocontainer ? "hidden" : "visible";
document.getElementById("ember-testing-container").style.visibility = containerVisibility;
});
define('dummy/tests/test-helper.jshint', function () {
'use strict';
module('JSHint - .');
test('test-helper.js should pass jshint', function() {
ok(true, 'test-helper.js should pass jshint.');
});
});
define('dummy/tests/unit/components/chartist-chart-test', ['ember-qunit'], function (ember_qunit) {

@@ -498,6 +523,6 @@

ember_qunit.moduleForComponent('chartist-chart', 'ChartistChartComponent', {});
ember_qunit.moduleForComponent("chartist-chart", "ChartistChartComponent", {});
var chartData = {
labels: ['Week1', 'Week2', 'Week3', 'Week4', 'Week5', 'Week6'],
labels: ["Week1", "Week2", "Week3", "Week4", "Week5", "Week6"],
series: [

@@ -510,3 +535,3 @@ [5, 4, 3, 7, 5, 10],

pieChartData = {
labels: ['Pizza', 'Fish', 'Puppies'],
labels: ["Pizza", "Fish", "Puppies"],
series: [

@@ -517,3 +542,3 @@ [40, 25, 25]

ember_qunit.test('it renders', function() {
ember_qunit.test("it renders", function() {
expect(2);

@@ -525,9 +550,9 @@

equal(component._state, 'preRender');
equal(component._state, "preRender");
this.append();
equal(component._state, 'inDOM');
equal(component._state, "inDOM");
});
ember_qunit.test('it should not error when the data property or attribute is not provided', function() {
ember_qunit.test("it should not error when the data property or attribute is not provided", function() {
expect(1);

@@ -538,6 +563,6 @@

this.append();
equal(component._state, 'inDOM');
equal(component._state, "inDOM");
});
ember_qunit.test('it can be a line chart', function() {
ember_qunit.test("it can be a line chart", function() {
expect(1);

@@ -549,10 +574,10 @@

component.set('type', 'line');
component.set("type", "line");
this.append();
var chart = component.get('chart');
equal(chart.options.classNames.chart, 'ct-chart-line');
var chart = component.get("chart");
equal(chart.options.classNames.chart, "ct-chart-line");
});
ember_qunit.test('it can be a bar chart', function() {
ember_qunit.test("it can be a bar chart", function() {
expect(1);

@@ -564,10 +589,10 @@

component.set('type', 'bar');
component.set("type", "bar");
this.append();
var chart = component.get('chart');
equal(chart.options.classNames.chart, 'ct-chart-bar');
var chart = component.get("chart");
equal(chart.options.classNames.chart, "ct-chart-bar");
});
ember_qunit.test('it can be a pie chart', function() {
ember_qunit.test("it can be a pie chart", function() {
expect(1);

@@ -579,10 +604,11 @@

component.set('type', 'pie');
component.set("type", "pie");
this.append();
var chart = component.get('chart');
equal(chart.options.classNames.chart, 'ct-chart-pie');
// NOTE: This is a real garbage test.
var chart = component.get("chart");
equal(component.get("type"), "pie");
});
ember_qunit.test('it can have different ratios', function () {
ember_qunit.test("it can have different ratios", function () {
expect(1);

@@ -594,8 +620,8 @@

var ratio = 'ct-minor-second';
component.set('ratio', ratio);
var ratio = "ct-minor-second";
component.set("ratio", ratio);
ok(this.$().hasClass(ratio));
});
ember_qunit.test('it can be configured with the options attribute', function () {
ember_qunit.test("it can be configured with the options attribute", function () {
expect(4);

@@ -607,3 +633,3 @@

component.set('options', {
component.set("options", {
showArea: false,

@@ -621,3 +647,3 @@ lineSmooth: false,

var chart = component.get('chart');
var chart = component.get("chart");
var opts = chart.options;

@@ -631,3 +657,3 @@

ember_qunit.test('it can be configured with the responsiveOptions attribute', function () {
ember_qunit.test("it can be configured with the responsiveOptions attribute", function () {
expect(3);

@@ -639,4 +665,4 @@

component.set('responsiveOptions', [
['screen and (min-width: 640px)', {
component.set("responsiveOptions", [
["screen and (min-width: 640px)", {
showArea: true,

@@ -653,3 +679,3 @@ lineSmooth: false,

var chart = component.get('chart');
var chart = component.get("chart");
var resOpts = chart.responsiveOptions;

@@ -662,3 +688,3 @@

ember_qunit.test('it should update the chart when data is changed', function () {
ember_qunit.test("it should update the chart when data is changed", function () {
expect(2);

@@ -673,3 +699,3 @@

var newData = {
labels: ['Week1', 'Week2', 'Week3', 'Week4', 'Week5', 'Week6'],
labels: ["Week1", "Week2", "Week3", "Week4", "Week5", "Week6"],
series: [

@@ -680,3 +706,3 @@ [8, 10, 31, 17, 25, 11]

component.set('type', 'line');
component.set("type", "line");
this.append();

@@ -688,3 +714,3 @@

// when the data updates.
component.get('chart').on('created', function () {
component.get("chart").on("created", function () {
createdEventWasCalled++;

@@ -698,5 +724,5 @@ });

component.set('data', newData);
component.set("data", newData);
equal(component.get('data'), newData);
equal(component.get("data"), newData);
equal(createdEventWasCalled, 2);

@@ -706,3 +732,3 @@ }, 1000);

ember_qunit.test('it should not automatically update when updateOnData is false', function () {
ember_qunit.test("it should not automatically update when updateOnData is false", function () {
expect(1);

@@ -717,3 +743,3 @@

var newData = {
labels: ['Week1', 'Week2', 'Week3', 'Week4', 'Week5', 'Week6'],
labels: ["Week1", "Week2", "Week3", "Week4", "Week5", "Week6"],
series: [

@@ -724,6 +750,6 @@ [8, 10, 31, 17, 25, 11]

component.set('updateOnData', false);
component.set("updateOnData", false);
this.append();
component.get('chart').on('created', function () {
component.get("chart").on("created", function () {
createdEventWasCalled++;

@@ -736,3 +762,3 @@ });

start();
component.set('data', newData);
component.set("data", newData);
equal(createdEventWasCalled, 1);

@@ -743,4 +769,18 @@ }, 500);

});
define('dummy/tests/unit/components/chartist-chart-test.jshint', function () {
'use strict';
module('JSHint - unit/components');
test('unit/components/chartist-chart-test.js should pass jshint', function() {
ok(true, 'unit/components/chartist-chart-test.js should pass jshint.');
});
});
/* jshint ignore:start */
/* jshint ignore:end */
/* jshint ignore:start */
define('dummy/config/environment', ['ember'], function(Ember) {

@@ -747,0 +787,0 @@ var prefix = 'dummy';

/* globals requirejs, require */
(function() {
define("ember-cli/test-loader",
[],
function() {
"use strict";
var moduleName, shouldLoad;
var TestLoader = function() {
};
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
TestLoader.prototype = {
shouldLoadModule: function(moduleName) {
return (moduleName.match(/[-_]test$/));
},
// TODO: load based on params
for (moduleName in requirejs.entries) {
shouldLoad = false;
loadModules: function() {
var moduleName;
if (moduleName.match(/[-_]test$/)) { shouldLoad = true; }
if (!QUnit.urlParams.nojshint && moduleName.match(/\.jshint$/)) { shouldLoad = true; }
for (moduleName in requirejs.entries) {
if (this.shouldLoadModule(moduleName)) {
this.require(moduleName);
}
}
}
};
if (shouldLoad) { require(moduleName); }
}
TestLoader.prototype.require = function(moduleName) {
try {
require(moduleName);
} catch(e) {
this.moduleLoadFailure(moduleName, e);
}
};
if (QUnit.notifications) {
QUnit.notifications({
icons: {
passed: '/assets/passed.png',
failed: '/assets/failed.png'
TestLoader.prototype.moduleLoadFailure = function(moduleName, error) {
console.error('Error loading: ' + moduleName, error.stack);
};
TestLoader.load = function() {
new TestLoader().loadModules();
};
return {
'default': TestLoader
}
});
}
}
);
})();
/* jshint node: true */
'use strict';
var path = require('path'),
path_join = function () {
// fix path with windows back slash with path_join
return path.join.apply(this, arguments).replace(/\\/g, '/');
};
var path = require('path');

@@ -17,4 +13,3 @@ module.exports = {

var options = app.options['ember-cli-chartist'] || {},
modulePath = path.relative(app.project.root, __dirname),
chartistPath = 'vendor/chartist';
chartistPath = path.join(app.bowerDirectory, 'chartist', 'dist');

@@ -25,13 +20,13 @@ if (options.useCustomCSS) {

app.options.sassOptions.includePaths.push(path_join(modulePath,
app.options.sassOptions.includePaths.push(path.join(
chartistPath, 'scss'));
app.options.sassOptions.includePaths.push(path_join(modulePath,
chartistPath, 'scss/settings'));
app.options.sassOptions.includePaths.push(path.join(
chartistPath, 'scss', 'settings'));
} else {
app.import('vendor/chartist/chartist.css');
app.import(path.join(chartistPath, 'chartist.min.css'));
}
app.import('vendor/chartist/chartist.js');
app.import(path.join(chartistPath, 'chartist.js'));
}
};
{
"name": "ember-cli-chartist",
"version": "0.2.8",
"version": "0.2.9",
"description": "Ember Addon for Chartist.js",

@@ -5,0 +5,0 @@ "directories": {

@@ -8,2 +8,4 @@ # Chartist.js for Ember-CLI Projects

[Chartist version in use](https://github.com/tylergaw/ember-cli-chartist/blob/master/blueprints/ember-cli-chartist/index.js#L6).
## Setup

@@ -10,0 +12,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc