From 2de5d5e1dbcff3eeb987837d6ca314cc69cfbbcf Mon Sep 17 00:00:00 2001 From: Brian Lagunas Date: Thu, 7 Jul 2022 11:52:55 -0600 Subject: [PATCH] removed specific data source and data source items --- .../DashboardDocumentValidatorFixture.cs | 38 ++++---- .../Converters/DataSourceConverter.cs | 28 ------ .../Converters/DataSourceItemConverter.cs | 18 ---- Reveal.Sdk.Dom/Data/Builders/ExcelBuilder.cs | 91 ------------------- Reveal.Sdk.Dom/Data/Builders/RestBuilder.cs | 11 ++- .../Data/{DataSources => }/DataSource.cs | 2 - .../{DataSourceItems => }/DataSourceItem.cs | 8 +- .../CompositeDataSourceItem.cs | 6 -- .../DataSourceItems/ExcelDataSourceItem.cs | 59 ------------ .../Data/DataSources/ExcelDataSource.cs | 23 ----- .../Data/DataSources/WebResourceDataSource.cs | 51 ----------- Sandbox/Factories/CustomDashboard.cs | 5 +- Sandbox/Helpers/DataSourceFactory.cs | 69 ++++++-------- Sandbox/MainWindow.xaml.cs | 2 +- 14 files changed, 61 insertions(+), 350 deletions(-) delete mode 100644 Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceConverter.cs delete mode 100644 Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceItemConverter.cs delete mode 100644 Reveal.Sdk.Dom/Data/Builders/ExcelBuilder.cs rename Reveal.Sdk.Dom/Data/{DataSources => }/DataSource.cs (94%) rename Reveal.Sdk.Dom/Data/{DataSourceItems => }/DataSourceItem.cs (84%) delete mode 100644 Reveal.Sdk.Dom/Data/DataSourceItems/CompositeDataSourceItem.cs delete mode 100644 Reveal.Sdk.Dom/Data/DataSourceItems/ExcelDataSourceItem.cs delete mode 100644 Reveal.Sdk.Dom/Data/DataSources/ExcelDataSource.cs delete mode 100644 Reveal.Sdk.Dom/Data/DataSources/WebResourceDataSource.cs diff --git a/Reveal.Sdk.Dom.Tests/Core/Utilities/DashboardDocumentValidatorFixture.cs b/Reveal.Sdk.Dom.Tests/Core/Utilities/DashboardDocumentValidatorFixture.cs index 04032b6c..45a874aa 100644 --- a/Reveal.Sdk.Dom.Tests/Core/Utilities/DashboardDocumentValidatorFixture.cs +++ b/Reveal.Sdk.Dom.Tests/Core/Utilities/DashboardDocumentValidatorFixture.cs @@ -13,11 +13,10 @@ public class DashboardDocumentValidatorFixture [Fact] public void DataSources_AddedToDashboardDocument() { - var excelDataSource = new ExcelDataSource(); - var excelDataSourceItem = new ExcelDataSourceItem(excelDataSource, new List()); + var dataSourceItem = new RestBuilder("").SetFields(new List() { null }).Build(); var document = new DashboardDocument(); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); Assert.Empty(document.DataSources); @@ -29,45 +28,44 @@ public void DataSources_AddedToDashboardDocument() [Fact] public void DataSources_FromVisualizationsAreNotDuplicated() { - var excelDataSource = new ExcelDataSource(); - var excelDataSourceItem = new ExcelDataSourceItem(excelDataSource, new List()); + var dataSourceItem = new RestBuilder("").SetFields(new List() { null }).Build(); var document = new DashboardDocument(); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); Assert.Empty(document.DataSources); DashboardDocumentValidator.FixDashboardDocument(document); - var excelDataSources = document.DataSources.Where(x => x.Provider == DataSourceProviders.ExcelProvider); + var jsonDataSources = document.DataSources.Where(x => x.Provider == DataSourceProviders.JSON); - Assert.Single(excelDataSources); + Assert.Single(jsonDataSources); } [Fact] public void DataSources_FromVisualizations_AndDataSources_AreNotDuplicated() { - var excelDataSource = new ExcelDataSource(); - var excelDataSourceItem = new ExcelDataSourceItem(excelDataSource, new List()); + var dataSourceItem = new RestBuilder("").SetFields(new List() { null }).Build(); + var dataSource = dataSourceItem.DataSource; var document = new DashboardDocument(); - document.DataSources.Add(excelDataSource); + document.DataSources.Add(dataSource); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); - document.Visualizations.Add(new KpiTimeVisualization(excelDataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); + document.Visualizations.Add(new KpiTimeVisualization(dataSourceItem)); Assert.Single(document.DataSources); DashboardDocumentValidator.FixDashboardDocument(document); - var excelDataSources = document.DataSources.Where(x => x.Provider == DataSourceProviders.ExcelProvider); + var jsonDataSources = document.DataSources.Where(x => x.Provider == DataSourceProviders.JSON); - Assert.Single(excelDataSources); + Assert.Single(jsonDataSources); } } } diff --git a/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceConverter.cs b/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceConverter.cs deleted file mode 100644 index d8415539..00000000 --- a/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceConverter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Reveal.Sdk.Dom.Core.Constants; -using Reveal.Sdk.Dom.Data; -using System; - -namespace Reveal.Sdk.Dom.Core.Serialization.Converters -{ - internal class DataSourceConverter : CustomJsonConverter - { - public override DataSource ReadJson(JsonReader reader, Type objectType, DataSource existingValue, bool hasExistingValue, JsonSerializer serializer) - { - JObject jObject = JObject.Load(reader); - var type = jObject["Provider"].Value(); - - Type bindingType = type switch - { - DataSourceProviders.ExcelProvider => typeof(ExcelDataSource), - DataSourceProviders.WebServiceProvider => typeof(WebResourceDataSource), - _ => typeof(DataSource) - }; - - var item = Activator.CreateInstance(bindingType, true); - serializer.Populate(jObject.CreateReader(), item); - return item as DataSource; - } - } -} diff --git a/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceItemConverter.cs b/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceItemConverter.cs deleted file mode 100644 index e1676efe..00000000 --- a/Reveal.Sdk.Dom/Core/Serialization/Converters/DataSourceItemConverter.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Reveal.Sdk.Dom.Core.Constants; -using Reveal.Sdk.Dom.Data; -using System; - -namespace Reveal.Sdk.Dom.Core.Serialization.Converters -{ - internal class DataSourceItemConverter : TypeMapConverter - { - public DataSourceItemConverter() - { - TypeMap = new System.Collections.Generic.Dictionary() - { - { SchemaTypeNames.CompositeDataSourceItemType, typeof(CompositeDataSourceItem) }, - { SchemaTypeNames.DataSourceItemType, typeof(DataSourceItem) } - }; - } - } -} diff --git a/Reveal.Sdk.Dom/Data/Builders/ExcelBuilder.cs b/Reveal.Sdk.Dom/Data/Builders/ExcelBuilder.cs deleted file mode 100644 index 91b29da6..00000000 --- a/Reveal.Sdk.Dom/Data/Builders/ExcelBuilder.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Reveal.Sdk.Dom.Visualizations; -using System; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Data -{ - public class ExcelBuilder - { - ExcelDataSource _dataSource = new ExcelDataSource(); - DataSourceItem _dataSourceItem = new DataSourceItem(); - WebResourceDataSource _resourceItemDataSource = new WebResourceDataSource(); - DataSourceItem _resourceItem = new DataSourceItem(); - - public ExcelBuilder(ExcelDataSource excelDataSource) - { - CreateBuilder(excelDataSource, excelDataSource.Url); - } - - public ExcelBuilder(string uri) - { - CreateBuilder(null, uri); - } - - void CreateBuilder(ExcelDataSource excelDataSource, string uri) - { - if (excelDataSource != null) - { - _dataSource = excelDataSource; - _resourceItemDataSource.UseAnonymousAuthentication = excelDataSource.UseAnonymousAuthentication; - SetTitle(_dataSource.Title); - } - - _dataSourceItem.DataSource = _dataSource; - _dataSourceItem.DataSourceId = _dataSource.Id; - - _resourceItemDataSource.Url = uri; - _dataSourceItem.ResourceItemDataSource = _resourceItemDataSource; - - _resourceItem.DataSourceId = _resourceItemDataSource.Id; - _resourceItem.Properties.Add("Url", uri); - _dataSourceItem.ResourceItem = _resourceItem; - } - - public ExcelBuilder IsAnonymous(bool isAnonymous) - { - _resourceItemDataSource.UseAnonymousAuthentication = isAnonymous; - return this; - } - - public ExcelBuilder SetFields(IEnumerable fields) - { - _dataSourceItem.Fields.Clear(); - _dataSourceItem.Fields.AddRange(fields); - return this; - } - - public ExcelBuilder SetTitle(string title) - { - _dataSourceItem.Title = title; - _resourceItem.Title = title; - _resourceItemDataSource.Title = title; - return this; - } - - public ExcelBuilder SetSubtitle(string subtitle) - { - _dataSourceItem.Subtitle = subtitle; - return this; - } - - public ExcelBuilder UseSheet(string sheet) - { - _dataSourceItem.Subtitle = sheet; - - if (_dataSourceItem.Properties.ContainsKey("Sheet")) - _dataSourceItem.Properties["Sheet"] = sheet; - else - _dataSourceItem.Properties.Add("Sheet", sheet); - - return this; - } - - public DataSourceItem Build() - { - if (_dataSourceItem.Fields == null || _dataSourceItem.Fields.Count == 0) - throw new ArgumentException("You must provide the field definitions for the data source item."); - - return _dataSourceItem; - } - } -} diff --git a/Reveal.Sdk.Dom/Data/Builders/RestBuilder.cs b/Reveal.Sdk.Dom/Data/Builders/RestBuilder.cs index bcc282ba..34bc82c9 100644 --- a/Reveal.Sdk.Dom/Data/Builders/RestBuilder.cs +++ b/Reveal.Sdk.Dom/Data/Builders/RestBuilder.cs @@ -67,8 +67,8 @@ public RestBuilder SetSubtitle(string subtitle) public DataSourceItem Build() { - if (_dataSourceItem.Fields == null || _dataSourceItem.Fields.Count == 0) - throw new ArgumentException("You must provide the field definitions for the data source item."); + if (_dataSourceItem.Fields.Count == 0) + throw new ArgumentException("You must provide the field definitions for the data source item. Call the SetFields method and provide the fields."); return _dataSourceItem; } @@ -130,13 +130,16 @@ public RestBuilder UseExcel(string sheet = null, ExcelFileType fileType = ExcelF return this; } - //todo: why is this required for json data? We already have the fields? Is this used for CSV too? + //todo: why is this required for json data? We already have the fields? Dictionary BuildConfig(IEnumerable fields) { Dictionary config = new Dictionary(); List columnConfigs = new List(); foreach (var field in fields) { + if (field == null) + continue; + var columnConfig = new ColumnConfig(); columnConfig.Key = field.FieldName; @@ -153,7 +156,7 @@ Dictionary BuildConfig(IEnumerable fields) columnConfigs.Add(columnConfig); } - config.Add("iterationDepth", 0); //todo: what is this all about? + config.Add("iterationDepth", 0); config.Add("columnsConfig", columnConfigs); return config; } diff --git a/Reveal.Sdk.Dom/Data/DataSources/DataSource.cs b/Reveal.Sdk.Dom/Data/DataSource.cs similarity index 94% rename from Reveal.Sdk.Dom/Data/DataSources/DataSource.cs rename to Reveal.Sdk.Dom/Data/DataSource.cs index a7927db6..4dff4521 100644 --- a/Reveal.Sdk.Dom/Data/DataSources/DataSource.cs +++ b/Reveal.Sdk.Dom/Data/DataSource.cs @@ -1,13 +1,11 @@ using Newtonsoft.Json; using Reveal.Sdk.Dom.Core; using Reveal.Sdk.Dom.Core.Constants; -using Reveal.Sdk.Dom.Core.Serialization.Converters; using System; using System.Collections.Generic; namespace Reveal.Sdk.Dom.Data { - //[JsonConverter(typeof(DataSourceConverter))] public class DataSource : SchemaType, IEquatable { public string Id { get; set; } = Guid.NewGuid().ToString(); diff --git a/Reveal.Sdk.Dom/Data/DataSourceItems/DataSourceItem.cs b/Reveal.Sdk.Dom/Data/DataSourceItem.cs similarity index 84% rename from Reveal.Sdk.Dom/Data/DataSourceItems/DataSourceItem.cs rename to Reveal.Sdk.Dom/Data/DataSourceItem.cs index 313156b7..efbd5e7e 100644 --- a/Reveal.Sdk.Dom/Data/DataSourceItems/DataSourceItem.cs +++ b/Reveal.Sdk.Dom/Data/DataSourceItem.cs @@ -1,14 +1,12 @@ using Newtonsoft.Json; using Reveal.Sdk.Dom.Core; using Reveal.Sdk.Dom.Core.Constants; -using Reveal.Sdk.Dom.Core.Serialization.Converters; using Reveal.Sdk.Dom.Visualizations; using System; using System.Collections.Generic; namespace Reveal.Sdk.Dom.Data { - [JsonConverter(typeof(DataSourceItemConverter))] public class DataSourceItem : SchemaType { public string Id { get; set; } = Guid.NewGuid().ToString(); @@ -24,15 +22,17 @@ public class DataSourceItem : SchemaType [JsonIgnore] public List Fields { get; internal set; } = new List(); + [JsonIgnore] /// /// The data source for the current DataSourceItem /// - internal DataSource DataSource { get; set; } + public DataSource DataSource { get; internal set; } + [JsonIgnore] /// /// The data source for the ResourceItem /// - internal DataSource ResourceItemDataSource { get; set; } + public DataSource ResourceItemDataSource { get; internal set; } public DataSourceItem() { diff --git a/Reveal.Sdk.Dom/Data/DataSourceItems/CompositeDataSourceItem.cs b/Reveal.Sdk.Dom/Data/DataSourceItems/CompositeDataSourceItem.cs deleted file mode 100644 index 946073bb..00000000 --- a/Reveal.Sdk.Dom/Data/DataSourceItems/CompositeDataSourceItem.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Reveal.Sdk.Dom.Data -{ - public class CompositeDataSourceItem : DataSourceItem - { - } -} diff --git a/Reveal.Sdk.Dom/Data/DataSourceItems/ExcelDataSourceItem.cs b/Reveal.Sdk.Dom/Data/DataSourceItems/ExcelDataSourceItem.cs deleted file mode 100644 index 64892570..00000000 --- a/Reveal.Sdk.Dom/Data/DataSourceItems/ExcelDataSourceItem.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Newtonsoft.Json; -using Reveal.Sdk.Dom.Visualizations; -using System.Collections.Generic; - -namespace Reveal.Sdk.Dom.Data -{ - public class ExcelDataSourceItem : DataSourceItem - { - internal ExcelDataSourceItem() { } - - public ExcelDataSourceItem(ExcelDataSource dataSource, List fields) : this(dataSource, string.Empty, fields) { } - - public ExcelDataSourceItem(ExcelDataSource dataSource, string sheet, List fields) - { - Sheet = sheet; - DataSource = dataSource; - Fields = fields; - - ResourceItemDataSource = new WebResourceDataSource() - { - Title = dataSource.Title, - Url = dataSource.Url, - UseAnonymousAuthentication = dataSource.UseAnonymousAuthentication, - }; - - DataSourceId = dataSource.Id; - Title = dataSource.Title; - Subtitle = dataSource.Subtitle; - HasTabularData = true; - - ResourceItem = new DataSourceItem() - { - DataSourceId = ResourceItemDataSource.Id, - Title = Title, - Subtitle = Subtitle, - }; - ResourceItem.Properties.Add("Url", dataSource.Url); - } - - [JsonIgnore] - public string Sheet - { - get - { - if (Properties.TryGetValue("Sheet", out object value)) - return (string)value; - else - return null; - } - set - { - if (Properties.ContainsKey("Sheet")) - Properties["Sheet"] = value; - else - Properties.Add("Sheet", value); - } - } - } -} diff --git a/Reveal.Sdk.Dom/Data/DataSources/ExcelDataSource.cs b/Reveal.Sdk.Dom/Data/DataSources/ExcelDataSource.cs deleted file mode 100644 index 124c3bc5..00000000 --- a/Reveal.Sdk.Dom/Data/DataSources/ExcelDataSource.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Reveal.Sdk.Dom.Core.Constants; -using Newtonsoft.Json; - -namespace Reveal.Sdk.Dom.Data -{ - public class ExcelDataSource : DataSource - { - [JsonIgnore] - public string Url { get; set; } - - [JsonIgnore] - public bool UseAnonymousAuthentication { get; set; } = true; - - internal ExcelDataSource() : this(string.Empty) { } - - public ExcelDataSource(string url) : base() - { - Id = DataSourceIds.ExcelId; - Provider = DataSourceProviders.ExcelProvider; - Url = url; - } - } -} diff --git a/Reveal.Sdk.Dom/Data/DataSources/WebResourceDataSource.cs b/Reveal.Sdk.Dom/Data/DataSources/WebResourceDataSource.cs deleted file mode 100644 index 58a8144a..00000000 --- a/Reveal.Sdk.Dom/Data/DataSources/WebResourceDataSource.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Reveal.Sdk.Dom.Core.Constants; -using Newtonsoft.Json; - -namespace Reveal.Sdk.Dom.Data -{ - public class WebResourceDataSource : DataSource - { - [JsonIgnore] - public string Url - { - get - { - if (Properties.TryGetValue("Url", out object value)) - return (string)value; - else - return null; - } - set - { - if (Properties.ContainsKey("Url")) - Properties["Url"] = value; - else - Properties.Add("Url", value); - } - } - - [JsonIgnore] - public bool UseAnonymousAuthentication - { - get - { - if (Properties.TryGetValue("_rpUseAnonymousAuthentication", out object value)) - return (bool)value; - else - return false; - } - set - { - if (Properties.ContainsKey("Url")) - Properties["_rpUseAnonymousAuthentication"] = value; - else - Properties.Add("_rpUseAnonymousAuthentication", value); - } - } - - public WebResourceDataSource() - { - Provider = DataSourceProviders.WebServiceProvider; - } - } -} diff --git a/Sandbox/Factories/CustomDashboard.cs b/Sandbox/Factories/CustomDashboard.cs index 5f64ca86..fb011777 100644 --- a/Sandbox/Factories/CustomDashboard.cs +++ b/Sandbox/Factories/CustomDashboard.cs @@ -9,12 +9,11 @@ internal class CustomDashboard { internal static DashboardDocument CreateDashboard() { - var excelDataSourceItem = new ExcelBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") + var excelDataSourceItem = new RestBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") .SetTitle("Excel Data Source") .SetSubtitle("Marketing Sheet") - .UseSheet("Marketing") + .UseExcel("Marketing") .SetFields(DataSourceFactory.GetMarketingDataSourceFields()) - .IsAnonymous(true) .Build(); var document = new DashboardDocument() diff --git a/Sandbox/Helpers/DataSourceFactory.cs b/Sandbox/Helpers/DataSourceFactory.cs index 9c37938f..61360c48 100644 --- a/Sandbox/Helpers/DataSourceFactory.cs +++ b/Sandbox/Helpers/DataSourceFactory.cs @@ -6,18 +6,13 @@ namespace Sandbox.Helpers { internal class DataSourceFactory { - static readonly ExcelDataSource _excelDataSource = new ExcelDataSource("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") - { - Title = "Excel Data Source", - }; - internal static DataSourceItem GetMarketingDataSourceItem() { - var excelDataSourceItem = new ExcelBuilder(_excelDataSource) + var excelDataSourceItem = new RestBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") + .SetTitle("Excel Data Source") .SetSubtitle("Marketing Sheet") - .UseSheet("Marketing") + .UseExcel("Marketing") .SetFields(GetMarketingDataSourceFields()) - .IsAnonymous(true) .Build(); return excelDataSourceItem; @@ -25,11 +20,11 @@ internal static DataSourceItem GetMarketingDataSourceItem() internal static DataSourceItem GetHealthcareDataSourceItem() { - var excelDataSourceItem = new ExcelBuilder(_excelDataSource) + var excelDataSourceItem = new RestBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") + .SetTitle("Excel Data Source") .SetSubtitle("Healthcare Sheet") - .UseSheet("Healthcare") + .UseExcel("Healthcare") .SetFields(GetHealthcareDataSourceFields()) - .IsAnonymous(true) .Build(); return excelDataSourceItem; @@ -37,11 +32,11 @@ internal static DataSourceItem GetHealthcareDataSourceItem() internal static DataSourceItem GetManufacturingDataSourceItem() { - var excelDataSourceItem = new ExcelBuilder(_excelDataSource) + var excelDataSourceItem = new RestBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") + .SetTitle("Excel Data Source") .SetSubtitle("Manufacturing Sheet") - .UseSheet("Manufacturing") + .UseExcel("Manufacturing") .SetFields(GetManufacturingDataSourceFields()) - .IsAnonymous(true) .Build(); return excelDataSourceItem; @@ -49,38 +44,16 @@ internal static DataSourceItem GetManufacturingDataSourceItem() internal static DataSourceItem GetSalesDataSourceItem() { - //var excelDataSourceItem = new ExcelDataSourceItem(_excelDataSource, "Sales", GetSalesDataSourceFields()) - //{ - // Subtitle = "Sales Sheet", - //}; - - var excelDataSourceItem = new ExcelBuilder(_excelDataSource) + var excelDataSourceItem = new RestBuilder("http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx") + .SetTitle("Excel Data Source") .SetSubtitle("Sales Sheet") - .UseSheet("Sales") + .UseExcel("Sales") .SetFields(GetSalesDataSourceFields()) - .IsAnonymous(true) .Build(); return excelDataSourceItem; } - internal static List GetCsvDataSourceFields() - { - List fields = new List - { - new TextField("the_geom"), - new NumberField("School_ID"), - new TextField("School_Nm"), - new TextField("Sch_Addr"), - new TextField("Grade_Cat"), - new TextField("Grades"), - new TextField("Sch_Type"), - new NumberField("X"), - new NumberField("Y"), - }; - return fields; - } - internal static List GetHealthcareDataSourceFields() { List fields = new List @@ -174,7 +147,23 @@ internal static List GetSalesByCategoryFields() new TextField("CategoryName"), new TextField("ProductName"), new NumberField("ProductSales"), - //new NumberField("~") { FieldLabel = "Level 1" }, + }; + return fields; + } + + internal static List GetCsvDataSourceFields() + { + List fields = new List + { + new TextField("the_geom"), + new NumberField("School_ID"), + new TextField("School_Nm"), + new TextField("Sch_Addr"), + new TextField("Grade_Cat"), + new TextField("Grades"), + new TextField("Sch_Type"), + new NumberField("X"), + new NumberField("Y"), }; return fields; } diff --git a/Sandbox/MainWindow.xaml.cs b/Sandbox/MainWindow.xaml.cs index 6453ad55..f746779d 100644 --- a/Sandbox/MainWindow.xaml.cs +++ b/Sandbox/MainWindow.xaml.cs @@ -17,7 +17,7 @@ public partial class MainWindow : Window { static string _dashboardFilePath = Path.Combine(Environment.CurrentDirectory, "Dashboards"); - readonly string _readFilePath = Path.Combine(_dashboardFilePath, DashboardFileNames.Marketing); + readonly string _readFilePath = Path.Combine(_dashboardFilePath, DashboardFileNames.Manufacturing); readonly string _saveJsonToPath = Path.Combine(_dashboardFilePath, "MyDashboard.json"); readonly string _saveRdashToPath = Path.Combine(_dashboardFilePath, DashboardFileNames.MyDashboard);