Advertisement
Guest User

GridTestDataCharts

a guest
Nov 12th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.71 KB | None | 0 0
  1. import React from "react";
  2. import ReactDOM from "react-dom";
  3.  
  4. import "@progress/kendo-react-charts";
  5. import "@progress/kendo-react-popup";
  6. import { ComboBox, DropDownList } from "@progress/kendo-react-dropdowns";
  7. import "@progress/kendo-react-inputs";
  8. import "@progress/kendo-react-intl";
  9. import "@progress/kendo-data-query";
  10. import "@progress/kendo-drawing";
  11. import "@progress/kendo-file-saver";
  12.  
  13. import {
  14. Chart,
  15. ChartSeries,
  16. ChartSeriesItem,
  17. ChartTooltip
  18. } from "@progress/kendo-react-charts";
  19.  
  20. const framePerformanceData = [
  21. {
  22. product: "kendoreact",
  23. records: 100,
  24. fps: 45,
  25. scriptingNLoad: 14.2,
  26. renderNPainting: 6.03,
  27. total: 20.23
  28. },
  29. {
  30. product: "kendoreact",
  31. records: 100,
  32. fps: 47,
  33. scriptingNLoad: 13.58,
  34. renderNPainting: 6.64,
  35. total: 20.22
  36. },
  37. {
  38. product: "kendoreact",
  39. records: 100,
  40. fps: 50,
  41. scriptingNLoad: 12.7,
  42. renderNPainting: 6.01,
  43. total: 18.71
  44. },
  45. {
  46. product: "kendoreact",
  47. records: 100,
  48. fps: 48,
  49. scriptingNLoad: 13.25,
  50. renderNPainting: 6.29,
  51. total: 19.54
  52. },
  53. {
  54. product: "kendoreact",
  55. records: 100,
  56. fps: 51,
  57. scriptingNLoad: 12.95,
  58. renderNPainting: 5.91,
  59. total: 18.86
  60. },
  61. {
  62. product: "kendoreact",
  63. records: 10000,
  64. fps: 44,
  65. scriptingNLoad: 14.66,
  66. renderNPainting: 6.53,
  67. total: 21.19
  68. },
  69. {
  70. product: "kendoreact",
  71. records: 10000,
  72. fps: 47,
  73. scriptingNLoad: 14.7,
  74. renderNPainting: 5.7,
  75. total: 20.4
  76. },
  77. {
  78. product: "kendoreact",
  79. records: 10000,
  80. fps: 42,
  81. scriptingNLoad: 16.11,
  82. renderNPainting: 6.6,
  83. total: 22.71
  84. },
  85. {
  86. product: "kendoreact",
  87. records: 10000,
  88. fps: 44,
  89. scriptingNLoad: 16.28,
  90. renderNPainting: 5.52,
  91. total: 21.8
  92. },
  93. {
  94. product: "kendoreact",
  95. records: 10000,
  96. fps: 44,
  97. scriptingNLoad: 15.45,
  98. renderNPainting: 6.03,
  99. total: 21.48
  100. },
  101. {
  102. product: "kendoangular",
  103. records: 100,
  104. fps: 35,
  105. scriptingNLoad: 20.19,
  106. renderNPainting: 7.21,
  107. total: 27.4
  108. },
  109. {
  110. product: "kendoangular",
  111. records: 100,
  112. fps: 38,
  113. scriptingNLoad: 18.27,
  114. renderNPainting: 6.41,
  115. total: 24.68
  116. },
  117. {
  118. product: "kendoangular",
  119. records: 100,
  120. fps: 32,
  121. scriptingNLoad: 18.01,
  122. renderNPainting: 8.34,
  123. total: 26.35
  124. },
  125. {
  126. product: "kendoangular",
  127. records: 100,
  128. fps: 31,
  129. scriptingNLoad: 20.8,
  130. renderNPainting: 8.39,
  131. total: 29.19
  132. },
  133. {
  134. product: "kendoangular",
  135. records: 100,
  136. fps: 36,
  137. scriptingNLoad: 18.01,
  138. renderNPainting: 8.03,
  139. total: 26.04
  140. },
  141. {
  142. product: "kendoangular",
  143. records: 10000,
  144. fps: 26,
  145. scriptingNLoad: 25.79,
  146. renderNPainting: 8.5,
  147. total: 34.29
  148. },
  149. {
  150. product: "kendoangular",
  151. records: 10000,
  152. fps: 25,
  153. scriptingNLoad: 29.19,
  154. renderNPainting: 8.56,
  155. total: 37.75
  156. },
  157. {
  158. product: "kendoangular",
  159. records: 10000,
  160. fps: 27,
  161. scriptingNLoad: 28.43,
  162. renderNPainting: 7.32,
  163. total: 35.75
  164. },
  165. {
  166. product: "kendoangular",
  167. records: 10000,
  168. fps: 28,
  169. scriptingNLoad: 25.64,
  170. renderNPainting: 8.65,
  171. total: 34.29
  172. },
  173. {
  174. product: "kendoangular",
  175. records: 10000,
  176. fps: 31,
  177. scriptingNLoad: 23.25,
  178. renderNPainting: 7.27,
  179. total: 30.52
  180. },
  181. {
  182. product: "ignite",
  183. records: 100,
  184. fps: 23,
  185. scriptingNLoad: 38.5,
  186. renderNPainting: 4.27,
  187. total: 42.77
  188. },
  189. {
  190. product: "ignite",
  191. records: 100,
  192. fps: 23,
  193. scriptingNLoad: 36.4,
  194. renderNPainting: 5.78,
  195. total: 42.18
  196. },
  197. {
  198. product: "ignite",
  199. records: 100,
  200. fps: 23,
  201. scriptingNLoad: 37.39,
  202. renderNPainting: 4.45,
  203. total: 41.84
  204. },
  205. {
  206. product: "ignite",
  207. records: 100,
  208. fps: 25,
  209. scriptingNLoad: 35.89,
  210. renderNPainting: 4.21,
  211. total: 40.1
  212. },
  213. {
  214. product: "ignite",
  215. records: 100,
  216. fps: 26,
  217. scriptingNLoad: 34,
  218. renderNPainting: 3.2,
  219. total: 37.2
  220. },
  221. {
  222. product: "ignite",
  223. records: 10000,
  224. fps: 20,
  225. scriptingNLoad: 43,
  226. renderNPainting: 5.56,
  227. total: 48.56
  228. },
  229. {
  230. product: "ignite",
  231. records: 10000,
  232. fps: 19,
  233. scriptingNLoad: 47,
  234. renderNPainting: 5.74,
  235. total: 52.74
  236. },
  237. {
  238. product: "ignite",
  239. records: 10000,
  240. fps: 19,
  241. scriptingNLoad: 45.29,
  242. renderNPainting: 7.1,
  243. total: 52.39
  244. },
  245. {
  246. product: "ignite",
  247. records: 10000,
  248. fps: 19,
  249. scriptingNLoad: 49,
  250. renderNPainting: 5.79,
  251. total: 54.79
  252. },
  253. {
  254. product: "ignite",
  255. records: 10000,
  256. fps: 19,
  257. scriptingNLoad: 45.95,
  258. renderNPainting: 5.73,
  259. total: 51.68
  260. },
  261. {
  262. product: "aggrid",
  263. records: 100,
  264. fps: 12.1,
  265. scriptingNLoad: 42.9,
  266. renderNPainting: 37.11,
  267. total: 80.01
  268. },
  269. {
  270. product: "aggrid",
  271. records: 100,
  272. fps: 12,
  273. scriptingNLoad: 43.23,
  274. renderNPainting: 37.29,
  275. total: 80.52
  276. },
  277. {
  278. product: "aggrid",
  279. records: 100,
  280. fps: 11,
  281. scriptingNLoad: 35.87,
  282. renderNPainting: 37.31,
  283. total: 73.18
  284. },
  285. {
  286. product: "aggrid",
  287. records: 100,
  288. fps: 13,
  289. scriptingNLoad: 38.73,
  290. renderNPainting: 38.23,
  291. total: 76.96
  292. },
  293. {
  294. product: "aggrid",
  295. records: 100,
  296. fps: 10,
  297. scriptingNLoad: 38.38,
  298. renderNPainting: 37.39,
  299. total: 75.77
  300. },
  301. {
  302. product: "aggrid",
  303. records: 10000,
  304. fps: 2,
  305. scriptingNLoad: 504,
  306. renderNPainting: 38.55,
  307. total: 542.55
  308. },
  309. {
  310. product: "aggrid",
  311. records: 10000,
  312. fps: 2,
  313. scriptingNLoad: 548,
  314. renderNPainting: 42.66,
  315. total: 590.66
  316. },
  317. {
  318. product: "aggrid",
  319. records: 10000,
  320. fps: 2,
  321. scriptingNLoad: 488,
  322. renderNPainting: 39.05,
  323. total: 527.05
  324. },
  325. {
  326. product: "aggrid",
  327. records: 10000,
  328. fps: 2,
  329. scriptingNLoad: 496,
  330. renderNPainting: 38.74,
  331. total: 534.74
  332. },
  333. {
  334. product: "aggrid",
  335. records: 10000,
  336. fps: 2,
  337. scriptingNLoad: 513,
  338. renderNPainting: 38.2,
  339. total: 551.2
  340. }
  341. ];
  342.  
  343. const otherPerformanceData = [
  344. {
  345. maxCpuPercent: 55,
  346. minCpuPercent: 35,
  347. heapMin: 9.1,
  348. heapMax: 24,
  349. nodesMin: 2130,
  350. nodesMax: 2766,
  351. listenersMin: 357,
  352. listenersMax: 357,
  353. bootTime: 645,
  354. horizontalScrollFps: 16,
  355. verticalScrollFps: 21,
  356. vmachineSize: 7.8,
  357. downloadSize: 1.7,
  358. product: "kendoreact"
  359. },
  360. {
  361. maxCpuPercent: 90,
  362. minCpuPercent: 50,
  363. heapMin: 41,
  364. heapMax: 60,
  365. nodesMin: 2136,
  366. nodesMax: 2387,
  367. listenersMin: 357,
  368. listenersMax: 357,
  369. bootTime: 645,
  370. horizontalScrollFps: 16,
  371. verticalScrollFps: 21,
  372. vmachineSize: 7.8,
  373. downloadSize: 1.7,
  374. product: "kendoreact"
  375. },
  376. {
  377. maxCpuPercent: 80,
  378. minCpuPercent: 40,
  379. heapMin: 17,
  380. heapMax: 24,
  381. nodesMin: 7000,
  382. nodesMax: 7400,
  383. listenersMin: 585,
  384. listenersMax: 585,
  385. bootTime: 1450,
  386. horizontalScrollFps: 22,
  387. verticalScrollFps: 18,
  388. vmachineSize: 21,
  389. downloadSize: 2,
  390. product: "kendoangular"
  391. },
  392. {
  393. maxCpuPercent: 95,
  394. minCpuPercent: 45,
  395. heapMin: 49,
  396. heapMax: 63,
  397. nodesMin: 7000,
  398. nodesMax: 7340,
  399. listenersMin: 585,
  400. listenersMax: 585,
  401. bootTime: 1450,
  402. horizontalScrollFps: 22,
  403. verticalScrollFps: 18,
  404. vmachineSize: 21,
  405. downloadSize: 2,
  406. product: "kendoangular"
  407. },
  408. {
  409. maxCpuPercent: 95,
  410. minCpuPercent: 60,
  411. heapMin: 22.2,
  412. heapMax: 34.4,
  413. nodesMin: 6270,
  414. nodesMax: 10000,
  415. listenersMin: 5301,
  416. listenersMax: 5301,
  417. bootTime: 2000,
  418. horizontalScrollFps: 14,
  419. verticalScrollFps: 13,
  420. vmachineSize: 31,
  421. downloadSize: 2.4,
  422. product: "ignite"
  423. },
  424. {
  425. maxCpuPercent: 95,
  426. minCpuPercent: 60,
  427. heapMin: 24,
  428. heapMax: 40,
  429. nodesMin: 8022,
  430. nodesMax: 8344,
  431. listenersMin: 5309,
  432. listenersMax: 5309,
  433. bootTime: 2000,
  434. horizontalScrollFps: 14,
  435. verticalScrollFps: 13,
  436. vmachineSize: 31,
  437. downloadSize: 2.4,
  438. product: "ignite"
  439. },
  440. {
  441. maxCpuPercent: 100,
  442. minCpuPercent: 100,
  443. heapMin: 11,
  444. heapMax: 36,
  445. nodesMin: 3100,
  446. nodesMax: 20233,
  447. listenersMin: 888,
  448. listenersMax: 7970,
  449. bootTime: 715,
  450. horizontalScrollFps: 12,
  451. verticalScrollFps: 10,
  452. vmachineSize: 9.78,
  453. downloadSize: 1.5,
  454. product: "aggrid"
  455. },
  456. {
  457. maxCpuPercent: 100,
  458. minCpuPercent: 100,
  459. heapMin: 108,
  460. heapMax: 580,
  461. nodesMin: 3912,
  462. nodesMax: 8373,
  463. listenersMin: 1194,
  464. listenersMax: 3042,
  465. bootTime: 715,
  466. horizontalScrollFps: 12,
  467. verticalScrollFps: 10,
  468. vmachineSize: 9.78,
  469. downloadSize: 1.5,
  470. product: "aggrid"
  471. }
  472. ];
  473.  
  474. const info = {
  475. high: "Higher is better",
  476. low: "Lower is better"
  477. };
  478.  
  479. const otherPerformanceFields = [
  480. {
  481. fields: ["minCpuPercent", "maxCpuPercent"],
  482. title: "Min/Max CPU usage",
  483. info: info.low
  484. },
  485. {
  486. fields: ["heapMin", "heapMax"],
  487. title: "Min/Max Heap Size",
  488. info: info.low
  489. },
  490. {
  491. fields: ["nodesMin", "nodesMax"],
  492. title: "Min/Max node count",
  493. info: info.low
  494. },
  495. {
  496. fields: ["listenersMin", "listenersMax"],
  497. title: "Min/Max Listeners count",
  498. info: info.low
  499. },
  500. {
  501. fields: ["horizontalScrollFps", "verticalScrollFps"],
  502. title: "Horizontal/Vertical Scroll FPS",
  503. info: info.high
  504. },
  505. {
  506. fields: ["bootTime"],
  507. title: "Boot time",
  508. info: info.low
  509. },
  510. ,
  511. {
  512. fields: ["vmachineSize"],
  513. title: "JavaScript VM size",
  514. info: info.low
  515. },
  516. ,
  517. {
  518. fields: ["downloadSize"],
  519. title: "Bundle Size",
  520. info: info.low
  521. }
  522. ];
  523.  
  524. const framePerformanceFields = [
  525. {
  526. field: "fps",
  527. title: "FPS",
  528. info: info.high
  529. },
  530. {
  531. field: "total",
  532. title: "Total Render Time",
  533. info: info.low
  534. },
  535. {
  536. field: "scriptingNLoad",
  537. title: "Scripting/Loading",
  538. info: info.low
  539. },
  540. {
  541. field: "renderNPainting",
  542. title: "Rendering/Painting",
  543. info: info.low
  544. }
  545. ];
  546.  
  547. const ChartContainer = () => {
  548. return (
  549. <div>
  550. {framePerformanceFields.map(currentItem => {
  551. return (
  552. <div>
  553. <h4>{currentItem.title}</h4>
  554. <i>*{currentItem.info}</i>
  555. <Chart zoomable={false}>
  556. <ChartTooltip />
  557. <ChartSeries>
  558. <ChartSeriesItem
  559. data={framePerformanceData}
  560. type="column"
  561. field={currentItem.field}
  562. categoryField="product"
  563. />
  564. </ChartSeries>
  565. </Chart>
  566. <hr /> <hr />
  567. </div>
  568. );
  569. })}
  570. {otherPerformanceFields.map(currentItem => {
  571. return (
  572. <div>
  573. <h4>{currentItem.title}</h4>
  574. <i>*{currentItem.info}</i>
  575. <Chart zoomable={false}>
  576. <ChartTooltip />
  577. <ChartSeries>
  578. {currentItem.fields.map(field => {
  579. return (
  580. <ChartSeriesItem
  581. data={otherPerformanceData}
  582. type="column"
  583. field={field}
  584. categoryField="product"
  585. name={field}
  586. />
  587. );
  588. })}
  589. </ChartSeries>
  590. </Chart>
  591. <hr /> <hr />
  592. </div>
  593. );
  594. })}
  595. </div>
  596. );
  597. };
  598.  
  599. ReactDOM.render(<ChartContainer />, document.querySelector("my-app"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement