/// <summary>
        ///     Normalized Stacked Bar Chart Data object.
        /// </summary>
        /// <param name="Headers">Names of all values that will be grouped. First value is always "Name".</param>
        /// <param name="Values">Nested List of values where first item in a sub-list is Group Name. Following items
        /// must match number of value names defined in Headers input. </param>
        /// <returns name="Data">Normalized Stacked Bar Chart Data</returns>
        /// <search>normalized, data, stacked, bar, chart</search>
        public static NormalizedStackedBarChartData Data(
            List <string> Headers,
            List <List <object> > Values)
        {
            NormalizedStackedBarChartData data = new NormalizedStackedBarChartData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromList(Headers, Values));

            return(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)
        {
            ParallelCoordinatesData data = new ParallelCoordinatesData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromList(Headers, Values));

            return(data);
        }
Exemple #3
0
        /// <summary>
        ///     Data.
        /// </summary>
        /// <param name="Headers">Header values.</param>
        /// <param name="Values">Data values.</param>
        /// <returns name="Data">Data</returns>
        public static ScatterPlotMatrixData Data(
            List <string> Headers,
            List <List <object> > Values)
        {
            ScatterPlotMatrixData data = new ScatterPlotMatrixData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromList(Headers, Values));

            return(data);
        }
        /// <summary>
        ///     Grouped Bar Chart Data.
        /// </summary>
        /// <param name="Headers"></param>
        /// <param name="Values"></param>
        /// <param name="Domain"></param>
        /// <returns name="Data">Grouped Bar Chart Data object</returns>
        public static GroupedBarChartData Data(
            List <string> Headers,
            List <List <object> > Values,
            [DefaultArgumentAttribute("Charts.MiscNodes.GetNull()")] Domain Domain)
        {
            GroupedBarChartData data = new GroupedBarChartData();

            data.Data   = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromList(Headers, Values));
            data.Domain = Domain;

            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)
        {
            string filePath = null;

            if (!DA.GetData <string>(0, ref filePath))
            {
                return;
            }

            ScatterPlotMatrixData data = new ScatterPlotMatrixData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCsv(filePath));

            DA.SetData(0, data);
        }
Exemple #6
0
        /// <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)
        {
            string filePath = null;

            if (!DA.GetData <string>(0, ref filePath))
            {
                return;
            }

            NormalizedStackedBarChartData data = new NormalizedStackedBarChartData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCsv(filePath));

            DA.SetData(0, 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)
        {
            string filePath = null;

            if (!DA.GetData <string>(0, ref filePath))
            {
                return;
            }

            ParallelCoordinatesData data = new ParallelCoordinatesData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCSV(filePath));

            DA.SetData(0, 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)
        {
            string filePath = null;
            Domain domain   = null;

            if (!DA.GetData <string>(0, ref filePath))
            {
                return;
            }
            DA.GetData <Domain>(1, ref domain);

            GroupedBarChartData data = new GroupedBarChartData();

            data.Data   = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCsv(filePath));
            data.Domain = domain;

            DA.SetData(0, data);
        }
Exemple #9
0
        /// <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>
        ///     Normalized Stacked Bar Chart Data object.
        /// </summary>
        /// <param name="FilePath">Path to a CSV file.</param>
        /// <returns name="Data">Data Class for use with Stacked Bar Chart.</returns>
        /// <search>normalized, data, stacked bar chart, chart, bar, grouped</search>
        public static NormalizedStackedBarChartData 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;
            }

            NormalizedStackedBarChartData data = new NormalizedStackedBarChartData();

            data.Data = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCSV(_filePath));

            return(data);
        }
Exemple #12
0
        /// <summary>
        ///     Grouped Bar Chart Data object.
        /// </summary>
        /// <param name="FilePath">Path to a CSV file.</param>
        /// <param name="Domain">Y Domain of a chart.</param>
        /// <returns name="Data">Data Class for use with Grouped Bar Chart.</returns>
        /// <search>data, grouped bar chart, chart, bar, grouped</search>
        public static GroupedBarChartData DataFromCSV(
            object FilePath,
            [DefaultArgumentAttribute("Charts.MiscNodes.GetNull()")] Domain Domain)
        {
            // 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;
            }

            GroupedBarChartData data = new GroupedBarChartData();

            data.Data   = ChartsUtilities.DataToJsonString(ChartsUtilities.Data2FromCsv(_filePath));
            data.Domain = Domain;

            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;

            D3jsLib.Domain domain = null;

            if (!DA.GetDataList <string>(0, headers))
            {
                return;
            }
            if (!DA.GetDataTree(1, out values))
            {
                return;
            }
            DA.GetData <D3jsLib.Domain>(2, ref domain);

            StackedBarChartData data = new StackedBarChartData();

            data.Data   = ChartsUtilities.DataToJsonString(Utilities.Utilities.Data2FromTree(headers, values));
            data.Domain = domain;

            DA.SetData(0, data);
        }