From 3dce5045aabb224d61e136d81dcf0a9dc348c38e Mon Sep 17 00:00:00 2001 From: Roman Galochkin Date: Wed, 19 Feb 2020 11:42:54 +0300 Subject: [PATCH] Ok, works --- src/components/charts/cdfChartD3.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/charts/cdfChartD3.js b/src/components/charts/cdfChartD3.js index 2e0e5db3..b2f8852f 100644 --- a/src/components/charts/cdfChartD3.js +++ b/src/components/charts/cdfChartD3.js @@ -120,7 +120,7 @@ export class CdfChartD3 { * @param key * @returns {[]} */ - getDatapoints(key) { + getDataPoints(key) { const dt = []; const data = this.attrs.data[key]; const len = data.xs.length; @@ -135,7 +135,10 @@ export class CdfChartD3 { render() { const attrs = this.attrs; const container = d3.select(attrs.container); - if (container.node() === null) return; + if (container.node() === null) { + console.error('Container for D3 is not defined.'); + return; + } // Sets the width from the DOM element. const containerRect = container.node().getBoundingClientRect(); @@ -151,7 +154,7 @@ export class CdfChartD3 { calc.chartHeight = attrs.svgHeight - attrs.marginBottom - attrs.marginTop; const areaColorRange = d3.scaleOrdinal().range(attrs.areaColors); - this.dataPoints = [this.getDatapoints('primary')]; + this.dataPoints = [this.getDataPoints('primary')]; // Scales. const xMin = d3.min(attrs.data.primary.xs);