From 071423aad81dc9fe411fbf6e0c4447771239622c Mon Sep 17 00:00:00 2001 From: HUSSAR-mtrela Date: Thu, 23 May 2024 13:02:14 -0400 Subject: [PATCH 1/8] enable fetching large data files --- code-gen-library/AirplaneSeats/XPLAT-CONFIG.json | 3 +++ code-gen-library/AnalyzeSales/XPLAT-CONFIG.json | 3 +++ code-gen-library/AthletesData/XPLAT-CONFIG.json | 3 +++ .../AthletesDataExtended/XPLAT-CONFIG.json | 3 +++ code-gen-library/CountryStats/XPLAT-CONFIG.json | 3 +++ .../CountyHierarchicalData/XPLAT-CONFIG.json | 3 +++ code-gen-library/EmployeesData/XPLAT-CONFIG.json | 3 +++ code-gen-library/FinancialDataAll/XPLAT-CONFIG.json | 3 +++ .../FinancialDataCurrencies/XPLAT-CONFIG.json | 3 +++ code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json | 3 +++ code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json | 3 +++ .../HierarchicalCustomers/XPLAT-CONFIG.json | 10 +++------- .../HierarchicalCustomersData/XPLAT-CONFIG.json | 10 +++------- code-gen-library/InvoicesData/XPLAT-CONFIG.json | 3 +++ code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json | 3 +++ code-gen-library/PivotData/XPLAT-CONFIG.json | 3 +++ code-gen-library/PivotDataFlat/XPLAT-CONFIG.json | 3 +++ code-gen-library/PivotSalesData/XPLAT-CONFIG.json | 3 +++ code-gen-library/SalesData/XPLAT-CONFIG.json | 3 +++ code-gen-library/SingersCustomers/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockAmazon/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockGoogle/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockMarket100/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockMarket1000/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockMarket2000/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockMarket500/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockMicrosoft/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockSP500Cap/XPLAT-CONFIG.json | 3 +++ code-gen-library/StockTesla/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldAustralianData/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldCapitals/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldCities/XPLAT-CONFIG.json | 3 +++ .../WorldCitiesAbove100K/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json | 3 +++ .../WorldCitiesAbove500K/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldCountries/XPLAT-CONFIG.json | 3 +++ code-gen-library/WorldStats/XPLAT-CONFIG.json | 3 +++ 38 files changed, 114 insertions(+), 14 deletions(-) create mode 100644 code-gen-library/AirplaneSeats/XPLAT-CONFIG.json create mode 100644 code-gen-library/AnalyzeSales/XPLAT-CONFIG.json create mode 100644 code-gen-library/AthletesData/XPLAT-CONFIG.json create mode 100644 code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json create mode 100644 code-gen-library/CountryStats/XPLAT-CONFIG.json create mode 100644 code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json create mode 100644 code-gen-library/EmployeesData/XPLAT-CONFIG.json create mode 100644 code-gen-library/FinancialDataAll/XPLAT-CONFIG.json create mode 100644 code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json create mode 100644 code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json create mode 100644 code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json create mode 100644 code-gen-library/InvoicesData/XPLAT-CONFIG.json create mode 100644 code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json create mode 100644 code-gen-library/PivotData/XPLAT-CONFIG.json create mode 100644 code-gen-library/PivotDataFlat/XPLAT-CONFIG.json create mode 100644 code-gen-library/PivotSalesData/XPLAT-CONFIG.json create mode 100644 code-gen-library/SalesData/XPLAT-CONFIG.json create mode 100644 code-gen-library/SingersCustomers/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockAmazon/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockGoogle/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockMarket100/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockMarket1000/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockMarket2000/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockMarket500/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockMicrosoft/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockSP500Cap/XPLAT-CONFIG.json create mode 100644 code-gen-library/StockTesla/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldAustralianData/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCapitals/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCities/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldCountries/XPLAT-CONFIG.json create mode 100644 code-gen-library/WorldStats/XPLAT-CONFIG.json diff --git a/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json b/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/AirplaneSeats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json b/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/AnalyzeSales/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AthletesData/XPLAT-CONFIG.json b/code-gen-library/AthletesData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/AthletesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json b/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/AthletesDataExtended/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/CountryStats/XPLAT-CONFIG.json b/code-gen-library/CountryStats/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/CountryStats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json b/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/CountyHierarchicalData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/EmployeesData/XPLAT-CONFIG.json b/code-gen-library/EmployeesData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/EmployeesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json b/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/FinancialDataAll/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json b/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/FinancialDataCurrencies/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json b/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/FinancialDataFuel/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json b/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/FinancialDataMetals/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json b/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json index c4834c373..6f7f1c3a8 100644 --- a/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json +++ b/code-gen-library/HierarchicalCustomers/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} diff --git a/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json b/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json index c4834c373..6f7f1c3a8 100644 --- a/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json +++ b/code-gen-library/HierarchicalCustomersData/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} diff --git a/code-gen-library/InvoicesData/XPLAT-CONFIG.json b/code-gen-library/InvoicesData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/InvoicesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json b/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/InvoicesWorldData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotData/XPLAT-CONFIG.json b/code-gen-library/PivotData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/PivotData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json b/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/PivotDataFlat/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/PivotSalesData/XPLAT-CONFIG.json b/code-gen-library/PivotSalesData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/PivotSalesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/SalesData/XPLAT-CONFIG.json b/code-gen-library/SalesData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/SalesData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/SingersCustomers/XPLAT-CONFIG.json b/code-gen-library/SingersCustomers/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/SingersCustomers/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockAmazon/XPLAT-CONFIG.json b/code-gen-library/StockAmazon/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockAmazon/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockGoogle/XPLAT-CONFIG.json b/code-gen-library/StockGoogle/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockGoogle/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket100/XPLAT-CONFIG.json b/code-gen-library/StockMarket100/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockMarket100/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket1000/XPLAT-CONFIG.json b/code-gen-library/StockMarket1000/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockMarket1000/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket2000/XPLAT-CONFIG.json b/code-gen-library/StockMarket2000/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockMarket2000/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMarket500/XPLAT-CONFIG.json b/code-gen-library/StockMarket500/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockMarket500/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json b/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockMicrosoft/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json b/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockSP500Cap/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/StockTesla/XPLAT-CONFIG.json b/code-gen-library/StockTesla/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/StockTesla/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json b/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldAustralianData/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCapitals/XPLAT-CONFIG.json b/code-gen-library/WorldCapitals/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCapitals/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCities/XPLAT-CONFIG.json b/code-gen-library/WorldCities/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCities/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCitiesAbove100K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCitiesAbove15K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCitiesAbove1M/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json b/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCitiesAbove500K/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldCountries/XPLAT-CONFIG.json b/code-gen-library/WorldCountries/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldCountries/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} diff --git a/code-gen-library/WorldStats/XPLAT-CONFIG.json b/code-gen-library/WorldStats/XPLAT-CONFIG.json new file mode 100644 index 000000000..6f7f1c3a8 --- /dev/null +++ b/code-gen-library/WorldStats/XPLAT-CONFIG.json @@ -0,0 +1,3 @@ +{ + "location": "CDN" +} From 551e23fc06ab5597fb8f4c2916effed33cba4cde Mon Sep 17 00:00:00 2001 From: HUSSAR-mtrela Date: Fri, 24 May 2024 12:37:41 -0400 Subject: [PATCH 2/8] no data casing for remote data sources --- samples/charts/data-chart/scatter-bubble-chart-fill-scale.json | 1 + .../charts/data-chart/scatter-bubble-chart-single-source.json | 1 + samples/charts/data-chart/scatter-point-with-callouts.json | 1 + samples/charts/financial-chart/data-legend-styling-props.json | 1 + samples/charts/financial-chart/data-tooltip-styling-props.json | 1 + samples/charts/tree-map/highlighting.json | 1 + samples/charts/tree-map/layout.json | 1 + samples/charts/tree-map/overview.json | 1 + samples/charts/tree-map/styling.json | 1 + samples/maps/geo-map/geo-symbol-map-with-callouts.json | 1 + 10 files changed, 10 insertions(+) diff --git a/samples/charts/data-chart/scatter-bubble-chart-fill-scale.json b/samples/charts/data-chart/scatter-bubble-chart-fill-scale.json index d93e4091d..67d2b25eb 100644 --- a/samples/charts/data-chart/scatter-bubble-chart-fill-scale.json +++ b/samples/charts/data-chart/scatter-bubble-chart-fill-scale.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "descriptions": { "content": { "type": "DataChart", diff --git a/samples/charts/data-chart/scatter-bubble-chart-single-source.json b/samples/charts/data-chart/scatter-bubble-chart-single-source.json index 1ddd961bc..6daf6b501 100644 --- a/samples/charts/data-chart/scatter-bubble-chart-single-source.json +++ b/samples/charts/data-chart/scatter-bubble-chart-single-source.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Total Population of Selected Countries" }, diff --git a/samples/charts/data-chart/scatter-point-with-callouts.json b/samples/charts/data-chart/scatter-point-with-callouts.json index b2c83460e..e5a822d57 100644 --- a/samples/charts/data-chart/scatter-point-with-callouts.json +++ b/samples/charts/data-chart/scatter-point-with-callouts.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "export": false, "descriptions": { "legend": { diff --git a/samples/charts/financial-chart/data-legend-styling-props.json b/samples/charts/financial-chart/data-legend-styling-props.json index aaf259cb1..cb2ff3fec 100644 --- a/samples/charts/financial-chart/data-legend-styling-props.json +++ b/samples/charts/financial-chart/data-legend-styling-props.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "descriptions": { "legend": { "type": "DataLegend", diff --git a/samples/charts/financial-chart/data-tooltip-styling-props.json b/samples/charts/financial-chart/data-tooltip-styling-props.json index 60fd82f65..05dc4d2c9 100644 --- a/samples/charts/financial-chart/data-tooltip-styling-props.json +++ b/samples/charts/financial-chart/data-tooltip-styling-props.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "descriptions": { "content": { "type": "FinancialChart", diff --git a/samples/charts/tree-map/highlighting.json b/samples/charts/tree-map/highlighting.json index aa798ee25..16e584996 100644 --- a/samples/charts/tree-map/highlighting.json +++ b/samples/charts/tree-map/highlighting.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "export": false, "strings": { "legendTitle": "Comparing Population of Countries" diff --git a/samples/charts/tree-map/layout.json b/samples/charts/tree-map/layout.json index 281391983..025b909c5 100644 --- a/samples/charts/tree-map/layout.json +++ b/samples/charts/tree-map/layout.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Comparing Population of Countries" }, diff --git a/samples/charts/tree-map/overview.json b/samples/charts/tree-map/overview.json index 7d4e8f590..a77ed4a3d 100644 --- a/samples/charts/tree-map/overview.json +++ b/samples/charts/tree-map/overview.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Comparing Population of Countries" }, diff --git a/samples/charts/tree-map/styling.json b/samples/charts/tree-map/styling.json index f8405f3af..c3c051309 100644 --- a/samples/charts/tree-map/styling.json +++ b/samples/charts/tree-map/styling.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Comparing Population of Countries" }, diff --git a/samples/maps/geo-map/geo-symbol-map-with-callouts.json b/samples/maps/geo-map/geo-symbol-map-with-callouts.json index 89c689af4..223c71f14 100644 --- a/samples/maps/geo-map/geo-symbol-map-with-callouts.json +++ b/samples/maps/geo-map/geo-symbol-map-with-callouts.json @@ -1,5 +1,6 @@ { "export": false, + "skipAlterDataCasing": true, "descriptions": { "legend": { "type": "Legend", From 2806e9c7d9734330cbf31da48b3ce78a04716083 Mon Sep 17 00:00:00 2001 From: HUSSAR-mtrela Date: Fri, 24 May 2024 12:45:18 -0400 Subject: [PATCH 3/8] skip casing for remote data sources --- samples/charts/data-chart/data-legend.json | 1 + samples/charts/data-chart/data-tooltip.json | 1 + .../charts/data-chart/scatter-bubble-chart-multiple-sources.json | 1 + samples/charts/data-chart/scatter-bubble-chart-styling.json | 1 + samples/charts/data-chart/scatter-point-chart.json | 1 + 5 files changed, 5 insertions(+) diff --git a/samples/charts/data-chart/data-legend.json b/samples/charts/data-chart/data-legend.json index aab37306d..07db867df 100644 --- a/samples/charts/data-chart/data-legend.json +++ b/samples/charts/data-chart/data-legend.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "todo1": "replace CountryDemographicEurope with CountryStatsEurope", "todo2": "replace CountryDemographicAfrican with CountryStatsAfrica", "strings": { diff --git a/samples/charts/data-chart/data-tooltip.json b/samples/charts/data-chart/data-tooltip.json index 14a64aa3e..7bee4a9b7 100644 --- a/samples/charts/data-chart/data-tooltip.json +++ b/samples/charts/data-chart/data-tooltip.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "todo1": "replace CountryDemographicEurope with CountryStatsEurope", "todo2": "replace CountryDemographicAfrican with CountryStatsAfrica", "strings": { diff --git a/samples/charts/data-chart/scatter-bubble-chart-multiple-sources.json b/samples/charts/data-chart/scatter-bubble-chart-multiple-sources.json index 21fa7b9fc..ff8b88dec 100644 --- a/samples/charts/data-chart/scatter-bubble-chart-multiple-sources.json +++ b/samples/charts/data-chart/scatter-bubble-chart-multiple-sources.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Total Population of Selected Countries" }, diff --git a/samples/charts/data-chart/scatter-bubble-chart-styling.json b/samples/charts/data-chart/scatter-bubble-chart-styling.json index be39c9cae..35353eaa4 100644 --- a/samples/charts/data-chart/scatter-bubble-chart-styling.json +++ b/samples/charts/data-chart/scatter-bubble-chart-styling.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "strings": { "legendTitle": "Total Population of Selected Countries" }, diff --git a/samples/charts/data-chart/scatter-point-chart.json b/samples/charts/data-chart/scatter-point-chart.json index b109d141a..dd9fabb65 100644 --- a/samples/charts/data-chart/scatter-point-chart.json +++ b/samples/charts/data-chart/scatter-point-chart.json @@ -1,4 +1,5 @@ { + "skipAlterDataCasing": true, "todo1": "replace CountryDemographicEurope with CountryStatsEurope", "todo2": "replace CountryDemographicAfrican with CountryStatsAfrica", "strings": { From a2912ab326c0242d80e8ba896aa262022583d8b9 Mon Sep 17 00:00:00 2001 From: HUSSAR-mtrela Date: Tue, 28 May 2024 10:35:36 -0400 Subject: [PATCH 4/8] add findDataFiles --- code-gen-tools/gulpfile.js | 71 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/code-gen-tools/gulpfile.js b/code-gen-tools/gulpfile.js index 9f37b525c..aca232315 100644 --- a/code-gen-tools/gulpfile.js +++ b/code-gen-tools/gulpfile.js @@ -154,6 +154,77 @@ exports.filterJSON = function filterJSON(cb) { 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(); + }); +} + exports.copyCDN = function copyCDN(cb) { var cdnTable = []; From ebb83347bb565aff392c00d5b7b6f0b1637d1c63 Mon Sep 17 00:00:00 2001 From: "HUSSAR-mtrela (Martin Trela)" Date: Mon, 15 Jul 2024 16:48:21 -0400 Subject: [PATCH 5/8] update copyCDN --- code-gen-tools/gulpfile.js | 55 ++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/code-gen-tools/gulpfile.js b/code-gen-tools/gulpfile.js index 8e065ea8a..b308db724 100644 --- a/code-gen-tools/gulpfile.js +++ b/code-gen-tools/gulpfile.js @@ -239,14 +239,15 @@ exports.findDataFiles = function findDataFiles(cb) exports.copyCDN = function copyCDN(cb) { var cdnTable = []; - var cdnWebsite = 'https://static.infragistics.com/xplatform/library/'; - var cdnServer = '//s0706dl2.igweb.local/download.infragistics.com/xplatform/library'; + var cdnWebsite = 'https://static.infragistics.com/xplatform/cdn/'; + var cdnServer = ' \\\\s0706dl2.igweb.local\\download.infragistics.com\\xplatform\\cdn'; var cdnOutput = './CDN'; - // del(cdnOutput); console.log('--------------------------------------------------------------------'); console.log('copying large data files from code-gen-library to: ' + cdnOutput); console.log('--------------------------------------------------------------------'); + // del(cdnOutput); + gulp.src([ // process all files and determine large files based on number of data items and data columns CodeGenLib + '/**/XPLAT.json', @@ -301,36 +302,53 @@ exports.copyCDN = function copyCDN(cb) let dirname = file.dirname.split('code-gen-library\\')[1]; // copy only files that have many items and/or many data columns - if (items.length >= 100 || (items.length * columns.length >= 500)) { + if (items.length >= 100 || (items.length * columns.length >= 500) || dirname === "SingersData") { console.log(CodeGenLib + '/' + dirname + '/XPLAT.json copied with ' + items.length + ' items'); // console.log('CodeGenLib + "/' + dirname + '/XPLAT.json",'); var itemsCount = items.length.toString(); var columnsCount = columns.length.toString(); var row = " " + itemsCount.padStart(Math.max(10, itemsCount.length), ' ') + " " + - " " + columnsCount.padStart(Math.max(12, columnsCount.length), ' ') + " " + - " " + "" + dirname + " \r\n"; + " " + columnsCount.padStart(Math.max(12, columnsCount.length), ' ') + " " + + " " + "" + dirname + " \r\n"; cdnTable += row; // copy to cdn output saveFile(cdnOutput + "/" + dirname + ".json", content, true); // create config file that enables remote location for data file saveFile(CodeGenLib + '/' + dirname + '/XPLAT-CONFIG.json', '{\r\n' + '\t"location": "CDN"\r\n' + '}\r\n', true); } + // console.log(items.length + " " + (items.length * columns.length) + " " + dirname); fileCallback(null, file); })) // .pipe(gulp.dest(cdnOutput, {overwrite: true})) .on("end", function() { var repo = 'https://github.com/IgniteUI/igniteui-xplat-examples/tree/23.2.x'; - var readme = '

Data Library for XPLAT Samples

\r\n\r\n' + - '

This CDN folder contains data files used by XPLAT samples.

\r\n\r\n' + - '

Use copyCDN script to prepare data files in CodeGen library for manual upload to the CDN. This way, files on CDN stay in-sync with files in CodeGen library.

\r\n\r\n' + + var angular = 'https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext'; + var blazor = 'https://github.com/IgniteUI/igniteui-blazor-examples/tree/vnext'; + var react = 'https://github.com/IgniteUI/igniteui-react-examples/tree/vnext'; + var wc = 'https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext'; + var readme = '

Data Files for Cross-Platform Samples

\r\n\r\n' + + '

This CDN folder contains data files used by ' + + 'xplat, ' + + 'angular, ' + + 'blazor, ' + + 'react, and ' + + 'web-component samples' + + '

\r\n\r\n' + + '

Use the copyCDN gulp script to collect data files from CodeGen library before manually uploading them to the CDN network location. This way, files on CDN stay in-sync with files in CodeGen library.

\r\n\r\n' + '

CodeGen Library

\r\n\r\n' + '

The CodeGen library is located on GitHub and CDN has a copy of these files:

\r\n\r\n' + '\r\n' + - ' \r\n' + + ' \r\n' + cdnTable + '
Data Items Data Columns Data Link
Data Items Data Columns Data Link
'; + var css = ' ' + // saveFile(cdnOutput + "/_Readme.md", readme, true); - saveFile(cdnOutput + "/_Readme.html", '\r\n' + readme + '\r\n\r\n', true); + saveFile(cdnOutput + "/.Readme.html", ' ' + css + '\r\n' + readme + '\r\n\r\n', true); // if (cdnOutput.indexOf('igweb.local/download.infragistics.com') < 0) { console.log("\n WARNING: You must copy content of the this CDN folder to:\n" + cdnServer + "\n") @@ -342,12 +360,15 @@ exports.copyCDN = function copyCDN(cb) 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", + // "/AnalyzeSales/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", From ca0ef497494c79162ad4116a6302c8233fc44d94 Mon Sep 17 00:00:00 2001 From: "HUSSAR-mtrela (Martin Trela)" Date: Mon, 15 Jul 2024 16:51:05 -0400 Subject: [PATCH 6/8] enable remote-data --- code-gen-library/SingersData/XPLAT-CONFIG.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/code-gen-library/SingersData/XPLAT-CONFIG.json b/code-gen-library/SingersData/XPLAT-CONFIG.json index c4834c373..6f7f1c3a8 100644 --- a/code-gen-library/SingersData/XPLAT-CONFIG.json +++ b/code-gen-library/SingersData/XPLAT-CONFIG.json @@ -1,7 +1,3 @@ -[{ - "platform": "WebComponents", - "location": "jsonFile" -},{ - "platform": "React", - "location": "jsonFile" -}] \ No newline at end of file +{ + "location": "CDN" +} From f3ed1f195582c8083c6dacd7d9273889d3283e4b Mon Sep 17 00:00:00 2001 From: "HUSSAR-mtrela (Martin Trela)" Date: Fri, 19 Jul 2024 11:07:40 -0400 Subject: [PATCH 7/8] fix gulp script --- code-gen-tools/gulpfile.js | 40 ++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/code-gen-tools/gulpfile.js b/code-gen-tools/gulpfile.js index b308db724..7b158adf3 100644 --- a/code-gen-tools/gulpfile.js +++ b/code-gen-tools/gulpfile.js @@ -48,11 +48,27 @@ function saveJSON(filePath, dataItems, mode) { } let jsonStr = "[\r\n" + lines.join('\r\n') + "\r\n]"; - jsonStr = utils.strReplace(jsonStr, ":", ": ") + // jsonStr = utils.strReplace(jsonStr, ":", ": ") + // jsonStr = utils.strReplace(jsonStr, ": ", ":") + // jsonStr = utils.strReplace(jsonStr, '": ', '": ') + // jsonStr = utils.strReplace(jsonStr, '": ', '": ') + 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, ' -1', '-1') jsonStr = utils.strReplace(jsonStr, ',"', ', "') jsonStr = utils.strReplace(jsonStr, '{', '{ ') jsonStr = utils.strReplace(jsonStr, '}', ' }') - + saveFile(filePath, jsonStr); } } @@ -110,12 +126,15 @@ exports.cleanJSON = function cleanJSON(input, cb) { function sortJSON(cb) { // let filePath = CodeGenLib + "/WorldCitiesAbove500K/XPLAT.json"; - let filePath = CodeGenLib + "/WorldCountries/XPLAT.json"; + let filePath = CodeGenLib + "/AthletesData/XPLAT.json"; + // let filePath = CodeGenLib + "/AthletesDataExtended/XPLAT.json"; + // let filePath = CodeGenLib + "/WorldCountries/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; @@ -374,6 +393,19 @@ exports.compactJSON = function compactJSON(cb) { // "/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", + // "/AnalyzeSales/XPLAT.json", + "/AthletesData/XPLAT.json", ]; for (const filePath of filePaths) { let file = fs.readFileSync(CodeGenLib + filePath, "utf8"); From dd3b7b36dfd948bf442daafe4b472a378db322bb Mon Sep 17 00:00:00 2001 From: "HUSSAR-mtrela (Martin Trela)" Date: Wed, 3 Dec 2025 15:01:45 -0500 Subject: [PATCH 8/8] resolve conflicts in gulpfile --- code-gen-tools/gulpfile.js | 741 +++++++++++++++++++++++++++---------- code-gen-tools/utils.js | 11 + 2 files changed, 564 insertions(+), 188 deletions(-) diff --git a/code-gen-tools/gulpfile.js b/code-gen-tools/gulpfile.js index 80614ca66..fb271008e 100644 --- a/code-gen-tools/gulpfile.js +++ b/code-gen-tools/gulpfile.js @@ -15,71 +15,24 @@ function log(msg) { let CodeGenLib = "../code-gen-library"; -gulp.task('testCodeGenLib', function(cb) { - - console.log('testCodeGenLib ' + toString()); - // console.log(process.argv); - cb(); -}); - -function saveFile(filePath, fileContent, skipLog) { - var dirname = path.dirname(filePath); - if (!fs.existsSync(dirname)) { - fs.mkdirSync(dirname); // ensure directory exists - } - if (!skipLog) { - console.log("saving " + filePath); - } - fs.writeFileSync(filePath, fileContent); -} - -function saveJSON(filePath, dataItems, mode) { - if (mode === undefined) { - let jsonStr = JSON.stringify(dataItems, null, ' ') - saveFile(filePath, jsonStr); - } - - if (mode === "compact") { - let lines = []; - for (let i = 0; i < dataItems.length; i++) { - const item = dataItems[i]; - let line = JSON.stringify(item); - if (i < dataItems.length - 1) line += "," - lines.push(line); - } - - let jsonStr = "[\r\n" + lines.join('\r\n') + "\r\n]"; - // jsonStr = utils.strReplace(jsonStr, ":", ": ") - // jsonStr = utils.strReplace(jsonStr, ": ", ":") - // jsonStr = utils.strReplace(jsonStr, '": ', '": ') - // jsonStr = utils.strReplace(jsonStr, '": ', '": ') - 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, ' -1', '-1') - jsonStr = utils.strReplace(jsonStr, ',"', ', "') - jsonStr = utils.strReplace(jsonStr, '{', '{ ') - jsonStr = utils.strReplace(jsonStr, '}', ' }') - - saveFile(filePath, jsonStr); - } -} - -exports.toJSON = function toJSON(csvPath, cb) { - - if (csvPath === undefined) { - csvPath = CodeGenLib + "/TestData/SOURCE.json"; - } -} +let xplatRepoName = 'IgniteUI/igniteui-xplat-examples/'; +let xplatBranch = '25.1'; +let xplatCodeGenLib = 'code-gen-library'; +let xplatCodeGenLibGit = 'https://github.com/' + xplatRepoName + '/blob/' + xplatBranch + '/' + xplatCodeGenLib + '/'; +let xplatCodeGenLibRaw = 'raw.githubusercontent.com/' + xplatRepoName + '/refs/head/' + xplatBranch + '/' + xplatCodeGenLib + '/'; +// https://github.com/IgniteUI/igniteui-xplat-examples//blob /25.1/code-gen-library/AnalyzeSales/XPLAT.json +// https://raw.githubusercontent.com/IgniteUI/igniteui-xplat-examples/refs/heads/25.1/code-gen-library/AnalyzeSales/XPLAT.json + + +// TODO replace following strings: where XPLAT-CDN = 'https://dl.infragistics.com/x/' +// https://static.infragistics.com/xplatform/images/flags/iso2 https:/XPLAT-CDN/img/flags/png//small/2 +// https://static.infragistics.com/xplatform/images/people/women/ https:/XPLAT-CDN/img/people/women/ +// https://static.infragistics.com/xplatform/images/people/men/ https:/XPLAT-CDN/img/people/men/ +// https://static.infragistics.com/xplatform/images/grid/ https:/XPLAT-CDN/img/grid/ +// https://www.infragistics.com/angular-demos-lob/assets/images/women/ https:/XPLAT-CDN/img/people/women/ +// https://www.infragistics.com/angular-demos-lob/assets/images/men/ https:/XPLAT-CDN/img/people/men/ +// https://www.infragistics.com/angular-demos-lob/assets/images/card/avatars https:/XPLAT-CDN/img/card/avatars/ + exports.cleanJSON = function cleanJSON(input, cb) { @@ -127,13 +80,13 @@ exports.cleanJSON = function cleanJSON(input, cb) { function sortJSON(cb) { // let filePath = CodeGenLib + "/WorldCitiesAbove500K/XPLAT.json"; - let filePath = CodeGenLib + "/AthletesData/XPLAT.json"; - // let filePath = CodeGenLib + "/AthletesDataExtended/XPLAT.json"; - // let filePath = CodeGenLib + "/WorldCountries/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); @@ -275,89 +228,391 @@ exports.filterJSON = function filterJSON(cb) { 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) { +let flagsSVG = {}; +function flagsLoadSVG(cb) { + gulp.src(['./img/flags/SVG/3/*.svg', ]) + .pipe(es.map(function(file, fileCallback) { + var iso3 = file.basename.replace('.svg',''); + flagsSVG[iso3] = file.dirname + '\\' + file.basename; + + fileCallback(null, file); + })) + .on("end", function() { + // console.log(flagsSVG); + // console.log("flagsSVG " + Object.keys(flagsSVG).length); + cb(); + }); +} - 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 flagsPNG = {}; +function flagsLoadPNG(cb) { + gulp.src(['./img/flags/PNG/L/3/*.png', ]) + .pipe(es.map(function(file, fileCallback) { + var iso3 = file.basename.replace('.png',''); + flagsPNG[iso3] = file.dirname + '\\' + file.basename; + fileCallback(null, file); + })) + .on("end", function() { + // console.log(flagsPNG); + // console.log("flagsPNG " + Object.keys(flagsPNG).length); + cb(); + }); +} - // 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); +function flagsReadme(cb) { + + // console.log('init'); +// +// + + let H = utils.createHTML(); + + // let jsonPath = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jsonPath = CodeGenLib + "/WorldStats/XPLAT.json"; + let jsonFile = fs.readFileSync(jsonPath, "utf8"); + let jsonData = JSON.parse(jsonFile); + let jsonLookup = utils.hash('Code', jsonData) + + var countries = utils.extract(jsonData, ['Code', 'Short', 'Name', 'Continent', 'Region', 'Status']) + countries.sort((a, b) => a.Name > b.Name ? 1 : -1); + + var flagTable = ""; + + for (let i = 0; i < countries.length; i++) { + const country = countries[i]; + + var pngPath2 = './png/S/2/' + country.Short + '.png'; + var pngPath3 = './png/S/3/' + country.Code + '.png'; + var svgPath2 = './svg/2/' + country.Short + '.svg'; + var svgPath3 = './svg/3/' + country.Code + '.svg'; + // var conPath = '../continents/png/' + country.Continent.replace(' ','-') + '.png'; + + var pngImage = H.img(pngPath3, 40, 25, 'border'); + var svgImage = H.img(svgPath3, 40, 25, 'border'); + // var conImage = H.img(conPath, 40, 25, 'border'); + + // var pngLink2 = H.link(pngPath2, 'P'); + // var pngLink3 = H.link(pngPath3, 'P'); + + // var svgLink2 = H.link(svgPath2, 'S'); + // var svgLink3 = H.link(svgPath3, 'S'); + + let row = H.tr( + H.td(pngImage, 'center') + + H.td(svgImage, 'center') + + // H.td(H.div([svgLink3, pngLink3, country.Code])) + + // H.td(H.div([svgLink2, pngLink2, country.Short])) + + H.td(country.Code) + + H.td(country.Short) + + H.td(country.Name, 'left') + + H.td(country.Continent, 'left') + + // H.td(H.div([conImage, country.Continent]), 'left') + + H.td(country.Region, 'left') + + H.td(country.Status, 'left') + ); + flagTable += row; + } + + var pngSmall2 = './png/S/2/' + 'US' + '.png'; + var pngSmall3 = './png/S/3/' + 'USA' + '.png'; + var pngSmallN = './png/S/N/' + 'United-States' + '.png'; + var pngLarge2 = './png/L/2/' + 'US' + '.png'; + var pngLarge3 = './png/L/3/' + 'USA' + '.png'; + var pngLargeN = './png/L/N/' + 'United-States' + '.png'; + var svgLarge2 = './svg/2/' + 'US' + '.svg'; + var svgLarge3 = './svg/3/' + 'USA' + '.svg'; + var svgLargeN = './svg/N/' + 'United-States' + '.svg'; + + var code = H.html( + H.head( + H.style( + 'body { font-family: sans-serif; }' + + 'table { font-size: 0.75rem; } \r\n' + + 'tr:nth-child(even) { background-color: #eeeded; } \r\n'+ + '.border { border-color: black; border-style: solid; border-width: 0.5px; } \r\n' + + '.center { vertical-align: middle; text-align: center; } \r\n' + + '.right { vertical-align: middle; text-align: right; } \r\n' + + '.left { vertical-align: middle; text-align: left; } \r\n' + ) + ) + + H.body( + H.h1('Flags of Countries') + + H.p('Examples of links to country flags stored in various formats and sizes:') + + H.table( + H.tr( + H.th('Small PNG Flags', 'left', 240) + + H.th('Description', 'left', "60%") + ) + + H.tr( + H.td(H.a(pngSmall2), 'left') + + H.td('Small flags in PNG format with ISO-2 naming convention', 'left') + ) + + H.tr( + H.td(H.a(pngSmall3), 'left') + + H.td('Small flags in PNG format with ISO-3 naming convention', 'left') + ) + + H.tr( + H.td(H.a(pngSmallN), 'left') + + H.td('Small flags in PNG format with full country name', 'left') + ) + ) + + H.table( + H.tr( + H.th('Large PNG Flags', 'left', 240) + + H.th('Description', 'left', "60%") + ) + + H.tr( + H.td(H.a(pngLarge2), 'left') + + H.td('Large flags in PNG format with ISO-2 naming convention', 'left') + ) + + H.tr( + H.td(H.a(pngLarge3), 'left') + + H.td('Large flags in PNG format with ISO-3 naming convention', 'left') + )+ + H.tr( + H.td(H.a(pngLargeN), 'left') + + H.td('Large flags in PNG format with full country name', 'left') + ) + ) + + H.table( + H.tr( + H.th('Scalable SVG Flags', 'left', 240) + + H.th('Description', 'left', "60%") + ) + + H.tr( + H.td(H.a(svgLarge2), 'left') + + H.td('Flags in SVG format with ISO-2 naming convention', 'left') + ) + + H.tr( + H.td(H.a(svgLarge3), 'left') + + H.td('Flags in SVG format with ISO-3 naming convention', 'left') + ) + + H.tr( + H.td(H.a(svgLargeN), 'left') + + H.td('Flags in SVG format with with full country name', 'left') + ) + ) + + H.p('List of flags contained in above folders:') + + H.table( + H.tr( + H.th('PNG', 'center', 60) + + H.th('SVG', 'center', 60) + + H.th('Code', 'center', 60) + + H.th('Short', 'center', 60) + + H.th('Name', 'center', 150) + + H.th('Continent', 'left', 150) + + H.th('Region', 'left', 150) + + H.th('Status', 'left', 150) + ) + + flagTable + ) + ) + ); + + var flagOutput = './CDN/img/flags/readme.html'; + utils.saveFile(flagOutput, code, true); + + cb(); +} +exports.flagsReadme = gulp.series( + // flagsLoadSVG, + // flagsLoadPNG, + flagsReadme, +); + +function renameFlags(cb) { + + let jp = CodeGenLib + "/WorldStats/XPLAT.json"; + // let jp = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jf = fs.readFileSync(jp, "utf8"); + let jsonData = JSON.parse(jf); + let jsonLookup = utils.hash('Code', jsonData) + + // var sourcePath = './CDN/img/flags/png/large/3/*.png'; var outputPath = './CDN/img/flags/png/large/2/'; + // var sourcePath = './CDN/img/flags/png/small/3/*.png'; var outputPath = './CDN/img/flags/png/small/2/'; + // var sourcePath = './CDN/img/flags/svg/3/*.svg'; var outputPath = './CDN/img/flags/svg/2/'; + + // var sourcePath = './CDN/img/flags/png/large/3/*.png'; var outputPath = './CDN/img/flags/png/large/n/'; + // var sourcePath = './CDN/img/flags/png/small/3/*.png'; var outputPath = './CDN/img/flags/png/small/n/'; + var sourcePath = './CDN/img/flags/svg/3/*.svg'; var outputPath = './CDN/img/flags/svg/n/'; + + gulp.src([sourcePath], + ).pipe(rename(function (path) { + var code = path.basename; + + if (jsonLookup[code] === undefined) { + + if (code === "UMI") { path.basename = "UM"; } + else if (code === "BVT") { path.basename = "BV"; } + else + // console.log(path.basename + " ISO3 missing"); + // console.log(path) + path.basename = "SKIP"; } - fileCallback(null, file); + else { + // var n = jsonLookup[code].Name; + // n = n.replaceAll(' ', '-'); + // // n = n.replaceAll('Is.', 'Island'); + // if (n.indexOf('.-') > 0) { + // console.log(n); + // } + // path.basename = n; + + // path.basename = jsonLookup[code].Short; + path.basename = jsonLookup[code].Name.replaceAll(' ', '-'); + } + // path.basename = path.basename.toUpperCase(); // Converts the filename (excluding extension) to uppercase })) + .pipe(gulp.dest(outputPath)) .on("end", function() { + del.sync(outputPath + 'SKIP.png', {force:true}); + del.sync(outputPath + 'SKIP.svg', {force:true}); + + // for (let i = 0; i < jsonData.length; i++) { + // del.sync(outputPath + jsonData[i].Short + '.png', {force:true}); + // } cb(); }); } +exports.renameFlags = gulp.series( + renameFlags, +); -exports.copyCDN = function copyCDN(cb) -{ - var cdnTable = []; - var cdnWebsite = 'https://static.infragistics.com/xplatform/cdn/'; - var cdnServer = ' \\\\s0706dl2.igweb.local\\download.infragistics.com\\xplatform\\cdn'; - var cdnOutput = './CDN'; - console.log('--------------------------------------------------------------------'); - console.log('copying large data files from code-gen-library to: ' + cdnOutput); - console.log('--------------------------------------------------------------------'); +exports.jsonSort = function jsonSort(cb) { - // del(cdnOutput); + let jsonPath = CodeGenLib + "/WorldStats/XPLAT.json"; + // let jsonPath = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jsonFile = fs.readFileSync(jsonPath, "utf8"); + let jsonData = JSON.parse(jsonFile); + // jsonData.sort((a, b) => a.Name < b.Name ? 1 : -1); + jsonData.sort((a, b) => a.Population < b.Population ? 1 : -1); + + utils.saveJSON(jsonPath, jsonData, "compact"); + cb(); +} + +exports.json2cs = function json2cs(cb) { + + utils.json2cs('WorldStats'); + cb(); +} +exports.jsonRank = function jsonRank(cb) { + + let jsonPath = CodeGenLib + "/WorldStats/XPLAT.json"; + // let jsonPath = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jsonFile = fs.readFileSync(jsonPath, "utf8"); + let jsonData = JSON.parse(jsonFile); + // jsonData.sort((a, b) => a.Name < b.Name ? 1 : -1); + jsonData.sort((a, b) => a.Population < b.Population ? 1 : -1); + + for (let i = 0; i < jsonData.length; i++) { + jsonData[i].Rank = i + 1; + } + + utils.saveJSON(jsonPath, jsonData, "compact"); + cb(); +} + +exports.jsonInject = function jsonInject(cb) { + + let jsonPath1 = CodeGenLib + "/WorldStats/XPLAT.json"; + let jsonFile1 = fs.readFileSync(jsonPath1, "utf8"); + let jsonData1 = JSON.parse(jsonFile1); + let jsonLookup1 = utils.hash('Code', jsonData1) + + let jsonPath2 = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jsonFile2 = fs.readFileSync(jsonPath2, "utf8"); + let jsonData2 = JSON.parse(jsonFile2); + let jsonLookup2 = utils.hash('Code', jsonData2) + + var combined = []; + for (let i = 0; i < jsonData2.length; i++) { + + var code = jsonData2[i].Code; + var iso2 = jsonLookup1[code].Short; + + var item = { Code: code, Short: iso2}; + delete jsonData2[i].Code + Object.assign(item, jsonData2[i]); + combined.push(item); + } + + jsonData = JSON.parse(JSON.stringify(combined)); + utils.saveJSON(jsonPath, jsonData, "compact"); + cb(); +} + +exports.jsonDelta = function jsonDelta(cb) { + + let jsonPath1 = CodeGenLib + "/WorldStats/XPLAT.json"; + let jsonFile1 = fs.readFileSync(jsonPath1, "utf8"); + let jsonData1 = JSON.parse(jsonFile1); + let jsonLookup1 = utils.hash('Code', jsonData1) + + let jsonPath2 = CodeGenLib + "/WorldCountries/XPLAT.json"; + let jsonFile2 = fs.readFileSync(jsonPath2, "utf8"); + let jsonData2 = JSON.parse(jsonFile2); + let jsonLookup2 = utils.hash('Code', jsonData2) + + for (let i = 0; i < jsonData1.length; i++) { + var code = jsonData1[i].Code; + if (jsonLookup2[code] === undefined) { + console.log(jsonPath2 + ' missing ' + code); + } + } + + for (let i = 0; i < jsonData2.length; i++) { + var code = jsonData2[i].Code; + if (jsonLookup1[code] === undefined) { + console.log(jsonPath1 + ' missing ' + code); + } + } + cb(); +} + +exports.jsonReplace = function jsonReplace(cb) { + + let jsonPath = CodeGenLib + "/WorldStats/XPLAT.json"; + let jsonFile = fs.readFileSync(jsonPath, "utf8"); + let jsonData = JSON.parse(jsonFile); + + for (let i = 0; i < jsonData.length; i++) { + + jsonData[i].X = jsonData[i].Longitude; + jsonData[i].Y = jsonData[i].Latitude; + + delete jsonData[i].Longitude; + delete jsonData[i].Latitude; + } + + jsonPath = CodeGenLib + "/WorldStats/XPLAT2.json"; + jsonData = JSON.parse(JSON.stringify(jsonData)); + utils.saveJSON(jsonPath, jsonData, "compact"); + + cb(); +} + +// let cdnWebsite = 'https://dl.infragistics.com/xplatform/cdn/'; // OLD +let cdnWebsite = 'https://dl.infragistics.com/xplat/data/'; +let cdnServer = '\\\\s0706dl2.igweb.local\\download.infragistics.com\\xplatform\\data'; +// let cdnServer = '\\\\s0706dl2.igweb.local\\download.infragistics.com\\xplatform\\cdn'; // OLD +let cdnOutput = './CDN/data/'; + +let cdnFiles = []; + +// sync CDN by extracting large */XPLAT.json files from the code-gen-library to a local folder that needs to be manually uploaded to CDN network location +function cdnSyncData(cb) +{ + // del.sync(cdnOutput, {force:true}); + // del.sync(cdnOutput + "*.json", {force:true}); + + console.log('--------------------------------------------------------------------'); + console.log('extracting large */XPLAT.json data files from code-gen-library to: ' + cdnOutput); + console.log('--------------------------------------------------------------------'); + + let cdnTable = []; + let fileID = 1; gulp.src([ // process data files CodeGenLib + '/**/XPLAT.json', @@ -366,21 +621,46 @@ exports.copyCDN = function copyCDN(cb) // {base: CodeGenLib + '/'} ) .pipe(es.map(function(file, fileCallback) { - // console.log(file.dirname + '/' + file.basename); - let content = file.contents.toString(); - let items = JSON.parse(content); - var columns = Object.keys(items[0]); - let dirname = file.dirname.split('code-gen-library\\')[1]; - - // copy only files that have many items and/or many data columns - if (items.length >= 100 || (items.length * columns.length >= 500) || dirname === "SingersData") { - console.log(CodeGenLib + '/' + dirname + '/XPLAT.json copied with ' + items.length + ' items'); - // console.log('CodeGenLib + "/' + dirname + '/XPLAT.json",'); - var itemsCount = items.length.toString(); - var columnsCount = columns.length.toString(); - var row = " " + itemsCount.padStart(Math.max(10, itemsCount.length), ' ') + " " + - " " + columnsCount.padStart(Math.max(12, columnsCount.length), ' ') + " " + - " " + "" + dirname + " \r\n"; + + let json = {}; + json.filePath = file.dirname + '\\' + file.basename; + json.fileDir = file.dirname; + json.fileName = file.basename; + // console.log("process=" + json.filePath); + + let dataContent = file.contents.toString(); + let dataItems = JSON.parse(dataContent); + + json.dataSize = utils.getFileSize(json.filePath); + json.dataName = utils.getFileParentDir(json.filePath); + json.dataItems = dataItems.length; + json.dataColumns = Object.keys(dataItems[0]).length; + json.dataGrid = json.dataItems * json.dataColumns; + + // copy only large files or files with many items and/or many data columns + if (json.dataSize >= 10 || json.dataItems >= 100 || json.dataGrid >= 500) { + // console.log("CDN=" + json.filePath); + // cdnFiles.push(json.directory); + + let cdnName = json.dataName + ".json"; + let cdnPath = cdnOutput + cdnName ; + let cdnLink = cdnWebsite + cdnName; + let xplatGit = xplatCodeGenLibGit + json.dataName + '/' + json.fileName; + let xplatRaw = xplatCodeGenLibRaw + json.dataName + '/' + json.fileName; + let xplatName = 'XPLAT'; //'☍ XPLAT'; // file.basename + cdnFiles.push(json); + + console.log(CodeGenLib + '/' + json.dataName + '/XPLAT.json'); + // let col = + let row = "" + + " " + fileID.toString().padStart(3) + " " + + " " + json.dataColumns.toString().padStart(2) + " " + + " " + json.dataItems.toString().padStart(5) + " " + + " " + json.dataSize.toString().padStart(5) + " KB " + + " " + "GIT " + + " " + "RAW " + + " " + "" + cdnName + " " + + " \r\n"; cdnTable += row; // copy to cdn output utils.saveFile(cdnPath, dataContent, true); @@ -388,43 +668,58 @@ exports.copyCDN = function copyCDN(cb) // utils.saveFile(CodeGenLib + '/' + json.dataName + '/XPLAT-CONFIG.json', '{\r\n' + ' "location": "CDN"\r\n' + '}\r\n', true); fileID++; } - // console.log(items.length + " " + (items.length * columns.length) + " " + dirname); + else { + // console.log("fileSize=" + fileSize + " fileItems=" + fileItems + " fileGrid=" + fileGrid + " skipped: " + filePath); + } fileCallback(null, file); })) .on("end", function() { - var repo = 'https://github.com/IgniteUI/igniteui-xplat-examples/tree/23.2.x'; - var angular = 'https://github.com/IgniteUI/igniteui-angular-examples/tree/vnext'; - var blazor = 'https://github.com/IgniteUI/igniteui-blazor-examples/tree/vnext'; - var react = 'https://github.com/IgniteUI/igniteui-react-examples/tree/vnext'; - var wc = 'https://github.com/IgniteUI/igniteui-wc-examples/tree/vnext'; - var readme = '

Data Files for Cross-Platform Samples

\r\n\r\n' + - '

This CDN folder contains data files used by ' + - 'xplat, ' + - 'angular, ' + - 'blazor, ' + - 'react, and ' + - 'web-component samples' + - '

\r\n\r\n' + - '

Use the copyCDN gulp script to collect data files from CodeGen library before manually uploading them to the CDN network location. This way, files on CDN stay in-sync with files in CodeGen library.

\r\n\r\n' + - '

CodeGen Library

\r\n\r\n' + - '

The CodeGen library is located on GitHub and CDN has a copy of these files:

\r\n\r\n' + - '\r\n' + - ' \r\n' + - cdnTable + - '
Data Items Data Columns Data Link
'; - var css = ' ' - // saveFile(cdnOutput + "/_Readme.md", readme, true); - saveFile(cdnOutput + "/.Readme.html", ' ' + css + '\r\n' + readme + '\r\n\r\n', true); - - // if (cdnOutput.indexOf('igweb.local/download.infragistics.com') < 0) { - console.log("\n WARNING: You must copy content of the this CDN folder to:\n" + cdnServer + "\n") - // } + let readme = ' ' + css + '\r\n' + + '

JSON Data Library

\r\n\r\n' + + '

This data folder contains JSON files used by: ' + + 'xplat samples, ' + + 'angular samples, ' + + 'blazor samples, ' + + 'react samples, and ' + + 'web-component samples samples' + + '

\r\n\r\n' + + '

Use the ' + linkCopyCDN + ' gulp script to collect data files from ' + linkCodeGen + ' and then manually upload them to the ' + linkServerCDN + ' network location. This way, files on CDN stay in-sync with files in ' + linkCodeGen + ' repo.

\r\n\r\n' + + '

Data Files

\r\n\r\n' + + '

This table provides statistics and list of files that were copied form ' + linkCodeGen + ' repo:

\r\n\r\n' + + '\r\n' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' \r\n' + + cdnTable + + '
ID Columns Items Size GITHUB LINK GITHUB RAW CDN LINK
' + + '\r\n\r\n'; + + utils.saveFile(cdnOutput + "/_Readme.html", readme, true); + + // console.log(cdnFiles); cb(); }); } @@ -475,8 +770,9 @@ exports.copyCDN = gulp.series( exports.compactJSON = function compactJSON(cb) { let filePaths = [ - // "/AnalyzeOrders/XPLAT.json", + // "/AnalyzeOrders/XPLAT.json", // "/AnalyzeSales/XPLAT.json", + // "/AthletesData/XPLAT.json", "/InvoicesWorldData/XPLAT.json", "/PivotData/XPLAT.json", // "/CompanyEmployees/XPLAT.json", @@ -500,9 +796,7 @@ exports.compactJSON = function compactJSON(cb) { // "/ProductInventory/XPLAT.json", // "/RoleplayDataStats/XPLAT.json", // "/RoleplayTreeGridData/XPLAT.json", - // "/NwindData/XPLAT.json", - // "/AnalyzeSales/XPLAT.json", - "/AthletesData/XPLAT.json", + // "/NwindData/XPLAT.json", ]; for (const filePath of filePaths) { let file = fs.readFileSync(CodeGenLib + filePath, "utf8"); @@ -1910,4 +2204,75 @@ exports.correctJSON = function correctJSON(cb) .on("end", function() { cb(); }); -} \ No newline at end of file +} + +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(); + }); +} diff --git a/code-gen-tools/utils.js b/code-gen-tools/utils.js index 30b8040ef..a3d50100b 100644 --- a/code-gen-tools/utils.js +++ b/code-gen-tools/utils.js @@ -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, '}', ' }')