Beispiel #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.range.Min,
                midVal: ColorSets.GetLegMidVal(colorLeg).ToString(),
                maxVal: ">" + colorLeg.range.Max,
                minCol: colorLeg.minC,
                midColors: colorLeg.spanC,
                maxColor: colorLeg.maxC
                );

            GraphVm.Watermark = $"Bins count: [{BinCounts.X}, {BinCounts.Y}]";
            GraphVm.SetData(
                imageWidth: -1.0,
                imageHeight: -1.0,
                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> >());
        }
Beispiel #2
0
 public Grid2DVm(Sz2 <int> strides, ColorLeg <T> colorLeg, string title = "")
 {
     Strides   = strides;
     ColorLeg  = colorLeg;
     WbImageVm = new WbImageVm();
     Title     = title;
     LegendVm  = new LegendVm(
         minVal: "<" + colorLeg.range.Min,
         midVal: ColorSets.GetLegMidVal(colorLeg).ToString(),
         maxVal: ">" + colorLeg.range.Max,
         minCol: colorLeg.minC,
         midColors: colorLeg.spanC,
         maxColor: colorLeg.maxC
         );
 }
Beispiel #3
0
        public Grid2D2IVm(Sz2 <int> strides, ColorLeg2I <float> colorLeg, string title = "")
        {
            Strides    = strides;
            ColorLeg2I = colorLeg;
            WbImageVm  = new WbImageVm();
            Title      = title;
            var sp = A2dUt.GetColumn(colorLeg.spanC, colorLeg.spanC.GetLength(1) - 1);

            LegendVm = new LegendVm(
                minVal: "<" + colorLeg.rangeV.MinY,
                midVal: ColorSets2I.GetLegMidVal(colorLeg).ToString(),
                maxVal: ">" + colorLeg.rangeV.MaxY,
                minCol: colorLeg.exteriorC,
                midColors: sp,
                maxColor: colorLeg.exteriorC
                );
        }
Beispiel #4
0
 public Grid4DVm(P2 <int> strides, P2 <int> cursor, ColorLeg <T> colorLeg, string title = "")
 {
     X1Y1      = true;
     Strides   = strides;
     Cursor    = cursor;
     Values    = new List <LS2V <int, T> >();
     ColorLeg  = colorLeg;
     WbImageVm = new WbImageVm();
     Title     = title;
     LegendVm  = new LegendVm(
         minVal: "<" + colorLeg.range.Min,
         midVal: ColorSets.GetLegMidVal(colorLeg).ToString(),
         maxVal: ">" + colorLeg.range.Max,
         minCol: colorLeg.minC,
         midColors: colorLeg.spanC,
         maxColor: colorLeg.maxC
         );
 }