2017-04-04 23:27:08 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-08-04 14:37:31 +08:00
|
|
|
|
using System.Linq;
|
2017-04-05 00:10:57 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2017-08-04 14:37:31 +08:00
|
|
|
|
using OpenTK;
|
2017-04-04 23:27:08 +08:00
|
|
|
|
|
2017-08-04 14:37:31 +08:00
|
|
|
|
namespace osu.Desktop.Tests.Visual
|
2017-04-04 23:27:08 +08:00
|
|
|
|
{
|
2017-08-04 14:37:31 +08:00
|
|
|
|
internal class TestCaseGraph : OsuTestCase
|
2017-04-04 23:27:08 +08:00
|
|
|
|
{
|
2017-04-11 20:02:56 +08:00
|
|
|
|
public override string Description => "graph";
|
2017-04-05 00:10:57 +08:00
|
|
|
|
|
2017-07-07 20:05:55 +08:00
|
|
|
|
public TestCaseGraph()
|
2017-04-05 00:10:57 +08:00
|
|
|
|
{
|
2017-07-08 17:17:47 +08:00
|
|
|
|
BarGraph graph;
|
|
|
|
|
|
2017-04-05 00:10:57 +08:00
|
|
|
|
Children = new[]
|
|
|
|
|
{
|
|
|
|
|
graph = new BarGraph
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Size = new Vector2(0.5f),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
2017-06-08 14:35:10 +08:00
|
|
|
|
AddStep("values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Select(i => (float)i));
|
2017-04-11 20:02:56 +08:00
|
|
|
|
AddStep("values from 1-100", () => graph.Values = Enumerable.Range(1, 100).Select(i => (float)i));
|
2017-04-05 00:10:57 +08:00
|
|
|
|
AddStep("reversed values from 1-10", () => graph.Values = Enumerable.Range(1, 10).Reverse().Select(i => (float)i));
|
|
|
|
|
AddStep("Bottom to top", () => graph.Direction = BarDirection.BottomToTop);
|
|
|
|
|
AddStep("Top to bottom", () => graph.Direction = BarDirection.TopToBottom);
|
|
|
|
|
AddStep("Left to right", () => graph.Direction = BarDirection.LeftToRight);
|
|
|
|
|
AddStep("Right to left", () => graph.Direction = BarDirection.RightToLeft);
|
|
|
|
|
}
|
2017-04-04 23:27:08 +08:00
|
|
|
|
}
|
|
|
|
|
}
|