private void GenerateTestHierarchicalReferenceFile(string path, double width, double height)
        {
            // Generate reference hierarchical data with layout info
            var generator = new HierarchicalDataBuilder();
            var root      = generator.GenerateRandomHierarchy();
            var layout    = new CirclePackingLayout();

            layout.Layout(root, width, height);
            var file = new BinaryFile <HierarchicalData>();

            file.Write(path, root);
        }
Beispiel #2
0
        private void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            // Fill sample data to visualiue
            var builder = new HierarchicalDataBuilder();

            _chord.DataContext = GetChordTestData();

            var circle = builder.GetFlatExample();
            var tree   = builder.GetFlatExample();

            _circlePacking.DataContext = circle;
            _treeMap.DataContext       = tree;
        }
        private void GenerateTestHierarchicalReferenceFile(string path, double width, double height)
        {
            // Generate reference hierarchical data with layout info
            var generator = new HierarchicalDataBuilder();
            var root      = generator.GenerateRandomHierarchy();

            // Needed by tree map algorithm
            root.SumAreaMetrics();

            var layout = new SquarifiedTreeMapLayout();

            layout.Layout(root, width, height);
            var file = new BinaryFile <HierarchicalData>();

            file.Write(path, root);
        }
Beispiel #4
0
        private HierarchicalDataContext LoadCached(string cacheFile, string fileName)
        {
            var builder = new HierarchicalDataBuilder();

            //var cacheFile = "d:\\data.bin";
            if (File.Exists(cacheFile))
            {
                var file = new BinaryFile <HierarchicalData>();
                var data = file.Read(cacheFile);
                return(new HierarchicalDataContext(data));
            }
            else
            {
                var context = builder.CreateHierarchyFromFilesystem(fileName, true);
                var file    = new BinaryFile <HierarchicalData>();
                file.Write(cacheFile, context.Data);
                return(context);
            }
        }