/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { ParallelCoordinatesData data = null; ParallelCoordinatesStyle style = null; if (!DA.GetData <ParallelCoordinatesData>(0, ref data)) { return; } if (!DA.GetData <ParallelCoordinatesStyle>(1, ref style)) { return; } ParallelCoordinatesChart chart = new ParallelCoordinatesChart(data, style); DA.SetData(0, chart); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { List <string> headers = new List <string>(); GH_Structure <GH_String> values; if (!DA.GetDataList <string>(0, headers)) { return; } if (!DA.GetDataTree(1, out values)) { return; } ParallelCoordinatesData data = new ParallelCoordinatesData(); data.Data = ChartsUtilities.DataToJsonString(Utilities.Utilities.Data2FromTree(headers, values)); DA.SetData(0, data); }
/// <summary> /// Parallel Coordinates Data. /// </summary> /// <param name="FilePath">File Path for CSV file.</param> /// <returns name="Data">Parallel Coordinates Data.</returns> /// <search>parallel, coordinates, data, csv</search> public static ParallelCoordinatesData DataFromCSV( object FilePath) { // get full path to file as string // if File.FromPath is used it returns FileInfo class string _filePath = ""; try { _filePath = (string)FilePath; } catch { _filePath = ((FileInfo)FilePath).FullName; } ParallelCoordinatesData data = new ParallelCoordinatesData(); data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCsv(_filePath)); return(data); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { List <string> headers = new List <string>(); GH_Structure <GH_String> values; if (!DA.GetDataList <string>(0, headers)) { return; } if (!DA.GetDataTree(1, out values)) { return; } List <DataPoint2> dataPoints = Mandrill_Grasshopper.Utilities.Utilities.Data2FromTree(headers, values); ParallelCoordinatesData data = new ParallelCoordinatesData(); data.Data = dataPoints; DA.SetData(0, data); }
/// <summary> /// Parallel Coordinates Data. /// </summary> /// <param name="Headers">Names of each Axis.</param> /// <param name="Values">Values for each data point.</param> /// <returns name="Data">Parallel Coordinates Data.</returns> /// <search>parallel, coordinates, data</search> public static ParallelCoordinatesData Data( List <string> Headers, List <List <object> > Values) { List <DataPoint2> dataPoints = new List <DataPoint2>(); foreach (List <object> subList in Values) { DataPoint2 dataPoint = new DataPoint2(); dataPoint.Name = subList[0].ToString(); Dictionary <string, double> values = new Dictionary <string, double>(); for (int i = 1; i < subList.Count(); i++) { values.Add(Headers[i], Convert.ToDouble(subList[i])); } dataPoint.Values = values; dataPoints.Add(dataPoint); } ParallelCoordinatesData data = new ParallelCoordinatesData(); data.Data = dataPoints; return(data); }
/// <summary> /// Parallel Coordinates Chart. /// </summary> /// <param name="Data">Parallel Coordinates Data object.</param> /// <param name="Style">Parallel Coordinates Style object.</param> /// <returns name="Chart">Parallel Coordinates Chart.</returns> public static ParallelCoordinatesChart Chart(ParallelCoordinatesData Data, ParallelCoordinatesStyle Style) { ParallelCoordinatesChart chart = new ParallelCoordinatesChart(Data, Style); return(chart); }
/// <summary> /// Parallel Coordinates Chart. /// </summary> /// <param name="Data">Parallel Coordinates Data object.</param> /// <param name="Style">Parallel Coordinates Style object.</param> /// <returns name="Chart">Parallel Coordinates Chart.</returns> public static D3jsLib.ParallelCoordinates.ParallelCoordinatesChart Chart(ParallelCoordinatesData Data, ParallelCoordinatesStyle Style) { D3jsLib.ParallelCoordinates.ParallelCoordinatesChart chart = new D3jsLib.ParallelCoordinates.ParallelCoordinatesChart(Data, Style); return(chart); }