Skip to content

Commit f57c3a6

Browse files
authored
Merge pull request #10 from k-rister/demo-updates
Demo updates
2 parents 5fda462 + 4873f36 commit f57c3a6

File tree

9 files changed

+2268
-22
lines changed

9 files changed

+2268
-22
lines changed

jschart/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ rect.pane { cursor: crosshair; fill: none; pointer-events: all; }
3333
.hidden { visibility: hidden; }
3434
.hiddenrow { background-color: rgba(152, 152, 152, 1); }
3535
.invalidrow { background-color: yellow; }
36-
.loadinglabel { opacity: 0.75; color: black; pointer-events: none; }
36+
.loadinglabel { font-size: 120px; opacity: 0.75; color: black; pointer-events: none; }
3737
rect.tooltip { fill: #CCCCCC; stroke-width: 2px; stroke: black; }
3838
.slider path { fill: #033E6B; stroke: black; }
3939
.slider rect { fill-opacity: 0.25; }

jschart/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,7 +3247,7 @@ function build_chart(chart) {
32473247
for (var i = 0; i < chart.options.csvfiles.length; i++) {
32483248
// add a dataset load to the queue
32493249
chart.datasets_queue.defer(
3250-
load_csv_text,
3250+
load_csv_files,
32513251
chart.options.csvfiles[i],
32523252
chart
32533253
);
@@ -3564,7 +3564,7 @@ exports.create_jschart = function(
35643564
);
35653565
};
35663566

3567-
function finish_page() {
3567+
exports.finish_page = function () {
35683568
// wait for chart generation to complete before logging that it is done and changing the page background
35693569
charts_queue.await(function(error, results) {
35703570
d3.select("body").classed("completedpage", true);

jschart/webpack.config.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
const path = require('path');
22

33
module.exports = {
4-
entry: 'index.js',
4+
entry: 'index.js',
55
module: {
6-
rules: [
7-
{
8-
test: /\.css$/,
9-
use: [
10-
'style-loader',
11-
'css-loader'
12-
]
13-
}
6+
rules: [
7+
{
8+
test: /\.css$/,
9+
use: [
10+
'style-loader',
11+
'css-loader'
12+
]
13+
},
14+
{
15+
test: /\.(csv|json|plot)$/,
16+
use: [
17+
loader: 'file-loader',
18+
options: {}
19+
]
20+
}
1421
]
1522
}
1623
};

tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"jschart": "file:../jschart",
99
"react": "^16.5.1",
1010
"react-dom": "^16.5.1",
11-
"react-scripts": "1.1.5"
11+
"react-scripts": "1.1.5",
12+
"file-loader": "3.0.1"
1213
},
1314
"scripts": {
1415
"start": "react-scripts start",

tests/src/App.js

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,102 @@
11
import React, { Component } from "react";
22
import jschart from "jschart";
33

4+
import histogram_data from './data/histogram.csv';
5+
import timeseries_data from './data/timeseries.csv';
6+
import xy_data from './data/xy.csv';
7+
import jitter_data from './data/jitter.csv';
8+
49
class App extends Component {
510
componentDidMount = () => {
611
jschart.create_jschart(
712
0,
813
"timeseries",
9-
"jschart_timeseries",
10-
"Timeseries Demo",
14+
"jschart_json",
15+
"JSON Demo",
1116
"Time (secs.)",
1217
"CPU Utilization",
1318
{
14-
json_object: {
15-
x_axis_series: "time",
16-
data_series_names: ["time", "data series 1", "data series 2"],
17-
data: [[1461027782000, 0, 1], [1461027783000, 4, 5]]
18-
}
19+
json_object: {
20+
x_axis_series: "time",
21+
data_series_names: ["time", "data series 1", "data series 2"],
22+
data: [[1461027782000, 0, 1], [1461027783000, 4, 5]]
23+
}
24+
}
25+
);
26+
jschart.create_jschart(
27+
0,
28+
"histogram",
29+
"jschart_histogram",
30+
"Histogram Demo",
31+
"Buckets",
32+
"Bucket Size",
33+
{
34+
csvfiles: [ histogram_data ]
35+
}
36+
);
37+
jschart.create_jschart(
38+
1,
39+
"timeseries",
40+
"jschart_timeseries",
41+
"Timeseries Demo",
42+
null,
43+
null,
44+
{
45+
csvfiles: [ timeseries_data ],
46+
sort_datasets: false
47+
}
48+
);
49+
jschart.create_jschart(
50+
0,
51+
"xy",
52+
"jschart_xy",
53+
"XY Demo",
54+
null,
55+
null,
56+
{
57+
csvfiles: [ xy_data ]
58+
}
59+
);
60+
jschart.create_jschart(
61+
0,
62+
"xy",
63+
"jschart_jitter",
64+
"Jitter Samples",
65+
"Samples",
66+
"Latency (ns)",
67+
{
68+
csvfiles: [ jitter_data ]
69+
}
70+
);
71+
jschart.create_jschart(
72+
0,
73+
"xy",
74+
"jschart_jitter_scatter",
75+
"Jitter Samples: Scatterplot",
76+
"Samples",
77+
"Latency (ns)",
78+
{
79+
csvfiles: [ jitter_data ],
80+
scatterplot: true
1981
}
2082
);
83+
jschart.finish_page();
2184
};
2285

2386
render() {
2487
return (
2588
<div className="App">
2689
<header className="App-header">
27-
<h1 className="App-title">JSChart Node Module Demo</h1>
90+
<h1 className="App-title">JSChart Demos</h1>
2891
</header>
2992
<br></br>
93+
<div id="jschart_json"></div>
94+
<div id="jschart_histogram"></div>
3095
<div id="jschart_timeseries"></div>
31-
</div>
96+
<div id="jschart_xy"></div>
97+
<div id="jschart_jitter"></div>
98+
<div id="jschart_jitter_scatter"></div>
99+
</div>
32100
);
33101
}
34102
}

0 commit comments

Comments
 (0)