-
Notifications
You must be signed in to change notification settings - Fork 54
/
HeaderToolbar.js
76 lines (69 loc) · 2.48 KB
/
HeaderToolbar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import React from 'react';
import ScatterPlotObject from '../../templates/ScatterPlotObject';
//import d3ParserObj from '../../d3ParserObj';
export default (props) => {
const toggleDropDown = props.toggleDropDown;
const getScatterPlotAction = props.getScatterPlotAction;
const toTemplate = props.toTemplate;
const getD3ParserObj = props.getD3ParserObj;
const openDataWin = props.openDataWin;
// const testfunc = props.testfunc;
window.onclick = function(event) {
if (!event.target.matches('.btn-dropdown')) {
let dropdowns = document.getElementsByClassName("dropdown-menu");
for (let i = 0; i < dropdowns.length; i += 1) {
let openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
return (
<div className="toolbar-action titlebar">
<img src="assets/id3_logo.svg" className="headerlogo"></img>
<div className="btn-group">
<button className="btn btn-default" id="import-btn">
<input type="file" id="upload-file" hidden></input>
Upload D3
</button>
<a className="btn btn-default" id="export-btn">
Export D3
</a>
<div className="dropdown">
<button className="btn btn-default btn-dropdown" onClick={toggleDropDown}>
<span className="icon icon-layout icon-text"></span>
Templates
</button>
<div id="template-menu" className="dropdown-menu">
<p id="scatter-plot" onClick={(e)=>{getScatterPlotAction(ScatterPlotObject); toTemplate()}}>
{/* <span className="icon icon-chart-line icon-text"></span> */}
Scatter Plot
</p>
<p>
{/* <span className="icon icon-chart-bar icon-text"></span> */}
Bar Chart
</p>
<p>
{/* <span className="icon icon-chart-area icon-text"></span> */}
Area Graph
</p>
<p>
{/* <span className="icon icon-chart-line icon-text"></span> */}
Line Graph
</p>
<p>
{/* <span className="icon icon-chart-pie icon-text"></span> */}
Pie Chart
</p>
</div>
</div>
</div>
<div className="btn-group pull-right">
<button className="btn btn-default data-mgn-btn" id="dataWin">
Data Management
</button>
</div>
</div>
);
}