Skip to content

Commit f2f6d4b

Browse files
committed
Fix
1 parent 4cd1924 commit f2f6d4b

File tree

5 files changed

+50
-48
lines changed

5 files changed

+50
-48
lines changed

apps/demos/Demos/Charts/LoadDataOnDemand/ReactJs/App.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { useState } from "react";
2-
import { DataSource } from "devextreme-react/common/data";
1+
import React, { useState } from 'react';
2+
import { DataSource } from 'devextreme-react/common/data';
33
import {
44
Chart,
55
ZoomAndPan,
@@ -13,12 +13,13 @@ import {
1313
Series,
1414
Animation,
1515
LoadingIndicator,
16-
} from "devextreme-react/chart";
16+
} from 'devextreme-react/chart';
17+
1718
const HALFDAY = 43200000;
1819
let packetsLock = 0;
1920
const chartDataSource = new DataSource({
2021
store: [],
21-
sort: "date",
22+
sort: 'date',
2223
paginate: false,
2324
});
2425
const wholeRange = {
@@ -31,7 +32,7 @@ function App() {
3132
endValue: new Date(2017, 3, 15),
3233
});
3334
const handleChange = (e) => {
34-
if (e.fullName === "argumentAxis.visualRange") {
35+
if (e.fullName === 'argumentAxis.visualRange') {
3536
const stateStart = visualRange.startValue;
3637
const currentStart = e.value.startValue;
3738
if (stateStart.valueOf() !== currentStart.valueOf()) {
@@ -114,22 +115,22 @@ const uploadDataByVisualRange = (visualRange, component) => {
114115
const onVisualRangeChanged = (visualRange, component) => {
115116
const items = component.getDataSource().items();
116117
if (
117-
!items.length ||
118-
items[0].date - visualRange.startValue.getTime() >= HALFDAY ||
119-
visualRange.endValue.getTime() - items[items.length - 1].date >= HALFDAY
118+
!items.length
119+
|| items[0].date - visualRange.startValue.getTime() >= HALFDAY
120+
|| visualRange.endValue.getTime() - items[items.length - 1].date >= HALFDAY
120121
) {
121122
uploadDataByVisualRange(visualRange, component);
122123
}
123124
};
124125
function getDataFrame(args) {
125-
let params = "?";
126+
let params = '?';
126127
params += `startVisible=${args.startVisible}
127128
&endVisible=${args.endVisible}`;
128129
return fetch(`https://js.devexpress.com/Demos/NetCore/api/TemperatureData${params}`).then(
129-
(response) => response.json()
130+
(response) => response.json(),
130131
);
131132
}
132133
function getDateString(dateTime) {
133-
return dateTime ? dateTime.toLocaleDateString("en-US") : "";
134+
return dateTime ? dateTime.toLocaleDateString('en-US') : '';
134135
}
135136
export default App;
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
3-
import App from "./App.js";
4-
ReactDOM.render(<App />, document.getElementById("app"));
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App.js';
4+
5+
ReactDOM.render(<App />, document.getElementById('app'));

apps/demos/Demos/Charts/ServerSideDataProcessing/ReactJs/App.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from "react";
2-
import { DataSource } from "devextreme-react/common/data";
1+
import React from 'react';
2+
import { DataSource } from 'devextreme-react/common/data';
33
import Chart, {
44
ValueAxis,
55
ArgumentAxis,
@@ -13,9 +13,10 @@ import Chart, {
1313
Tooltip,
1414
Export,
1515
LoadingIndicator,
16-
} from "devextreme-react/chart";
17-
import SelectBox from "devextreme-react/select-box";
18-
import { months, monthLabel } from "./data.js";
16+
} from 'devextreme-react/chart';
17+
import SelectBox from 'devextreme-react/select-box';
18+
import { months, monthLabel } from './data.js';
19+
1920
const year = 2017;
2021
let selectedMonth = 1;
2122
const startOfMonthStr = (month) => `${month}/01/${year}`;
@@ -26,16 +27,15 @@ const endOfMonthStr = (month) => {
2627
return `${month}/${lastDay}/${year}`;
2728
};
2829
const chartDataSource = new DataSource({
29-
key: "Date",
30+
key: 'Date',
3031
load: () => {
3132
const startVisible = startOfMonthStr(selectedMonth);
3233
const endVisible = endOfMonthStr(selectedMonth);
33-
const url =
34-
"https://js.devexpress.com/Demos/NetCore/api/TemperatureData" +
35-
`?startVisible=${encodeURIComponent(startVisible)}` +
36-
`&endVisible=${encodeURIComponent(endVisible)}` +
37-
`&startBound=${encodeURIComponent(startVisible)}` +
38-
`&endBound=${encodeURIComponent(endVisible)}`;
34+
const url = 'https://js.devexpress.com/Demos/NetCore/api/TemperatureData'
35+
+ `?startVisible=${encodeURIComponent(startVisible)}`
36+
+ `&endVisible=${encodeURIComponent(endVisible)}`
37+
+ `&startBound=${encodeURIComponent(startVisible)}`
38+
+ `&endBound=${encodeURIComponent(endVisible)}`;
3939
return fetch(url)
4040
.then((r) => {
4141
if (!r.ok) throw new Error(`Network response fails: ${r.status}`);
@@ -46,8 +46,7 @@ const chartDataSource = new DataSource({
4646
...item,
4747
Temperature: (item.MinTemp + item.MaxTemp) / 2,
4848
Date: new Date(item.Date),
49-
}))
50-
);
49+
})));
5150
},
5251
paginate: false,
5352
});
@@ -56,14 +55,14 @@ function onValueChanged(data) {
5655
chartDataSource.load();
5756
}
5857
function customizeLabel(e) {
59-
return `${e.valueText}${"&#176C"}`;
58+
return `${e.valueText}${'&#176C'}`;
6059
}
6160
function customizeArgumentAxisLabel(e) {
6261
return new Date(e.value).getDate().toString();
6362
}
6463
function customizeTooltip(arg) {
6564
return {
66-
text: `${arg.valueText}${"&#176C"}`,
65+
text: `${arg.valueText}${'&#176C'}`,
6766
};
6867
}
6968
function App() {
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
export const months = [
22
{
33
id: 1,
4-
name: "January",
4+
name: 'January',
55
},
66
{
77
id: 2,
8-
name: "February",
8+
name: 'February',
99
},
1010
{
1111
id: 3,
12-
name: "March",
12+
name: 'March',
1313
},
1414
{
1515
id: 4,
16-
name: "April",
16+
name: 'April',
1717
},
1818
{
1919
id: 5,
20-
name: "May",
20+
name: 'May',
2121
},
2222
{
2323
id: 6,
24-
name: "June",
24+
name: 'June',
2525
},
2626
{
2727
id: 7,
28-
name: "July",
28+
name: 'July',
2929
},
3030
{
3131
id: 8,
32-
name: "August",
32+
name: 'August',
3333
},
3434
{
3535
id: 9,
36-
name: "September",
36+
name: 'September',
3737
},
3838
{
3939
id: 10,
40-
name: "October",
40+
name: 'October',
4141
},
4242
{
4343
id: 11,
44-
name: "November",
44+
name: 'November',
4545
},
4646
{
4747
id: 12,
48-
name: "December",
48+
name: 'December',
4949
},
5050
];
51-
export const monthLabel = { "aria-label": "Month" };
51+
export const monthLabel = { 'aria-label': 'Month' };
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from "react";
2-
import ReactDOM from "react-dom";
3-
import App from "./App.js";
4-
ReactDOM.render(<App />, document.getElementById("app"));
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App.js';
4+
5+
ReactDOM.render(<App />, document.getElementById('app'));

0 commit comments

Comments
 (0)