示例#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> >());
        }
示例#2
0
 public ProjectionControlVm()
 {
     XSelectorVm = new GroupSelectorVm {
         Orientation = Orientation.Horizontal
     };
     YSelectorVm = new GroupSelectorVm();
     GraphVm     = new GraphVm();
 }
示例#3
0
 public Hist1DVm(float min, float max, int binCount)
 {
     _enforceBounds = true;
     BinCount       = binCount;
     GraphVm        = new GraphVm();
     MinValue       = min;
     MaxValue       = max;
 }
示例#4
0
 public Hist2DVm(Sz2 <int> binCounts,
                 Func <int[], ColorLeg <int> > colorLegger,
                 string title = "")
 {
     _enforceBounds = false;
     BinCounts      = new Sz2IntVm(binCounts, 800);
     ColorLegger    = colorLegger;
     GraphVm        = new GraphVm();
 }
示例#5
0
        private void UpdateGraphVm()
        {
            if (Values == null)
            {
                return;
            }

            var bins = Histos.Histogram1d(
                min: MinValue,
                max: MaxValue,
                vals: Values,
                binCount: BinCount);

            var maxFreq = bins.Max(p => p.V);

            GraphVm.SetData(
                imageWidth: -1.0,
                imageHeight: -1.0,
                boundingRect: new R <float>(maxY: maxFreq, minX: MinValue, minY: 0.0f, maxX: MaxValue),
                plotPoints: Enumerable.Empty <P2V <float, Color> >(),
                plotLines: Enumerable.Empty <LS2V <float, Color> >(),
                filledRects: MakePlotRectangles(hist: bins),
                openRects: Enumerable.Empty <RV <float, Color> >());
        }
示例#6
0
 public Hist1DVm(int binCount)
 {
     _enforceBounds = false;
     BinCount       = binCount;
     GraphVm        = new GraphVm();
 }