Contains the data for heatmap plots.
Inheritance: XYPlotValue
Exemplo n.º 1
0
        public HeatmapPlotValue Function(MatrixValue Z)
        {
            var plot = new HeatmapPlotValue();

            plot.AddPoints(Z);
            return(plot);
        }
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var hm = new HeatmapPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                hm.Deserialize(ds);
                hm.ColorPalette = (ColorPalettes)ds.GetInt();
                hm.Minimum      = ds.GetDouble();
                hm.Maximum      = ds.GetDouble();

                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points <HeatPoint>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x = ds.GetInt();
                        var y = ds.GetInt();
                        var z = ds.GetDouble();

                        points.Add(new HeatPoint
                        {
                            Column    = x,
                            Row       = y,
                            Magnitude = z
                        });
                    }

                    hm.AddSeries(points);
                }
            }

            return(hm);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var hm = new HeatmapPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                hm.Deserialize(ds);
                hm.ColorPalette = (ColorPalettes)ds.GetInt();
                hm.Minimum = ds.GetDouble();
                hm.Maximum = ds.GetDouble();

                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points<HeatPoint>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x = ds.GetInt();
                        var y = ds.GetInt();
                        var z = ds.GetDouble();

                        points.Add(new HeatPoint
                        {
                            Column = x,
                            Row = y,
                            Magnitude = z
                        });
                    }

                    hm.AddSeries(points);
                }
            }

            return hm;
        }