public MapPlot(DataCube aDataCube, Panel aDestinationPanel, Renderer aRenderer, ColorMap aColorMap, ParallelCoordinatesPlot aPcPlot, GMSDocument aDoc) { iDataCube = aDataCube; iPanel = aDestinationPanel; renderer = aRenderer; iColorMap = aColorMap; iPcPlot = aPcPlot; iDoc = aDoc; iLegendColorMap = iDoc.iFilteredSelectedColorMap; SetupMapLayers(); //Get country names iCountryNames = iDoc.GetFilteredCountryNames(); //Prepare tooltip iToolTip = new GavToolTip(iPanel); iToolTip.FadeEnable = true; iToolTip.FadeTime = TOOLTIP_FADE_DELAY; iToolTip.Show(new Point(0, 0)); iToolTip.Hide(); iMouseHoverControl = new MouseHoverController(iPanel, TOOLTIP_SENSITIVITY, TIMER_DELAY); iMouseHoverControl.Hover += new EventHandler(iMouseHoverControl_Hover); iMouseHoverControl.HoverEnd += new EventHandler(iMouseHoverControl_HoverEnd); iDoc.Picked += new EventHandler <IndexesPickedEventArgs>(DocumentPicked); iDoc.ColorMapChanged += new EventHandler <EventArgs>(DocumentColorMapChanged); }
/// <summary> /// Constructor /// </summary> public TreeMap(System.Windows.Forms.Panel aPanel, GMSDocument aDoc, ParallelCoordinatesPlot aPcPlot) { iPanel = aPanel; iPanel.SizeChanged += new EventHandler(SizeChanged); iPanel.Paint += new System.Windows.Forms.PaintEventHandler(Paint); iToolTip = new GavToolTip(iPanel); iPcPlot = aPcPlot; iToolTip.FadeEnable = true; iToolTip.FadeTime = TOOLTIP_FADE_DELAY; iToolTip.Show(new Point(0, 0)); iToolTip.Hide(); iPanel.MouseLeave += new EventHandler(MouseHoverControlHoverEnd); iMouseHoverControl = new MouseHoverController(iPanel, 5, TIMER_DELAY); iMouseHoverControl.Hover += new EventHandler(MouseHoverControlHover); iMouseHoverControl.HoverEnd += new EventHandler(MouseHoverControlHoverEnd); iDoc = aDoc; aDoc.ColorMapChanged += new EventHandler <EventArgs>(DocumentColorMapChanged); iDoc.Picked += new EventHandler <IndexesPickedEventArgs>(DocumentPicked); iPanel.MouseDown += new MouseEventHandler(MouseDown); iSelectedIds = new List <int>(); iZoomIn = false; UpdateDrawingArea(); }
/// <summary> /// Initializes the view components: PC plot, its SubComponents and /// its properties /// </summary> private void SetupView() { this.headers.Add("Country"); this.headers.Add("Median Age\n(years)"); this.headers.Add("Albums\n(Log2)"); this.headers.Add("Unemployment Rate\n(%)"); this.headers.Add("GDP Per Capita\n($)"); iPcPlot = InitializeParallelCoordinatesPlot(iPanel, iDataCube, -1, headers); // Padding: so the names of the countries don't be cut iPcPlot.PaddingLeft += 60; iPcPlot.PaddingTop += 15; iPcPlot.PickSensitivity = 3; iPcPlot.Picked += new EventHandler <IndexesPickedEventArgs>(pcPlot_Picked); iPcPlot.FilterChanged += new EventHandler(pcPlot_FilterChanged); iPcPlot.LineTransparency = 235; iPcPlot.LineTransparencySelected = 200; iPcPlot.SelectedLineColor = Color.Black; iPcPlot.SelectedLineThickness = 3; iPcPlot.OutfilteredLineColor = Color.LightGray; iPcPlot.ShowOutFilteredLines = true; textLens = new TextLensSubComponent(iPcPlot, iPanel, iDoc); iPcPlot.AddSubComponent(textLens); iPcPlot.HeaderClicked += new EventHandler(PCPlotHeaderClicked); /************************************************************************/ /* XXX: FONTS NOT WORKING */ /************************************************************************/ iPcPlot.FontSelectedHeaders = new Font("Verdana", 14, FontStyle.Bold); iPcPlot.SelectedHeaderTextColor = Color.Red; List <int> list = new List <int>(); list.Add(1); iPcPlot.SetSelectedHeaderIndexes(list); int countriesCount = iCountryNames.Count; // iterate through all the countries and for (int i = 0; i < countriesCount; i++) { float verticalPosition = 1.0f - (float)i / (float)(countriesCount - 1); string country = iCountryNames[i]; textLens.AddLabel(country, verticalPosition, (int)i); } }
public TextLensSubComponent(ParallelCoordinatesPlot aPlot, Panel aPanel, GMSDocument aDoc) { plot = aPlot; iPanel = aPanel; graphicsObj = iPanel.CreateGraphics(); iLabelZoomed = false; labels = new List <Label>(); iMaxLabelWidth = 0.0f; mouseOverText = false; notVisibleTextColor = System.Drawing.Color.LightGray; selectedTextColor = System.Drawing.Color.Red; visibleTextColor = System.Drawing.Color.Black; lastButtonPressed = MouseButtons.None; iDoc = aDoc; iDoc.Picked += new EventHandler <IndexesPickedEventArgs>(DocumentPicked); }
/// <summary> /// Creates the PC plot given /// </summary> /// <param name="panel"></param> /// <param name="filter"></param> /// <param name="columnIndex">the column index for which we're clustering the data /// in case we're using K-Means</param> /// <param name="headers"></param> /// <returns></returns> private ParallelCoordinatesPlot InitializeParallelCoordinatesPlot(Panel panel, IDataCubeProvider <float> filter, int columnIndex, List <string> headers) { ParallelCoordinatesPlot filterPlot = new ParallelCoordinatesPlot(); filterPlot.Input = filter; filterPlot.Headers = headers; // to color according to clusters if (columnIndex != -1) { iColorMap.Index = columnIndex; iDoc.iFilteredSelectedColorMap.Index = columnIndex; } filterPlot.ColorMap = iColorMap; filterPlot.Enabled = true; renderer.Add(filterPlot, panel); return(filterPlot); }
void pcPlot_FilterChanged(object sender, EventArgs e) { ParallelCoordinatesPlot plot = (ParallelCoordinatesPlot)sender; textLens.VisibilityChanged(plot.IndexVisibilityHandler); }
private void InitializeparallelCoordinates() { //throw new NotImplementedException(); parallelCoordinatesPlot = new ParallelCoordinatesPlot(); parallelCoordinatesPlot.Headers = excelDataProvider.ColumnHeaders; parallelCoordinatesPlot.Input = unfilteredYearSliceDataTransformer; parallelCoordinatesPlot.ColorMap = colorMap; parallelCoordinatesPlot.FilterChanged += new EventHandler(parallelCoordinatesPlot_FilterChanged); UpdateFilter(); }
public CountriesTreeMapForm(GMSDocument aDoc, string aTreeMapType, ToolStripComboBox aTreeMapCombo, ColorMap aSharedColorMap, ParallelCoordinatesPlot aPcPlot) { InitializeComponent(); iDoc = aDoc; iTreeMap = new TreeMap(mainPanel, iDoc, aPcPlot); iLoaded = false; iTreeMapType = GetTreeMapType(aTreeMapType); iTreeMapCombo = aTreeMapCombo; iSharedColorMap = aSharedColorMap; }