using System.Collections.Generic;
using System.IO;
using MatplotlibCS.PlotItems;
using Newtonsoft.Json;
namespace MatplotlibCS
{
///
/// Class desribing a figure to be build
///
[JsonObject(Title = "figure")]
public class Figure : IHealthCheck
{
#region ctor
///
/// .ctor
///
/// Number of rows in subplots grid
/// Number of columns in subplots grid
public Figure(int rows = 1, int columns = 1)
{
Rows = rows;
Columns = columns;
Subplots = new List();
}
#endregion
#region Properties
///
/// Number of rows in subplots grid
///
[JsonProperty(PropertyName = "rows")]
public int Rows { get; set; } = 1;
///
/// Number of columns in subplots grid
///
[JsonProperty(PropertyName = "columns")]
public int Columns { get; set; } = 1;
///
/// Figuree subplots
///
[JsonProperty(PropertyName = "__subplots__")]
public List Subplots { get; set; }
///
/// Name or full path of the file where to save result
///
[JsonProperty(PropertyName = "filename")]
public string FileName { get; set; }
///
/// If true, matplotlib window won't be shown, only image will be saved to disk
///
[JsonProperty(PropertyName = "onlySaveImage")]
public bool OnlySaveImage { get; set; }
///
/// Dots per inch
///
[JsonProperty(PropertyName = "dpi")]
public int DPI { get; set; } = 300;
///
/// Image width
///
[JsonProperty(PropertyName = "w")]
public int Width { get; set; } = 1920;
///
/// Image height
///
[JsonProperty(PropertyName = "h")]
public int Height { get; set; } = 1080;
#endregion
public void HealthCheck()
{
foreach (var subplot in Subplots)
{
subplot.HealthCheck();
}
}
}
}