Ok, works
This commit is contained in:
parent
dc8831def0
commit
3dce5045aa
|
@ -120,7 +120,7 @@ export class CdfChartD3 {
|
||||||
* @param key
|
* @param key
|
||||||
* @returns {[]}
|
* @returns {[]}
|
||||||
*/
|
*/
|
||||||
getDatapoints(key) {
|
getDataPoints(key) {
|
||||||
const dt = [];
|
const dt = [];
|
||||||
const data = this.attrs.data[key];
|
const data = this.attrs.data[key];
|
||||||
const len = data.xs.length;
|
const len = data.xs.length;
|
||||||
|
@ -135,7 +135,10 @@ export class CdfChartD3 {
|
||||||
render() {
|
render() {
|
||||||
const attrs = this.attrs;
|
const attrs = this.attrs;
|
||||||
const container = d3.select(attrs.container);
|
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.
|
// Sets the width from the DOM element.
|
||||||
const containerRect = container.node().getBoundingClientRect();
|
const containerRect = container.node().getBoundingClientRect();
|
||||||
|
@ -151,7 +154,7 @@ export class CdfChartD3 {
|
||||||
calc.chartHeight = attrs.svgHeight - attrs.marginBottom - attrs.marginTop;
|
calc.chartHeight = attrs.svgHeight - attrs.marginBottom - attrs.marginTop;
|
||||||
|
|
||||||
const areaColorRange = d3.scaleOrdinal().range(attrs.areaColors);
|
const areaColorRange = d3.scaleOrdinal().range(attrs.areaColors);
|
||||||
this.dataPoints = [this.getDatapoints('primary')];
|
this.dataPoints = [this.getDataPoints('primary')];
|
||||||
|
|
||||||
// Scales.
|
// Scales.
|
||||||
const xMin = d3.min(attrs.data.primary.xs);
|
const xMin = d3.min(attrs.data.primary.xs);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user