//Ensures that default values are in place if otherwise parameters
 // would be null.
 private void ProtectInitialise()
 {
     if (BusColorGradient == null)
     {
         BusColorGradient = AdaptiveGradient.BlueRedGradient();
     }
 }
        /// <summary>
        /// Instantiates a new <see cref="ValueTransformableTreeGraph"/>.
        /// </summary>
        public ValueTransformableTreeGraph()
        {
            //sensible defaults.
            BusColorGradient    = AdaptiveGradient.BlueRedGradient();
            BusColorTransform   = b => b.VoltagePU.Magnitude;
            BusSizeTransform    = b => 2;
            BusSizeMax          = 2;
            BusSizeMin          = 2;
            BusVisibleTransform = b => true;

            RingEnabledTransform   = b => b.ConnectedTo.OfType <Generator>().Any();
            RingColor              = Colors.Green;
            RingThickness          = 2;
            RingDistanceTransform  = b => 2;
            RingDistanceFromCenter = false;

            LineThickness = 2;
        }