Skip to content
Open
3 changes: 3 additions & 0 deletions code-gen-library/AirplaneSeats/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/AnalyzeSales/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/AthletesData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/CountryStats/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/EmployeesData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/FinancialDataAll/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
10 changes: 3 additions & 7 deletions code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[{
"platform": "WebComponents",
"location": "jsonFile"
},{
"platform": "React",
"location": "jsonFile"
}]
{
"location": "CDN"
}
10 changes: 3 additions & 7 deletions code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[{
"platform": "WebComponents",
"location": "jsonFile"
},{
"platform": "React",
"location": "jsonFile"
}]
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/InvoicesData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/PivotData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/PivotDataFlat/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/PivotSalesData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/SalesData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/SingersCustomers/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
10 changes: 3 additions & 7 deletions code-gen-library/SingersData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[{
"platform": "WebComponents",
"location": "jsonFile"
},{
"platform": "React",
"location": "jsonFile"
}]
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockAmazon/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockGoogle/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockMarket100/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockMarket1000/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockMarket2000/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockMarket500/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockMicrosoft/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockSP500Cap/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/StockTesla/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldAustralianData/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCapitals/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCities/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldCountries/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
3 changes: 3 additions & 0 deletions code-gen-library/WorldStats/XPLAT-CONFIG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"location": "CDN"
}
105 changes: 97 additions & 8 deletions code-gen-tools/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ function sortJSON(cb) {

// let filePath = CodeGenLib + "/WorldCitiesAbove500K/XPLAT.json";
let filePath = CodeGenLib + "/WorldCountries/XPLAT.json";
// let filePath = CodeGenLib + "/AthletesData/XPLAT.json";
let file = fs.readFileSync(filePath, "utf8");
let dataItems = JSON.parse(file);

// dataItems = dataItems.sort((a, b) => a.Pop < b.Pop ? 1 : -1);
dataItems = dataItems.sort((a, b) => a.Population < b.Population ? 1 : -1);
// dataItems = dataItems.sort((a, b) => a.Population < b.Population ? 1 : -1);
dataItems = dataItems.sort((a, b) => a.Id > b.Id ? 1 : -1);

for (let i = 0; i < dataItems.length; i++) {
// dataItems[i].ID = 10000 + i;
Expand Down Expand Up @@ -767,18 +770,33 @@ exports.copyCDN = gulp.series(

exports.compactJSON = function compactJSON(cb) {
let filePaths = [
// "/AnalyzeOrders/XPLAT.json",
"/CompanyEmployees/XPLAT.json",
"/CompanyData/XPLAT.json",
"/InvoicesData/XPLAT.json",
"/PivotDataFlat/XPLAT.json",
"/PivotSalesData/XPLAT.json",
"/ProductSales/XPLAT.json",
// "/AnalyzeOrders/XPLAT.json",
// "/AnalyzeSales/XPLAT.json",
// "/AthletesData/XPLAT.json",
"/InvoicesWorldData/XPLAT.json",
"/PivotData/XPLAT.json",
// "/CompanyEmployees/XPLAT.json",
// "/CompanyData/XPLAT.json",
// "/InvoicesData/XPLAT.json",
// "/PivotDataFlat/XPLAT.json",
// "/PivotSalesData/XPLAT.json",
// "/ProductSales/XPLAT.json",
// "/NwindLocations/XPLAT.json",
// "/ProductSales/XPLAT.json",
// "/FinancialDataCurrencies/XPLAT.json",
// "/FinancialDataFuel/XPLAT.json",
// "/FinancialDataMetals/XPLAT.json",
// "/InvoicesData/XPLAT.json",
// "/InvoicesWorldData/XPLAT.json",
// "/EmployeesData/XPLAT.json",
// "/EmployeesFlatAvatars/XPLAT.json",
// "/EmployeesFlatData/XPLAT.json",
// "/EmployeesFlatDetails/XPLAT.json",
// "/ProductSales/XPLAT.json",
// "/ProductInventory/XPLAT.json",
// "/RoleplayDataStats/XPLAT.json",
// "/RoleplayTreeGridData/XPLAT.json",
// "/NwindData/XPLAT.json",
];
for (const filePath of filePaths) {
let file = fs.readFileSync(CodeGenLib + filePath, "utf8");
Expand Down Expand Up @@ -2186,4 +2204,75 @@ exports.correctJSON = function correctJSON(cb)
.on("end", function() {
cb();
});
}
}

exports.findDataFiles = function findDataFiles(cb)
{
var largeDataSources = [ 'SingersData',
"AirplaneSeats",
"AnalyzeSales",
"AthletesData",
"AthletesDataExtended",
"CountryStats",
"CountyHierarchicalData",
"EmployeesData",
"FinancialDataAll",
"FinancialDataCurrencies",
"FinancialDataFuel",
"FinancialDataMetals",
"HierarchicalCustomers",
"HierarchicalCustomersData",
"InvoicesData",
"InvoicesWorldData",
"PivotData",
"PivotDataFlat",
"PivotSalesData",
"SalesData",
"SingersCustomers",
"StockAmazon",
"StockGoogle",
"StockMarket100",
"StockMarket1000",
"StockMarket2000",
"StockMarket500",
"StockSP500Cap",
"StockMicrosoft",
"StockTesla",
"WorldAustralianData",
"WorldCapitals",
"WorldCities",
"WorldCitiesAbove100K",
"WorldCitiesAbove15K",
"WorldCitiesAbove1M",
"WorldCitiesAbove500K",
"WorldCountries",
"WorldStats"];
gulp.src([ '../samples/**/*.json'])
.pipe(es.map(function(file, fileCallback) {
let content = file.contents.toString();
if (content.indexOf("skipAlterDataCasing") <= 0) {

for (let i = 0; i < largeDataSources.length; i++) {
const ds = largeDataSources[i];
if (content.indexOf(ds) >= 0) {
console.log(file.dirname + '/' + file.basename + " \t" + ds);
break;
}
}

// let lines = content.split('\n');
// var dataSource = "";
// for (let i = 0; i < lines.length; i++) {
// const item = lines[i];
// if (item.indexOf("dataSource") >= 0) {
// dataSource = item;
// }
// }
// console.log(file.dirname + '/' + file.basename + " \t" + dataSource);
}
fileCallback(null, file);
}))
.on("end", function() {
cb();
});
}
11 changes: 11 additions & 0 deletions code-gen-tools/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,18 @@ exports.saveJSON = saveJSON = function saveJSON(filePath, dataItems, mode) {
}

let jsonStr = "[\r\n" + lines.join('\r\n') + "\r\n]";
jsonStr = utils.strReplace(jsonStr, '":0', '": 0')
jsonStr = utils.strReplace(jsonStr, '":1', '": 1')
jsonStr = utils.strReplace(jsonStr, '":2', '": 2')
jsonStr = utils.strReplace(jsonStr, '":3', '": 3')
jsonStr = utils.strReplace(jsonStr, '":4', '": 4')
jsonStr = utils.strReplace(jsonStr, '":5', '": 5')
jsonStr = utils.strReplace(jsonStr, '":6', '": 6')
jsonStr = utils.strReplace(jsonStr, '":7', '": 7')
jsonStr = utils.strReplace(jsonStr, '":8', '": 8')
jsonStr = utils.strReplace(jsonStr, '":9', '": 9')
jsonStr = utils.strReplace(jsonStr, ":", ": ")
jsonStr = utils.strReplace(jsonStr, '00: 00', '00:00')
jsonStr = utils.strReplace(jsonStr, ',"', ', "')
jsonStr = utils.strReplace(jsonStr, '{', '{ ')
jsonStr = utils.strReplace(jsonStr, '}', ' }')
Expand Down
1 change: 1 addition & 0 deletions samples/charts/data-chart/data-legend.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"todo1": "replace CountryDemographicEurope with CountryStatsEurope",
"todo2": "replace CountryDemographicAfrican with CountryStatsAfrica",
"strings": {
Expand Down
1 change: 1 addition & 0 deletions samples/charts/data-chart/data-tooltip.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"todo1": "replace CountryDemographicEurope with CountryStatsEurope",
"todo2": "replace CountryDemographicAfrican with CountryStatsAfrica",
"strings": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"descriptions": {
"content": {
"type": "DataChart",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"strings": {
"legendTitle": "Total Population of Selected Countries"
},
Expand Down
1 change: 1 addition & 0 deletions samples/charts/data-chart/scatter-point-chart.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"todo1": "replace CountryDemographicEurope with CountryStatsEurope",
"todo2": "replace CountryDemographicAfrican with CountryStatsAfrica",
"strings": {
Expand Down
1 change: 1 addition & 0 deletions samples/charts/data-chart/scatter-point-with-callouts.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"export": false,
"descriptions": {
"legend": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"descriptions": {
"legend": {
"type": "DataLegend",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"descriptions": {
"content": {
"type": "FinancialChart",
Expand Down
2 changes: 2 additions & 0 deletions samples/charts/tree-map/highlighting.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"skipAlterDataCasing": true,
"export": true,
"strings": {
"legendTitle": "Comparing Population of Countries"
},
Expand Down
1 change: 1 addition & 0 deletions samples/charts/tree-map/layout.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"strings": {
"legendTitle": "Comparing Population of Countries"
},
Expand Down
1 change: 1 addition & 0 deletions samples/charts/tree-map/overview.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"skipAlterDataCasing": true,
"strings": {
"legendTitle": "Comparing Population of Countries"
},
Expand Down
Loading