Пример #1
0
        public async Task Locator()
        {
            var outputFilePath = _files.LocatorResultPath;
            var code           = string.Format(@"
plot(0:10)
res <- locator()
write.csv(res, {0})
",
                                               QuotedRPath(outputFilePath));

            var locatorProvider = new TestLocatorResultProvider(new Point[] {
                new Point(10, 10),
                new Point(100, 50),
                new Point(290, 90),
            });

            var inputs = Interactive(code);
            var actualPlotFilePaths = (await GraphicsTestAsync(inputs, locatorProvider.Next)).ToArray();

            // Locator results for the above clicked positions
            var x = new double[] { -2.48008095952895, 1.55378525638498, 10.0697250455366 };
            var y = new double[] { 14.4476461865435, 12.091623959219, 9.73560173189449 };

            CheckLocatorResult(outputFilePath, x, y);
        }
Пример #2
0
        public async Task Locator() {
            var outputFilePath = _files.LocatorResultPath;
            var code = string.Format(@"
plot(0:10)
res <- locator()
write.csv(res, {0})
",
                outputFilePath.ToRPath().ToRStringLiteral());

            var locatorProvider = new TestLocatorResultProvider(new Point[] {
                new Point(10, 10),
                new Point(100, 50),
                new Point(290, 90),
            });

            var inputs = Interactive(code);
            var actualPlotFilePaths = (await GraphicsTestAsync(inputs, locatorProvider.Next)).ToArray();

            // Locator results for the above clicked positions
            var x = new double[] { -2.48008095952895, 1.55378525638498, 10.0697250455366 };
            var y = new double[] { 14.4476461865435, 12.091623959219, 9.73560173189449 };
            CheckLocatorResult(outputFilePath, x, y);
        }