Esempio n. 1
0
        public static string WebglDataElementContentTemplate <T>(Guid id,
                                                                 string title,
                                                                 int rows,
                                                                 int columns,
                                                                 WebglChart <T> chart)
            where T : IEnumerable
        {
            string uid = id.ToString().Replace("-",
                                               "");

            string content = Scripts.RequireVegaLiteDataBuffered;

            content = content.Replace("_ID_",
                                      uid);

            content = content.Replace("_DATASET_",
                                      chart.DataSetName);

            content = content.Replace("_ROWS_",
                                      $"{rows}");

            content = content.Replace("_COLUMNS_",
                                      $"{columns}");

            content = content.Replace("_VEGALITE_SPEC_",
                                      chart.Specification.ToJson());

            content = Scripts.RequireJS + Scripts.RequireVegaLite + content;

            return(HtmlTemplateFunc(uid,
                                    title,
                                    content));
        }
Esempio n. 2
0
        public static string WebglElementContentTemplate(Guid id,
                                                         string title,
                                                         WebglChart chart)
        {
            string uid = id.ToString().Replace("-",
                                               "");

            string content = Scripts.RequireVegaLiteWebgl;

            content = content.Replace("_ID_",
                                      uid);

            content = content.Replace("_VEGALITE_SPEC_",
                                      chart.Specification.ToJson());

            content = Scripts.RequireJS + Scripts.RequireVegaLite + content;

            return(HtmlTemplateFunc(uid,
                                    title,
                                    content));
        }