Skip to content

Commit

Permalink
HOTFIX: add condition to render
Browse files Browse the repository at this point in the history
  • Loading branch information
FarajiA committed May 4, 2021
1 parent 763f1e7 commit 1542d6e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/graphengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FindInfo } from "./helpers/supportedInfo";
export class GraphEngine extends HTMLElement {
constructor() {
super();

}

/**
Expand All @@ -19,7 +19,7 @@ export class GraphEngine extends HTMLElement {
* Call back for when the component is attached to the DOM
*/
connectedCallback() {

this.defaults = {};
var defaults = new Defaults();

Expand All @@ -39,7 +39,7 @@ export class GraphEngine extends HTMLElement {
* @param {string} data this param is collected from the data-graph attribute
*/
render () {
if (this.defaults) {
if (this.defaults && this.graphData) {
this.innerHTML = "<line-graph data-margin=" + JSON.stringify(this.defaults.margin) +
" data-height=" + this.defaults.height +
" data-width=" + this.defaults.width +
Expand All @@ -58,7 +58,6 @@ export class GraphEngine extends HTMLElement {
* @param {string} data This param is stringified JSON data setting
*/
dataPoints(data){

this.graphInfo = new FindInfo().info(this.dataset.type, this.dataset.field);
this.graphData = data;
}
Expand All @@ -69,7 +68,7 @@ export class GraphEngine extends HTMLElement {
* Call back for when the component is detached from the DOM
*/
disconnectedCallback() {

}

/**
Expand Down

0 comments on commit 1542d6e

Please sign in to comment.