givanse/mvc-tree

View on GitHub
app/templates/components/root-svg.hbs

Summary

Maintainability
Test Coverage

<!-- Debug grid -->
{{#if svgenv.showGrid}}
  {{#each gridLines as |line|}}
    <path d="{{unbound line}}" fill="none" class="grid_line"></path>
  {{/each}}
{{/if}}

<!-- Years lines -->
{{#each yearLines as |line|}}
  <text x="{{unbound line.x}}" y="{{unbound line.y}}" class="year_line_txt">
    <tspan dy="4.233003616333008">
      {{line.year}}
    </tspan>
  </text>
  <path d="{{unbound line.path}}" fill="none" class="year_line_path"></path>
{{/each}}

<!-- Column Headers -->
{{#each model.headers as |node|}}
  {{svg-g layoutName='svg-g/node-header' node=node}}
{{/each}}

<!-- parent to child -->
{{#each pathsToChildren as |path|}}
  <path d="{{unbound path}}" class="line"></path>
{{/each}}

<!-- bind nodes -->
{{#each pathsBoundNodes as |pathObj|}}
  <!-- 
    TODO:
      bug with: 
        class="line line-dashed tech_js"
      works:
        class="line line-dashed"
  -->
  <path d="{{unbound pathObj.path}}"
        class="{{unbound pathObj.classNames}}"></path>
{{/each}}

<!-- Design Patterns -->
{{#each model.dpatterns as |node|}}
  {{svg-g-click layoutName='svg-g/node-dpattern' node=node}}
{{/each}}

<!-- Technologies -->
{{#each model.technologies as |node|}}
  {{#each node.classNames as |classNameTech|}}
    {{svg-g-click layoutName='svg-g/node-technology' 
                  node=node
                  classNameTech=classNameTech}}
  {{/each}}
{{/each}}