-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'unit-test/rest' of https://github.com/RevealBi/Reveal.S…
…dk.Dom into unit-test/rest
- Loading branch information
Showing
19 changed files
with
642 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > | ||
<section name="Sandbox.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> | ||
</sectionGroup> | ||
</configSections> | ||
<userSettings> | ||
<Sandbox.Properties.Settings> | ||
<setting name="LastSelectedDashboard" serializeAs="String"> | ||
<value /> | ||
</setting> | ||
</Sandbox.Properties.Settings> | ||
</userSettings> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
628 changes: 315 additions & 313 deletions
628
e2e/Sandbox/Factories/CustomDashboard.cs → ...dbox/DashboardCreators/CustomDashboard.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Reveal.Sdk.Dom; | ||
|
||
namespace Sandbox.DashboardFactories | ||
{ | ||
interface IDashboardCreator | ||
{ | ||
string Name { get; } | ||
RdashDocument CreateDashboard(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 65 additions & 63 deletions
128
...box/Factories/RestDataSourceDashboards.cs → ...hboardCreators/RestDataSourceDashboard.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,65 @@ | ||
using Reveal.Sdk.Dom; | ||
using Reveal.Sdk.Dom.Data; | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using Sandbox.Helpers; | ||
|
||
namespace Sandbox.Factories | ||
{ | ||
internal class RestDataSourceDashboards | ||
{ | ||
internal static RdashDocument CreateDashboard() | ||
{ | ||
var document = new RdashDocument("My Dashboard"); | ||
|
||
//json - default | ||
var jsonDataSourceItem = new RestDataSourceItem("Sales by Category", new DataSource { Title = "JSON DS", Subtitle = "JSON DS Subtitle" }) | ||
{ | ||
Subtitle = "JSON Data Source Item", | ||
Uri = "https://excel2json.io/api/share/6e0f06b3-72d3-4fec-7984-08da43f56bb9", | ||
IsAnonymous = true, | ||
Fields = DataSourceFactory.GetSalesByCategoryFields(), | ||
}; | ||
|
||
document.Visualizations.Add(new PieChartVisualization("JSON", jsonDataSourceItem) | ||
.SetLabel("CategoryName").SetValue("ProductSales")); | ||
|
||
//excel | ||
RestDataSourceItem excelDataSourceItem = new RestDataSourceItem("Marketing", "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx", | ||
new DataSource { Title = "Excel DS", Subtitle = "Excel DS Subtitle" }) | ||
{ | ||
Subtitle = "Excel Data Source Item", | ||
IsAnonymous = true, | ||
Fields = DataSourceFactory.GetMarketingDataSourceFields(), | ||
}; | ||
excelDataSourceItem.UseExcel("Marketing"); | ||
|
||
document.Visualizations.Add(new PieChartVisualization("Excel", excelDataSourceItem) | ||
.SetLabel("Territory").SetValue("Conversions")); | ||
|
||
//csv | ||
var csvDataSourceItem = new RestDataSourceItem("Illinois School Info", new DataSource() { Title = "CSV DS", Subtitle = "CSV DS Subtitle" }) | ||
.SetSubtitle("CSV Data Source Item") | ||
.SetUri("https://query.data.world/s/y32gtgblzpemyyvtig47dz7tedgkto") | ||
.SetIsAnonymous(true) | ||
.SetFields(DataSourceFactory.GetCsvDataSourceFields()) | ||
.WithCsv(); | ||
|
||
document.Visualizations.Add(new ScatterMapVisualization("Scatter", csvDataSourceItem) | ||
.SetMap(Maps.NorthAmerica.UnitedStates.States.Illinois) | ||
.SetLongitude("X") | ||
.SetLatitude("Y") | ||
.SetLabel("School_Nm") | ||
.ConfigureSettings(settings => | ||
{ | ||
settings.Zoom.Longitude = 1.38; | ||
settings.Zoom.Latitude = 41.65; | ||
settings.Zoom.DegreesLongitude = 1.04; | ||
settings.Zoom.DegreesLatitude = 0.39; | ||
})); | ||
|
||
return document; | ||
} | ||
} | ||
} | ||
using Reveal.Sdk.Dom; | ||
using Reveal.Sdk.Dom.Data; | ||
using Reveal.Sdk.Dom.Visualizations; | ||
using Sandbox.Helpers; | ||
|
||
namespace Sandbox.DashboardFactories | ||
{ | ||
internal class RestDataSourceDashboard: IDashboardCreator | ||
{ | ||
public string Name => "REST Data Source"; | ||
|
||
public RdashDocument CreateDashboard() | ||
{ | ||
var document = new RdashDocument("My Dashboard"); | ||
|
||
//json - default | ||
var jsonDataSourceItem = new RestDataSourceItem("Sales by Category", new DataSource { Title = "JSON DS", Subtitle = "JSON DS Subtitle" }) | ||
{ | ||
Subtitle = "JSON Data Source Item", | ||
Uri = "https://excel2json.io/api/share/6e0f06b3-72d3-4fec-7984-08da43f56bb9", | ||
IsAnonymous = true, | ||
Fields = DataSourceFactory.GetSalesByCategoryFields(), | ||
}; | ||
|
||
document.Visualizations.Add(new PieChartVisualization("JSON", jsonDataSourceItem) | ||
.SetLabel("CategoryName").SetValue("ProductSales")); | ||
|
||
//excel | ||
RestDataSourceItem excelDataSourceItem = new RestDataSourceItem("Marketing", "http://dl.infragistics.com/reportplus/reveal/samples/Samples.xlsx", | ||
new DataSource { Title = "Excel DS", Subtitle = "Excel DS Subtitle" }) | ||
{ | ||
Subtitle = "Excel Data Source Item", | ||
IsAnonymous = true, | ||
Fields = DataSourceFactory.GetMarketingDataSourceFields(), | ||
}; | ||
excelDataSourceItem.UseExcel("Marketing"); | ||
|
||
document.Visualizations.Add(new PieChartVisualization("Excel", excelDataSourceItem) | ||
.SetLabel("Territory").SetValue("Conversions")); | ||
|
||
//csv | ||
var csvDataSourceItem = new RestDataSourceItem("Illinois School Info", new DataSource() { Title = "CSV DS", Subtitle = "CSV DS Subtitle" }) | ||
.SetSubtitle("CSV Data Source Item") | ||
.SetUri("https://query.data.world/s/y32gtgblzpemyyvtig47dz7tedgkto") | ||
.SetIsAnonymous(true) | ||
.SetFields(DataSourceFactory.GetCsvDataSourceFields()) | ||
.WithCsv(); | ||
|
||
document.Visualizations.Add(new ScatterMapVisualization("Scatter", csvDataSourceItem) | ||
.SetMap(Maps.NorthAmerica.UnitedStates.States.Illinois) | ||
.SetLongitude("X") | ||
.SetLatitude("Y") | ||
.SetLabel("School_Nm") | ||
.ConfigureSettings(settings => | ||
{ | ||
settings.Zoom.Longitude = 1.38; | ||
settings.Zoom.Latitude = 41.65; | ||
settings.Zoom.DegreesLongitude = 1.04; | ||
settings.Zoom.DegreesLatitude = 0.39; | ||
})); | ||
|
||
return document; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.