public void UpdateGraphVm() { if (Values == null) { return; } var bins = A2dUt.ToP2V(Histos.Histogram2d( bounds: Bounds, binCount: BinCounts.Sz2Int, vals: Values)).ToArray(); var counts = bins.Select(b => b.V.V).ToArray(); var colorLeg = ColorLegger(counts); LegendVm = new LegendVm( minVal: "<" + colorLeg.minV, midVal: ColorSets.GetLegMidVal(colorLeg).ToString(), maxVal: ">" + colorLeg.maxV, minCol: colorLeg.minC, midColors: colorLeg.spanC, maxColor: colorLeg.maxC ); GraphVm.Watermark = $"Bins count: [{BinCounts.X}, {BinCounts.Y}]"; GraphVm.SetData( boundingRect: Bounds, plotPoints: Enumerable.Empty <P2V <float, Color> >(), plotLines: Enumerable.Empty <LS2V <float, Color> >(), filledRects: MakePlotRectangles(colorLeg: colorLeg, hist: bins), openRects: Enumerable.Empty <RV <float, Color> >()); }
public static IEnumerable <P2V <int, float> > CurValuesAsP2Vs(this StarGrid starGrid) { return(A2dUt.ToP2V(starGrid.Stars).Select(s => new P2V <int, float>(x: s.X, y: s.Y, v: s.V.CurValue))); }
public static IEnumerable <P2V <int, float> > CurDeltasAsP2Vs(this Star5Grid starGrid) { return(A2dUt.ToP2V(starGrid.Stars).Select(s => new P2V <int, float>(x: s.X, y: s.Y, v: s.V.NoiseField))); }