Skip to content

Commit c9a4aa0

Browse files
committed
Restructured files to be grouped better together
1 parent 3eeba89 commit c9a4aa0

14 files changed

+97
-59
lines changed

src/NeoDash.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import Section from "react-materialize/lib/Section";
33
import Row from "react-materialize/lib/Row";
44
import Container from "react-materialize/lib/Container";
5-
import {AddNeoCardComponent, NeoCardComponent} from "./card/NeoCard";
5+
import {AddNeoCard, NeoCard} from "./card/NeoCard";
66
import Navbar from "react-materialize/lib/Navbar";
77
import Icon from "react-materialize/lib/Icon";
88
import NeoModal from "./component/NeoModal";
@@ -191,7 +191,7 @@ class NeoDash extends React.Component {
191191
this.state.cardState = loaded.reports.map(c => []);
192192
this.state.cards = loaded.reports.map((report, index) => {
193193
if (report.type) {
194-
return <NeoCardComponent
194+
return <NeoCard
195195
connection={this.connection}
196196
globalParameters={this.state.globalParameters}
197197
page={report.page}
@@ -211,7 +211,7 @@ class NeoDash extends React.Component {
211211
refresh={report.refresh}/>
212212
} else if (this.state.editable) {
213213
// a loaded report without a type is a "Add new card" button.
214-
return <AddNeoCardComponent key={99999999} id={99999999} onClick={this.stateChanged}/>
214+
return <AddNeoCard key={99999999} id={99999999} onClick={this.stateChanged}/>
215215
}
216216
return <div/>
217217
}
@@ -341,7 +341,7 @@ class NeoDash extends React.Component {
341341
* Creates a card at the end of the dashboard's card array.
342342
*/
343343
createCard() {
344-
let newCard = <NeoCardComponent connection={this.connection}
344+
let newCard = <NeoCard connection={this.connection}
345345
globalParameters={this.state.globalParameters}
346346
kkey={this.state.count}
347347
session={this.session}

src/card/NeoCard.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ import Card from "react-materialize/lib/Card";
33
import Icon from "react-materialize/lib/Icon";
44
import Textarea from "react-materialize/lib/Textarea";
55
import Button from "react-materialize/lib/Button";
6-
import NeoTable from "../report/table/NeoTable";
7-
import NeoPagination from "../report/table/NeoPagination";
8-
import NeoGraphViz from "../report/graph/NeoGraphVis";
6+
import NeoTable from "./report/NeoTableReport";
7+
import NeoPagination from "./footer/NeoTableFooter";
8+
import NeoGraphViz from "./report/NeoGraphVisReport";
99
import Col from "react-materialize/lib/Col";
1010
import NeoCardSettings from "./NeoCardSettings";
11-
import NeoJSONView from "../report/json/NeoJSONView";
12-
import NeoGraphChips from "../report/graph/NeoGraphChips";
13-
import NeoMarkdownView from "../report/text/NeoMarkdownView";
14-
import NeoBarChart from "../report/bar/NeoBarChart";
15-
import NeoBarPropertySelect from "../report/bar/NeoBarPropertySelect";
16-
import NeoLineChart from "../report/line/NeoLineChart";
17-
import NeoLinePropertySelect from "../report/line/NeoLinePropertySelect";
18-
import NeoPropertySelectReport from "../report/select/NeoPropertySelectReport";
11+
import NeoJSONView from "./report/NeoJSONViewReport";
12+
import NeoGraphChips from "./footer/NeoGraphVisFooter";
13+
import NeoMarkdownView from "./report/NeoMarkdownReport";
14+
import NeoBarChart from "./report/NeoBarChartReport";
15+
import NeoBarPropertySelect from "./footer/NeoBarChartFooter";
16+
import NeoLineChart from "./report/NeoLineChartReport";
17+
import NeoLinePropertySelect from "./footer/NeoLineChartFooter";
18+
import NeoPropertySelectReport from "./report/NeoPropertySelectReport";
1919

2020

2121
let emptyAction = <div key={0}/>;
@@ -24,7 +24,7 @@ let emptyAction = <div key={0}/>;
2424
* A NeoCard represents a single card in a dashboard.
2525
* A card will always have a report and a settings view.
2626
*/
27-
class NeoCard extends React.Component {
27+
export class NeoCard extends React.Component {
2828
/**
2929
* The default state of a NeoCard is set based on the properties it is initialized with.
3030
*/
@@ -561,7 +561,7 @@ class NeoCard extends React.Component {
561561
* This button sits in the same list as regular cards.
562562
* After clicking the button, a new card gets added the dashboard.
563563
*/
564-
class AddNeoCard extends React.Component {
564+
export class AddNeoCard extends React.Component {
565565
constructor(props) {
566566
super(props);
567567
}
@@ -582,5 +582,3 @@ class AddNeoCard extends React.Component {
582582

583583
}
584584

585-
export const NeoCardComponent = NeoCard;
586-
export const AddNeoCardComponent = AddNeoCard;

src/card/footer/NeoBarChartFooter.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import React from "react";
2-
import NeoOptionSelect from "../../../component/NeoOptionSelect";
2+
import NeoOptionSelect from "../../component/NeoOptionSelect";
3+
import NeoFooter from "./NeoFooter";
34

4-
class NeoBarPropertySelect extends React.Component {
5+
/**
6+
* A bar chart footer allows the user to select:
7+
* - the categories of the plot (x-axis)
8+
* - the values of the plot (y-axis)
9+
*
10+
* On selection of new fields, the report corresponding to the footer will be refreshed.
11+
*/
12+
class NeoBarChartFooter extends NeoFooter {
513
constructor(props) {
614
super(props);
715
this.state = {}
@@ -25,4 +33,4 @@ class NeoBarPropertySelect extends React.Component {
2533

2634
}
2735

28-
export default (NeoBarPropertySelect);
36+
export default (NeoBarChartFooter);

src/card/footer/NeoFooter.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from "react";
2+
3+
/**
4+
* Parent class for all card footers.
5+
* Handles logic relevant to all footers. Currently unused.
6+
*/
7+
class NeoFooter extends React.Component {
8+
constructor(props) {
9+
super(props);
10+
}
11+
12+
render() {
13+
return <div/>
14+
}
15+
}
16+
17+
export default (NeoFooter);

src/card/footer/NeoGraphVisFooter.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
import React from "react";
22
import Chip from "react-materialize/lib/Chip";
33
import Icon from "react-materialize/lib/Icon";
4-
import NeoButton from "../../../component/NeoButton";
5-
import NeoOptionSelect from "../../../component/NeoOptionSelect";
4+
import NeoButton from "../../component/NeoButton";
5+
import NeoOptionSelect from "../../component/NeoOptionSelect";
6+
import NeoFooter from "./NeoFooter";
67

7-
class NeoGraphChips extends React.Component {
8+
/**
9+
* A graph visualization footer displays the node labels present in the visualization.
10+
* When clicking on a label, the rendered property name on the node can be changed.
11+
*/
12+
class NeoGraphVisFooter extends NeoFooter {
813
constructor(props) {
914
super(props);
1015
this.state = {}
1116
}
1217

1318

1419
render() {
15-
let colors = ["#588c7e", "#f2e394", "#f2ae72", "#d96459", "#5b9aa0", "#d6d4e0", "#b8a9c9", "#622569", "#ddd5af", "#d9ad7c", "#a2836e", "#674d3c", "grey"]
20+
let colors = ["#588c7e", "#f2e394", "#f2ae72", "#d96459", "#5b9aa0", "#d6d4e0",
21+
"#b8a9c9", "#622569", "#ddd5af", "#d9ad7c", "#a2836e", "#674d3c", "grey"]
1622
let parsedParameters = this.props.params;
1723
if (parsedParameters && parsedParameters.nodeColors) {
1824
if (typeof (parsedParameters.nodeColors) === 'string') {
@@ -58,4 +64,4 @@ class NeoGraphChips extends React.Component {
5864

5965
}
6066

61-
export default (NeoGraphChips);
67+
export default (NeoGraphVisFooter);

src/card/footer/NeoLineChartFooter.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
import React from "react";
2-
import NeoOptionSelect from "../../../component/NeoOptionSelect";
2+
import NeoOptionSelect from "../../component/NeoOptionSelect";
3+
import NeoFooter from "./NeoFooter";
34

4-
class NeoLinePropertySelect extends React.Component {
5+
/**
6+
* A line chart footer allows the user to select:
7+
* - the x-axis field.
8+
* - the y-axis field.
9+
*
10+
* On selection of new fields, the report corresponding to the footer will be refreshed.
11+
*/
12+
class NeoLineChartFooter extends NeoFooter {
513
constructor(props) {
614
super(props);
715
this.state = {}
@@ -25,4 +33,4 @@ class NeoLinePropertySelect extends React.Component {
2533

2634
}
2735

28-
export default (NeoLinePropertySelect);
36+
export default (NeoLineChartFooter);

src/card/footer/NeoTableFooter.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import React from "react";
22
import Pagination from "react-materialize/lib/Pagination";
33
import Icon from "react-materialize/lib/Icon";
4+
import NeoFooter from "./NeoFooter";
45

5-
6-
class NeoPagination extends React.Component {
6+
/**
7+
* A table report footer can be used to switch pages in the table.
8+
*/
9+
class NeoTableFooter extends NeoFooter {
710
constructor(props) {
811
super(props);
912
}
1013

11-
render(content) {
12-
14+
render() {
1315
return <Pagination
1416
activePage={(this.props.page ? this.props.page : 1)}
1517
items={1000}
@@ -21,4 +23,4 @@ class NeoPagination extends React.Component {
2123
}
2224
}
2325

24-
export default (NeoPagination);
26+
export default (NeoTableFooter);

src/card/report/NeoBarChartReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
2-
import NeoReport from "../NeoReport";
2+
import NeoReport from "./NeoReport";
33
import * as d3 from "d3";
44

5-
class NeoBarChart extends NeoReport {
5+
class NeoBarChartReport extends NeoReport {
66

77
componentDidUpdate(prevProps) {
88
super.componentDidUpdate(prevProps);
@@ -186,4 +186,4 @@ class NeoBarChart extends NeoReport {
186186

187187
}
188188

189-
export default (NeoBarChart);
189+
export default (NeoBarChartReport);

src/card/report/NeoGraphVisReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as d3 from "d3";
22
import React from "react";
3-
import NeoReport from "../NeoReport";
3+
import NeoReport from "./NeoReport";
44

55

6-
class NeoGraphVis extends NeoReport {
6+
class NeoGraphVisReport extends NeoReport {
77
constructor(props) {
88
super(props);
99
}
@@ -584,5 +584,5 @@ class NeoGraphVis extends NeoReport {
584584
}
585585
}
586586

587-
export default (NeoGraphVis);
587+
export default (NeoGraphVisReport);
588588

src/card/report/NeoJSONViewReport.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import Textarea from "react-materialize/lib/Textarea";
3-
import NeoReport from "../NeoReport";
3+
import NeoReport from "./NeoReport";
44

5-
class NeoJSONView extends NeoReport {
5+
class NeoJSONViewReport extends NeoReport {
66
constructor(props) {
77
super(props);
88
}
@@ -45,4 +45,4 @@ class NeoJSONView extends NeoReport {
4545
}
4646
}
4747

48-
export default (NeoJSONView);
48+
export default (NeoJSONViewReport);

0 commit comments

Comments
 (0)