Example #1
0
        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> >());
        }
Example #2
0
 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)));
 }
Example #3
0
 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)));
 }