File tree Expand file tree Collapse file tree 8 files changed +43
-0
lines changed
test/jasmine/performance_tests Expand file tree Collapse file tree 8 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ //var fs = require('fs');
4+ //var path = require('path');
5+ //var constants = require('../../../../tasks/util/constants.js');
6+ //var pathToResults = path.join(constants.pathToRoot, 'test/jasmine/performance_tests/results');
7+
8+ exports . writeRawDataToCSV = function ( traceName , allTests ) {
9+ for ( var k = 0 ; k < allTests . length ; k ++ ) {
10+ var test = allTests [ k ] ;
11+
12+ var str = traceName + ',' + test . n + '\n' ;
13+ str += 'id,time(ms)\n' ;
14+ for ( var i = 0 ; i < test . raw . length ; i ++ ) {
15+ str += i + ',' + test . raw [ i ] + '\n' ;
16+ }
17+
18+ console . log ( str ) ;
19+ //var filePath = path.join(pathToResults, traceName, test.n);
20+ //fs.writeFileSync(filePath, str);
21+ }
22+ } ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyBar = require ( '../../../lib/bar' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -94,6 +95,8 @@ tests.forEach(function(spec, index) {
9495
9596 if ( t === nTimes && index === tests . length - 1 ) {
9697 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
98+
99+ writeRawDataToCSV ( 'bar' , tests ) ;
97100 }
98101 } ) ;
99102 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyBox = require ( '../../../lib/box' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -95,6 +96,8 @@ tests.forEach(function(spec, index) {
9596
9697 if ( t === nTimes && index === tests . length - 1 ) {
9798 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
99+
100+ writeRawDataToCSV ( 'box' , tests ) ;
98101 }
99102 } ) ;
100103 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyContour = require ( '../../../lib/contour' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -105,6 +106,8 @@ tests.forEach(function(spec, index) {
105106
106107 if ( t === nTimes && index === tests . length - 1 ) {
107108 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
109+
110+ writeRawDataToCSV ( 'contour' , tests ) ;
108111 }
109112 } ) ;
110113 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyHeatmap = require ( '../../../lib/heatmap' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -105,6 +106,8 @@ tests.forEach(function(spec, index) {
105106
106107 if ( t === nTimes && index === tests . length - 1 ) {
107108 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
109+
110+ writeRawDataToCSV ( 'heatmap' , tests ) ;
108111 }
109112 } ) ;
110113 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyHistogram = require ( '../../../lib/histogram' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -94,6 +95,8 @@ tests.forEach(function(spec, index) {
9495
9596 if ( t === nTimes && index === tests . length - 1 ) {
9697 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
98+
99+ writeRawDataToCSV ( 'histogram' , tests ) ;
97100 }
98101 } ) ;
99102 } ) ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ var delay = require('../assets/delay');
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
55var PlotlyImage = require ( '../../../lib/image' ) ;
6+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
67
78var gd = createGraphDiv ( ) ;
89
@@ -112,6 +113,8 @@ tests.forEach(function(spec, index) {
112113
113114 if ( t === nTimes && index === tests . length - 1 ) {
114115 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
116+
117+ writeRawDataToCSV ( 'image' , tests ) ;
115118 }
116119 } ) ;
117120 } ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ var createGraphDiv = require('../assets/create_graph_div');
22var delay = require ( '../assets/delay' ) ;
33var d3SelectAll = require ( '../../strict-d3' ) . selectAll ;
44var Plotly = require ( '../../../lib/core' ) ;
5+ var writeRawDataToCSV = require ( './assets/post_process' ) . writeRawDataToCSV ;
56
67var gd = createGraphDiv ( ) ;
78
@@ -92,6 +93,8 @@ tests.forEach(function(spec, index) {
9293
9394 if ( t === nTimes && index === tests . length - 1 ) {
9495 console . log ( JSON . stringify ( tests , null , 2 ) ) ;
96+
97+ writeRawDataToCSV ( 'scatter' , tests ) ;
9598 }
9699 } ) ;
97100 } ) ;
You can’t perform that action at this time.
0 commit comments