Ejemplo n.º 1
0
        public NodeWeightStylerCategories(ColorGradient _gradient, GraphStylerSettings _settings = null)
        {
            if (_settings != null)
            {
                settings = _settings;
            }

            gradient = _gradient;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the thickness.
        /// </summary>
        /// <param name="weight">The weight.</param>
        /// <param name="s">The s.</param>
        /// <returns></returns>
        public Int32 GetThickness(Double weight, GraphStylerSettings s)
        {
            Double w = weight - min;

            w = w.GetRatio(range);

            w = s.lineMin + ((s.lineMax - s.lineMin) * s.lineMax);

            return(Convert.ToInt32(w));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the alpha.
        /// </summary>
        /// <param name="weight">The weight.</param>
        /// <param name="s">The s.</param>
        /// <returns></returns>
        public Byte GetAlpha(Double weight, GraphStylerSettings s)
        {
            Double w = weight - min;

            w = w.GetRatio(range);
            if (w > 1)
            {
                w = 1;
            }
            w = s.alphaMin + ((s.alphaMax - s.alphaMin) * w);
            Byte b = Convert.ToByte(w * Byte.MaxValue);

            return(b);
        }