Adds warnings

This commit is contained in:
Roman Galochkin 2020-03-03 09:21:59 +03:00
parent 8d875cc00d
commit a997ce8aad
2 changed files with 6 additions and 4 deletions

View File

@ -124,7 +124,6 @@ export class CdfChartD3 {
*/ */
getCommonThings() { getCommonThings() {
// Boundaries. // Boundaries.
// @todo: To fix code construction.
const xMin = this.attrs.scale === 'linear' ? const xMin = this.attrs.scale === 'linear' ?
(this.attrs.minX (this.attrs.minX
|| d3.min(this.attrs.data.continuous.xs) || d3.min(this.attrs.data.continuous.xs)
@ -139,6 +138,11 @@ export class CdfChartD3 {
const yMin = d3.min(this.attrs.data.continuous.ys); const yMin = d3.min(this.attrs.data.continuous.ys);
const yMax = d3.max(this.attrs.data.continuous.ys); const yMax = d3.max(this.attrs.data.continuous.ys);
if (!_.isFinite(xMin)) console.error('xMin is undefined');
if (!_.isFinite(xMax)) console.error('xMax is undefined');
if (!_.isFinite(yMin)) console.error('yMin is undefined');
if (!_.isFinite(yMax)) console.error('yMax is undefined');
// X-domains. // X-domains.
const yMaxDomainFactor = _.get(this.attrs, 'yMaxContinuousDomainFactor', 1); const yMaxDomainFactor = _.get(this.attrs, 'yMaxContinuousDomainFactor', 1);
const xMinDomain = xMin; const xMinDomain = xMin;
@ -215,8 +219,6 @@ export class CdfChartD3 {
// Y-axis. // Y-axis.
const yAxis = d3.axisRight(yScale); const yAxis = d3.axisRight(yScale);
// Objects.
// Add axis. // Add axis.
this.chart this.chart
.createObject({ tag: 'g', selector: 'x-axis' }) .createObject({ tag: 'g', selector: 'x-axis' })