/// <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> names  = new List <string>();
            List <double> values = new List <double>();

            D3jsLib.Domain domain = null;

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

            List <D3jsLib.DataPoint1> dataPoints = names.Zip(values, (x, y) => new D3jsLib.DataPoint1 {
                name = x, value = y
            }).ToList();
            HorizontalBarChartData data = new HorizontalBarChartData();

            data.Data   = dataPoints;
            data.Domain = domain;

            DA.SetData(0, data);
        }
Пример #2
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)
        {
            double a = 0.0;
            double b = 1.0;

            DA.GetData <double>(0, ref a);
            DA.GetData <double>(1, ref b);

            D3jsLib.Domain domain = new D3jsLib.Domain(a, b);

            DA.SetData(0, domain);
        }
Пример #3
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;

            D3jsLib.Domain domain = null;

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

            BarData data = new BarData();

            data.Data   = new JavaScriptSerializer().Serialize(D3jsLib.Utilities.ChartsUtilities.Data1FromCSV(filePath));
            data.Domain = domain;

            DA.SetData(0, data);
        }
Пример #4
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;

            D3jsLib.Domain domain = null;

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

            HorizontalBarChartData data = new HorizontalBarChartData();

            data.Data   = D3jsLib.Utilities.ChartsUtilities.Data1FromCSV(filePath);
            data.Domain = domain;

            DA.SetData(0, data);
        }