Beispiel #1
0
        public void Export(JekyllExporter exporter, View view, StreamWriter writer)
        {
            var guid = Guid.NewGuid();

            writer.WriteLine($"<div id='{guid}' class='cy'></div>");
            writer.WriteLine(@"
<script>
var cy = cytoscape({
");
            writer.WriteLine($"container: document.getElementById('{guid}'),");
            writer.WriteLine("elements: [");

            var nodes = view.Elements.Select(e => "{ data: { id: '" + e.Name + "', width: '" + e.Name.Length * 10 + "px' } }");
            var edges = view.Relationships.Select(r => "{ data: { id: '" + r.Source.Name + "_to_" + r.Target.Name + "', source: '" + r.Source.Name + "', target: '" + r.Target.Name + "' } }");

            writer.WriteLine(string.Join(",", nodes.Union(edges)));

            writer.WriteLine(@"
  ],

  style: cyto_" + view.ViewType.ToString().ToLowerInvariant() + @",

  layout: {
    name: 'cola',
    fit: true,
    nodeSpacing: 5,
    edgeLengthVal: 45
  }

            });
</script>");
        }
Beispiel #2
0
        /// <summary>
        /// Export all views
        /// </summary>
        /// <param name="destination"></param>
        public void Export(string destination)
        {
            var exporter = new JekyllExporter(this, destination);

            foreach (var view in Set.Views)
            {
                exporter.Export(view);
            }
        }
 public void Export(JekyllExporter exporter, View view, StreamWriter writer)
 {
     writer.WriteLine(Header());
     foreach (var element in view.Elements)
     {
         writer.Write(ExportElement(element));
     }
     foreach (var relation in view.Relationships)
     {
         writer.Write(ExportRelationship(relation));
     }
     writer.WriteLine(Footer());
 }
Beispiel #4
0
 public void Export(JekyllExporter exporter, View view, StreamWriter writer)
 {
     writer.WriteLine(Header());
     foreach (var element in view.Elements)
     {
         writer.Write(ExportElement(element));
     }
     foreach (var relation in view.Relationships)
     {
         writer.Write(ExportRelationship(relation));
     }
     writer.WriteLine(Footer());
 }
Beispiel #5
0
        public void Export(JekyllExporter exporter, View view, StreamWriter writer)
        {
            var guid = Guid.NewGuid();

            writer.WriteLine(@"
{% xdot png  w=2048 %}
digraph finite_state_machine {
    rankdir=TB;
    size=""6"";
"
                             + BoilerPlate()
                             + string.Join(Environment.NewLine, view.Elements.Select(e => $"{e.QualifiedName.Dotify()} [ label = \"{e.Name}\"]"))
                             + string.Join(Environment.NewLine, view.Relationships.Select(r => $"{r.Source.QualifiedName.Dotify()} -> {r.Target.QualifiedName.Dotify()} [ label = \"{r.Label}\"]"))
                             +
                             @"      
}
{% endxdot %}");
        }