diff --git a/src/Graph.tsx b/src/Graph.tsx index 277797d933..4e6a7dc766 100644 --- a/src/Graph.tsx +++ b/src/Graph.tsx @@ -23,10 +23,13 @@ class Graph extends Component { const elem = document.getElementsByTagName('perspective-viewer')[0] as unknown as PerspectiveViewerElement; const schema = { - stock: 'string', - top_ask_price: 'float', - top_bid_price: 'float', - timestamp: 'date', + price_abc: 'float', + price_def: 'float', + ratio: 'float', + timestamp:'data', + upper_bound:'float', + lower_bound:'float', + trigger_alert:'float' }; if (window.perspective && window.perspective.worker()) { @@ -36,23 +39,25 @@ class Graph extends Component { // Load the `table` in the `` DOM reference. elem.load(this.table); elem.setAttribute('view', 'y_line'); - elem.setAttribute('column-pivots', '["stock"]'); elem.setAttribute('row-pivots', '["timestamp"]'); - elem.setAttribute('columns', '["top_ask_price"]'); + elem.setAttribute('columns', '["ratio","lower_bound","upper_bound","trigger_alert]');"]'); elem.setAttribute('aggregates', JSON.stringify({ - stock: 'distinctcount', - top_ask_price: 'avg', - top_bid_price: 'avg', + price_abc:'avg', + price_def:'avg', + ratio:'avg', timestamp: 'distinct count', + upper_bound:'avg', + lower_bound:'avg', + trigger_alert:'avg', })); } } - componentDidUpdate() { + componentDidUpdate() { if (this.table) { - this.table.update( + this.table.update([ DataManipulator.generateRow(this.props.data), - ); + ]as unknow as TableData); } } }