Skip to content

Commit

Permalink
Merge pull request #64 from RevealBi/change-grid-vizspec-type
Browse files Browse the repository at this point in the history
Support CategoryVisualizationDataSpec in grids
  • Loading branch information
brianlagunas authored Sep 25, 2024
2 parents fae5984 + ed2539b commit ebcd4f1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public enum DataSourceProvider
[EnumMember(Value = "DROPBOXPROVIDER")]
Dropbox,

[EnumMember(Value = "GOOGLE_ADS")]
GoogleAds,

[EnumMember(Value = "GOOGLE_ANALYTICS")]
GoogleAnalytics,

Expand Down
13 changes: 11 additions & 2 deletions src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ public GridVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceI
public GridVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Grid; }

[JsonIgnore]
public List<TabularColumn> Columns { get { return VisualizationDataSpec.Columns; } }
public List<TabularColumn> Columns { get {
if (VisualizationDataSpec is GridVisualizationDataSpec gds)
{
return gds.Columns;
}
else
{
return new List<TabularColumn>();
}
} }

[JsonProperty(Order = 7)]
GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec();
VisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec();
}
}

0 comments on commit ebcd4f1

Please sign in to comment.