Generates a summary of the graph.
Call or to get a string that summarizes the graph.
Inheritance: Object
Exemple #1
0
        SummarizeGraph
        (
            Microsoft.Office.Interop.Excel.Workbook workbook
        )
        {
            Debug.Assert(workbook != null);

            PerWorkbookSettings oPerWorkbookSettings =
                new PerWorkbookSettings(workbook);

            OverallMetrics oOverallMetrics;

            (new OverallMetricsReader()).TryReadMetrics(
                workbook, out oOverallMetrics);

            String sTopNByMetrics;

            (new TopNByMetricsReader()).TryReadMetrics(
                workbook, out sTopNByMetrics);

            String sTwitterSearchNetworkTopItems;

            (new TwitterSearchNetworkTopItemsReader()).TryReadMetrics(
                workbook, out sTwitterSearchNetworkTopItems);

            return(GraphSummarizer.SummarizeGraphInternal(
                       oPerWorkbookSettings.GraphHistory,
                       oPerWorkbookSettings.AutoFillWorkbookResults, oOverallMetrics,
                       sTopNByMetrics, sTwitterSearchNetworkTopItems));
        }
Exemple #2
0
        btnCopyToClipboard_Click
        (
            object sender,
            System.EventArgs e
        )
        {
            AssertValid();

            if (DoDataExchange(true))
            {
                String sGraphSummary;

                if (GraphSummarizer.TrySummarizeGraph(m_oGraphHistory,
                                                      m_oAutoFillWorkbookResults, m_oOverallMetrics,
                                                      m_sTopNByMetrics, m_sTwitterSearchNetworkTopItems,
                                                      out sGraphSummary))
                {
                    Clipboard.SetText(sGraphSummary);
                }
                else
                {
                    ShowWarning("A graph summary is not available.");
                }
            }
        }
Exemple #3
0
        TryExportToNodeXLGraphGallery
        (
            Microsoft.Office.Interop.Excel.Workbook oWorkbook,
            NodeXLControl oNodeXLControl
        )
        {
            Debug.Assert(oWorkbook != null);
            Debug.Assert(oNodeXLControl != null);

            ExportToNodeXLGraphGalleryUserSettings
                oExportToNodeXLGraphGalleryUserSettings =
                new ExportToNodeXLGraphGalleryUserSettings();

            String sAuthor, sPassword;

            GetGraphGalleryAuthorAndPassword(
                oExportToNodeXLGraphGalleryUserSettings, out sAuthor,
                out sPassword);

            // Note that a graph summary is used for the description.

            try
            {
                (new NodeXLGraphGalleryExporter()).ExportToNodeXLGraphGallery(
                    oWorkbook,
                    oNodeXLControl,
                    GraphTitleCreator.CreateGraphTitle(oWorkbook),
                    GraphSummarizer.SummarizeGraph(oWorkbook),
                    oExportToNodeXLGraphGalleryUserSettings.SpaceDelimitedTags,
                    sAuthor,
                    sPassword,

                    oExportToNodeXLGraphGalleryUserSettings
                    .ExportWorkbookAndSettings,

                    oExportToNodeXLGraphGalleryUserSettings.ExportGraphML,
                    oExportToNodeXLGraphGalleryUserSettings.UseFixedAspectRatio
                    );

                return(true);
            }
            catch (Exception oException)
            {
                String sMessage;

                if (NodeXLGraphGalleryExceptionHandler
                    .TryGetMessageForRecognizedException(
                        oException, out sMessage))
                {
                    FormUtil.ShowWarning(sMessage);
                }
                else
                {
                    ErrorUtil.OnException(oException);
                }

                return(false);
            }
        }
Exemple #4
0
        GetDefaultDescription()
        {
            AssertValid();

            String sDefaultDescription;

            // Order of precedence: graph summary, empty string.

            if (!GraphSummarizer.TrySummarizeGraph(
                    m_oWorkbook, out sDefaultDescription))
            {
                sDefaultDescription = String.Empty;
            }

            return(sDefaultDescription);
        }
Exemple #5
0
        ReplaceGraphSummaryMacro
        (
            String sMessageBody,
            Microsoft.Office.Interop.Excel.Workbook oWorkbook
        )
        {
            Debug.Assert(oWorkbook != null);

            if (sMessageBody != null &&
                sMessageBody.IndexOf(GraphSummaryMacro) >= 0)
            {
                sMessageBody = sMessageBody.Replace(GraphSummaryMacro,
                                                    GraphSummarizer.SummarizeGraph(oWorkbook).Trim());
            }

            return(sMessageBody);
        }