public GEMI() { double[] values = new double[] { 0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1 }; colorPalette = new MapValue.ColorPalette(values); plotValue = new PlotValue(values); }
public MSAVI() { double[] values = new double[] { -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 }; colorPalette = new MapValue.ColorPalette(values); plotValue = new PlotValue(values); }
public NDVI() { double[] values = new double[] { -1, 0, 0.033, 0.066, 0.1, 0.133, 0.166, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1 }; colorPalette = new MapValue.ColorPalette(values); plotValue = new PlotValue(values); }
public SeriesViewModel(XYPlotValue value) { var index = 1; _value = value; _children = new ObservableCollection <SeriesElementViewModel>(); for (var i = 0; i < value.Count; i++) { var series = value.GetSeries(i); var child = new SeriesElementViewModel(series, index++); _children.Add(child); } SelectedItem = Children.FirstOrDefault(); _save = new RelayCommand(x => { var window = x as Window; foreach (var series in Children) { series.Save(); } _value.UpdateProperties(); if (window != null) { window.Close(); } }); }
private void graph_PlotAreaMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (graph.Plots.Count() == 0) { return; } Point screenPosition = e.GetPosition(graph); Point relativePosition = graph.ScreenToRelative(screenPosition); PlotValue nearestValue = graph.FindNearestValue(graph.Plots[0], relativePosition, query); IPlot plot1 = nearestValue.PlotObserver; var plot = (Plot)graph.Plots[plot1.Index]; if (plot == null || plot == _SelectedPlot) { return; } _SelectedPlot = plot; foreach (Plot p in graph.Plots) { ((LinePlotRenderer)p.Renderer).StrokeThickness = 1.0; } ((LinePlotRenderer)_SelectedPlot.Renderer).StrokeThickness = 2.0; int index = graph.Plots.IndexOf(plot); lstYxis.SelectedIndex = index; }
static void Print(PlotValue plot, IPlotSerializer plotter) { var printDialog = new PrintDialog(); var result = printDialog.ShowDialog(); if (result.HasValue && result.Value) { plotter.Print(printDialog, plot.Title ?? "Sumerics Plot"); } }
public PlotViewModel(PlotValue plot, IVisualizer visualizer, IConsole console) { _controller = ControllerFactory.Create(plot); _console = new RelayCommand(_ => ShowConsole(console)); _settings = new RelayCommand(_ => ShowSettings(plot)); _series = new RelayCommand(_ => ShowSeries(plot)); _grid = new RelayCommand(_ => _controller.ToggleGrid()); _center = new RelayCommand(_ => _controller.CenterPlot()); _dock = new RelayCommand(_ => visualizer.Dock(this)); _undock = new RelayCommand(_ => visualizer.Undock()); _print = new RelayCommand(obj => Print(plot, obj as IPlotSerializer)); _save = new RelayCommand(obj => Save(plot, obj as IPlotSerializer)); }
static void ShowSettings(PlotValue plot) { if (plot is XYPlotValue) { var context = new PlotSettingsViewModel((XYPlotValue)plot); ShowDialog <PlotSettingsWindow>(context); } else if (plot is SubPlotValue) { var context = new SubPlotSettingsViewModel((SubPlotValue)plot); ShowDialog <SubPlotSettingsWindow>(context); } }
static void ShowSeries(PlotValue plot) { if (plot is ContourPlotValue) { var context = new ContourViewModel((ContourPlotValue)plot); ShowDialog <ContourSeriesWindow>(context); } else if (plot is HeatmapPlotValue) { var context = new HeatmapViewModel((HeatmapPlotValue)plot); ShowDialog <HeatSeriesWindow>(context); } else if (plot is XYPlotValue) { var context = new SeriesViewModel((XYPlotValue)plot); ShowDialog <PlotSeriesWindow>(context); } }
static void Save(PlotValue plot, IPlotSerializer plotter) { var context = new SaveImageViewModel(); context.ImageWidth = 640; context.ImageHeight = 480; var window = new SaveImageWindow { DataContext = context }; window.Title = Messages.SavePlotAs; if (!String.IsNullOrEmpty(plot.Title)) { context.SelectedFile = new FileModel(plot.Title); } window.ShowDialog(); if (context.Accepted) { var path = context.SelectedFile.FullName; var filename = Path.GetFileName(path); var message = String.Format(Messages.PlotSavedMessage, filename); var output = new OutputViewModel { Title = Messages.FileCreated, Message = message }; using (var fs = File.Create(path)) { plotter.Save(fs, context.ImageWidth, context.ImageHeight); } output.ShowWindow(); } }
public void Function(PlotValue plot) { var visualizer = _application.Get <IVisualizer>(); visualizer.Dock(plot); }
public SumericsPlot(PlotValue plot) { _plot = plot; _plot.OnPlotChanged += PlotValueChanged; }