Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / src / libraries / graph / GraphVirtualLinkPaths.js
1 /**
2 * Created by onvelocity on 2/15/16.
3 */
4 import ColorGroups from '../ColorGroups'
5
6 /**
7 * NOTE: WIP this will replace part of the RelationsAndNetworksLayout::drawConnectionPointsAndPaths method.
8 *
9 * This class draws the paths between the VLD and the Connection Point it references.
10 *
11 */
12 export default class GraphVirtualLinkPaths {
13
14 constructor(graph, props) {
15 this.graph = graph;
16 this.props = props;
17 this.containers = [];
18 }
19
20 addContainers(containers) {
21
22 }
23
24 render() {
25
26 const paths = graph.paths.selectAll('.connection').data(connectionPointRefs, DescriptorModelFactory.containerIdentity);
27
28 paths.enter().append('path');
29
30 paths.attr({
31 'data-uid': d => {
32 return d.uid;
33 },
34 'class': d => {
35 return 'connection between-' + d.parent.type + '-and-' + d.type;
36 },
37 'stroke-width': 5,
38 stroke: ColorGroups.vld.primary,
39 fill: 'transparent',
40 d: edge => {
41 const layout = containerLayouts[edge.parent.type];
42 return layout.renderConnectionPath(edge, containerLayouts);
43 }
44 });
45
46 paths.exit().remove();
47
48 }
49
50 }