Skip to content

Commit

Permalink
fix #261
Browse files Browse the repository at this point in the history
  • Loading branch information
samussiah committed Dec 13, 2019
1 parent 3437ef6 commit f7037ad
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 21 deletions.
7 changes: 4 additions & 3 deletions build/webcharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
this.initial_data = data;

var startup = function startup(data) {
//connect this chart and its controls, if any
// connect this chart and its controls, if any
if (_this.controls) {
_this.controls.targets.push(_this);

Expand All @@ -48,7 +48,7 @@
} else {
_this.controls.layout();
}
} //make sure container is visible (has height and width) before trying to initialize
} // make sure container is visible (has height and width) before trying to initialize

var visible = d3.select(_this.div).property('offsetWidth') > 0 || test;

Expand Down Expand Up @@ -120,7 +120,7 @@
requiredCols.push(e.split);
}

if (e.values) {
if (e.values && e.checkColumns) {
for (var value in e.values) {
requiredVars.push('this.config.marks[' + i + "].values['" + value + "']");
requiredCols.push(value);
Expand Down Expand Up @@ -600,6 +600,7 @@
this.config.marks && this.config.marks.length ? this.config.marks : [{}];
this.config.marks.forEach(function(m, i) {
m.id = m.id ? m.id : 'mark' + (i + 1);
m.checkColumns = m.checkColumns !== false ? true : false;
});
this.config.date_format = this.config.date_format || '%x';
this.config.padding = this.config.padding !== undefined ? this.config.padding : 0.3;
Expand Down
6 changes: 3 additions & 3 deletions build/webcharts.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/chart/draw/consolidateData/setDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default function setDefaults() {
this.config.marks = this.config.marks && this.config.marks.length ? this.config.marks : [{}];
this.config.marks.forEach(function(m, i) {
m.id = m.id ? m.id : 'mark' + (i + 1);
m.checkColumns = m.checkColumns !== false ? true : false;
});

this.config.date_format = this.config.date_format || '%x';
Expand Down
4 changes: 2 additions & 2 deletions src/chart/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function init(data, test = false) {
this.initial_data = data;

let startup = data => {
//connect this chart and its controls, if any
// connect this chart and its controls, if any
if (this.controls) {
this.controls.targets.push(this);
if (!this.controls.ready) {
Expand All @@ -36,7 +36,7 @@ export default function init(data, test = false) {
}
}

//make sure container is visible (has height and width) before trying to initialize
// make sure container is visible (has height and width) before trying to initialize
var visible = select(this.div).property('offsetWidth') > 0 || test;
if (!visible) {
console.warn(
Expand Down
2 changes: 1 addition & 1 deletion src/chart/init/checkRequired.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function checkRequired(data) {
requiredVars.push('this.config.marks[' + i + '].split');
requiredCols.push(e.split);
}
if (e.values) {
if (e.values && e.checkColumns) {
for (const value in e.values) {
requiredVars.push('this.config.marks[' + i + "].values['" + value + "']");
requiredCols.push(value);
Expand Down
12 changes: 0 additions & 12 deletions test-page/createChart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ const controls = new webCharts.createControls(
value_col: 'species',
label: 'Species',
},
//{
// type: 'radio',
// option: 'x.domain.0',
// label: 'X-domain Lower Limit',
// values: ['minimum',0],
//},
//{
// type: 'radio',
// option: 'y.domain.0',
// label: 'Y-domain Lower Limit',
// values: ['minimum',0],
//},
{
type: 'number',
option: 'x.domain.0',
Expand Down

0 comments on commit f7037ad

Please sign in to comment.