<commit_before>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;
using Calculation;

namespace BalanceBeamGui {
    public partial class Window1 : Window {
        #region Fields
        private const Int32 _roundingDigitsMatrixTorque = 2;
        private const Int32 _roundingDigitsMatrixProbability = 3;
        private const Int32 _roundingDigitsToolTips = 4;
        private const Int32 _roundingDigitsMatrixEntropyReduction = 3;
        private const double _canvasPadding = 17;
        private double _arrowTotalRadiusOffset = 4;
        private const Int32 _grdFeatureTorquePositiveColumnIndex = 1;
        private const Int32 _grdFeatureTorqueNegativeColumnIndex = 2;
        private const Int32 _grdFeatureEntropyPairColumnIndex = 3;
        private const Int32 _grdFeatureEntropySetColumnIndex = 4;

        //private byte _transparencyHighlightInBytes = 119;//http://www.easycalculation.com/hex-converter.php
        private readonly Line _potentialTorqueLineUp = new Line();
        private readonly Line _potentialTorqueLineDown = new Line();
        private readonly TextBlock _potentialTorqueTextUp = new TextBlock();
        private readonly TextBlock _potentialTorqueTextDown = new TextBlock();

        private readonly static StudyModule[] _possibleModules = { StudyModule.ChestPain, StudyModule.PediatricDyspnea };
        //private const StudyModule _module = StudyModule.ChestPain;
        private StudyModule _module;//= _possibleModules[0];//StudyModule.PediatricDyspnea;

        private double _maxAbsoluteTorque = double.NaN;
        private byte _diagnosisID1;// = 1; Set in InitializeFeatureGrid
        private byte _diagnosisID2;// = 2;

        private DataTable _dtSensitivities;
        BeamDataSet.tblFeatureDataTable _tblFeature = new BeamDataSet.tblFeatureDataTable();
        private Label _lblColumnGrandHeader = new Label();
        private Label _lblRowGrandHeader = new Label();


        private Grinder _grinder;
        private DataColumn[] _dcEvidences;
        private bool _isWindowLoaded = false;
        #endregion
        #region Working Cosmetics
        
        // 9 colors from colorbrewer2.org>qualitative>paired color scheme plus 9 colors from colorbrewer2.org>sequential>greys color scheme - Jay 101513
        //private readonly Color[] _allPossibleColors = { Color.FromArgb(255, 166, 206, 227), Color.FromArgb(255, 31, 120, 180), Color.FromArgb(255, 178, 223, 138), Color.FromArgb(255, 51, 160, 44), Color.FromArgb(255, 251, 154, 153), Color.FromArgb(255, 227, 26, 28), Color.FromArgb(255, 253, 191, 111), Color.FromArgb(255, 255, 127, 0), Color.FromArgb(255, 202, 178, 214), Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 240, 240, 240), Color.FromArgb(255, 217, 217, 217), Color.FromArgb(255, 189, 189, 189), Color.FromArgb(255, 150, 150, 150), Color.FromArgb(255, 115, 115, 115), Color.FromArgb(255, 82, 82, 82), Color.FromArgb(255, 37, 37, 37), Color.FromArgb(255, 0, 0, 0) };

        private readonly Color[] _allPossibleColors = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen };
        //Modifiable by user
        // default colors for comboBoxes - Jay 101513
        // private SolidColorBrush _brushPalette = Color.FromArgb(255, 255, 255, 255); //white
        // private SolidColorBrush _brushForegroundPositive = Color.FromArgb(255, 51, 160, 44); //green
        // private SolidColorBrush _brushBackgroundPositive = Color.FromArgb(255, 166, 206, 227); //light blue
        // private SolidColorBrush _brushForegroundNegative = Color.FromArgb(255, 227, 26, 28); // red
        // private SolidColorBrush _brushBackgroundNegative = Color.FromArgb(255, 251, 154, 153); // pink
        // private SolidColorBrush _brushHighlight = Color.FromArgb(255, 255, 127, 0); // orange
        
		private SolidColorBrush _brushPalette = Brushes.MintCream;
        private SolidColorBrush _brushForegroundPositive = Brushes.Blue;//
        private SolidColorBrush _brushBackgroundPositive = Brushes.LightBlue;
        private SolidColorBrush _brushForegroundNegative = Brushes.Firebrick;// Coral;
        private SolidColorBrush _brushBackgroundNegative = Brushes.LightPink;// LightCoral;<commit_msg>new color schemes<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.ComponentModel;
using Calculation;

namespace BalanceBeamGui {
    public partial class Window1 : Window {
        #region Fields
        private const Int32 _roundingDigitsMatrixTorque = 2;
        private const Int32 _roundingDigitsMatrixProbability = 3;
        private const Int32 _roundingDigitsToolTips = 4;
        private const Int32 _roundingDigitsMatrixEntropyReduction = 3;
        private const double _canvasPadding = 17;
        private double _arrowTotalRadiusOffset = 4;
        private const Int32 _grdFeatureTorquePositiveColumnIndex = 1;
        private const Int32 _grdFeatureTorqueNegativeColumnIndex = 2;
        private const Int32 _grdFeatureEntropyPairColumnIndex = 3;
        private const Int32 _grdFeatureEntropySetColumnIndex = 4;

        //private byte _transparencyHighlightInBytes = 119;//http://www.easycalculation.com/hex-converter.php
        private readonly Line _potentialTorqueLineUp = new Line();
        private readonly Line _potentialTorqueLineDown = new Line();
        private readonly TextBlock _potentialTorqueTextUp = new TextBlock();
        private readonly TextBlock _potentialTorqueTextDown = new TextBlock();

        private readonly static StudyModule[] _possibleModules = { StudyModule.ChestPain, StudyModule.PediatricDyspnea };
        //private const StudyModule _module = StudyModule.ChestPain;
        private StudyModule _module;//= _possibleModules[0];//StudyModule.PediatricDyspnea;

        private double _maxAbsoluteTorque = double.NaN;
        private byte _diagnosisID1;// = 1; Set in InitializeFeatureGrid
        private byte _diagnosisID2;// = 2;

        private DataTable _dtSensitivities;
        BeamDataSet.tblFeatureDataTable _tblFeature = new BeamDataSet.tblFeatureDataTable();
        private Label _lblColumnGrandHeader = new Label();
        private Label _lblRowGrandHeader = new Label();


        private Grinder _grinder;
        private DataColumn[] _dcEvidences;
        private bool _isWindowLoaded = false;
        #endregion
        #region Working Cosmetics
        
        // 9 colors from colorbrewer2.org>qualitative>paired color scheme plus 9 colors from colorbrewer2.org>sequential>greys color scheme - Jay 101513
        private readonly Color[] _allPossibleColors = { Color.FromArgb(255, 166, 206, 227), Color.FromArgb(255, 31, 120, 180), Color.FromArgb(255, 178, 223, 138), Color.FromArgb(255, 51, 160, 44), Color.FromArgb(255, 251, 154, 153), Color.FromArgb(255, 227, 26, 28), Color.FromArgb(255, 253, 191, 111), Color.FromArgb(255, 255, 127, 0), Color.FromArgb(255, 202, 178, 214), Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 240, 240, 240), Color.FromArgb(255, 217, 217, 217), Color.FromArgb(255, 189, 189, 189), Color.FromArgb(255, 150, 150, 150), Color.FromArgb(255, 115, 115, 115), Color.FromArgb(255, 82, 82, 82), Color.FromArgb(255, 37, 37, 37), Color.FromArgb(255, 0, 0, 0) };

        // private readonly Color[] _allPossibleColors = { Colors.AliceBlue, Colors.AntiqueWhite, Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige, Colors.Bisque, Colors.Black, Colors.BlanchedAlmond, Colors.Blue, Colors.BlueViolet, Colors.Brown, Colors.BurlyWood, Colors.CadetBlue, Colors.Chartreuse, Colors.Chocolate, Colors.Coral, Colors.CornflowerBlue, Colors.Cornsilk, Colors.Crimson, Colors.Cyan, Colors.DarkBlue, Colors.DarkCyan, Colors.DarkGoldenrod, Colors.DarkGray, Colors.DarkGreen, Colors.DarkKhaki, Colors.DarkMagenta, Colors.DarkOliveGreen, Colors.DarkOrange, Colors.DarkOrchid, Colors.DarkRed, Colors.DarkSalmon, Colors.DarkSeaGreen, Colors.DarkSlateBlue, Colors.DarkSlateGray, Colors.DarkTurquoise, Colors.DarkViolet, Colors.DeepPink, Colors.DeepSkyBlue, Colors.DimGray, Colors.DodgerBlue, Colors.Firebrick, Colors.FloralWhite, Colors.ForestGreen, Colors.Fuchsia, Colors.Gainsboro, Colors.GhostWhite, Colors.Gold, Colors.Goldenrod, Colors.Gray, Colors.Green, Colors.GreenYellow, Colors.Honeydew, Colors.HotPink, Colors.IndianRed, Colors.Indigo, Colors.Ivory, Colors.Khaki, Colors.Lavender, Colors.LavenderBlush, Colors.LawnGreen, Colors.LemonChiffon, Colors.LightBlue, Colors.LightCoral, Colors.LightCyan, Colors.LightGoldenrodYellow, Colors.LightGray, Colors.LightGreen, Colors.LightPink, Colors.LightSalmon, Colors.LightSeaGreen, Colors.LightSkyBlue, Colors.LightSlateGray, Colors.LightSteelBlue, Colors.LightYellow, Colors.Lime, Colors.LimeGreen, Colors.Linen, Colors.Magenta, Colors.Maroon, Colors.MediumAquamarine, Colors.MediumBlue, Colors.MediumOrchid, Colors.MediumPurple, Colors.MediumSeaGreen, Colors.MediumSlateBlue, Colors.MediumSpringGreen, Colors.MediumTurquoise, Colors.MediumVioletRed, Colors.MidnightBlue, Colors.MintCream, Colors.MistyRose, Colors.Moccasin, Colors.NavajoWhite, Colors.Navy, Colors.OldLace, Colors.Olive, Colors.OliveDrab, Colors.Orange, Colors.OrangeRed, Colors.Orchid, Colors.PaleGoldenrod, Colors.PaleGreen, Colors.PaleTurquoise, Colors.PaleVioletRed, Colors.PapayaWhip, Colors.PeachPuff, Colors.Peru, Colors.Pink, Colors.Plum, Colors.PowderBlue, Colors.Purple, Colors.Red, Colors.RosyBrown, Colors.RoyalBlue, Colors.SaddleBrown, Colors.Salmon, Colors.SandyBrown, Colors.SeaGreen, Colors.SeaShell, Colors.Sienna, Colors.Silver, Colors.SkyBlue, Colors.SlateBlue, Colors.SlateGray, Colors.Snow, Colors.SpringGreen, Colors.SteelBlue, Colors.Tan, Colors.Teal, Colors.Thistle, Colors.Tomato, Colors.Transparent, Colors.Turquoise, Colors.Violet, Colors.Wheat, Colors.White, Colors.WhiteSmoke, Colors.Yellow, Colors.YellowGreen };
        //Modifiable by user
        // default colors for comboBoxes - Jay 101513
        // private SolidColorBrush _brushPalette = Color.FromArgb(255, 255, 255, 255); //white
        // private SolidColorBrush _brushForegroundPositive = Color.FromArgb(255, 51, 160, 44); //green
        // private SolidColorBrush _brushBackgroundPositive = Color.FromArgb(255, 166, 206, 227); //light blue
        // private SolidColorBrush _brushForegroundNegative = Color.FromArgb(255, 227, 26, 28); // red
        // private SolidColorBrush _brushBackgroundNegative = Color.FromArgb(255, 251, 154, 153); // pink
        // private SolidColorBrush _brushHighlight = Color.FromArgb(255, 255, 127, 0); // orange
        
		private SolidColorBrush _brushPalette = Brushes.MintCream;
        private SolidColorBrush _brushForegroundPositive = Brushes.Blue;//
        private SolidColorBrush _brushBackgroundPositive = Brushes.LightBlue;
        private SolidColorBrush _brushForegroundNegative = Brushes.Firebrick;// Coral;
        private SolidColorBrush _brushBackgroundNegative = Brushes.LightPink;// LightCoral;
{'fraction_non_alphanumeric': 0.09813514854995391, 'fraction_numerical': 0.04467134652201659, 'mean_word_length': 4.7520391517128875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3602439', 'n_tokens_mistral': 5257, 'n_tokens_neox': 4455, 'n_words': 1001}