Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ The algorithm outputs an array of arrays of subdivision points obtained on the l
```
### How To Plot
Plotting can be done by using standard *d3* methods i.e. drawing lines between each of the subdivision subpoints for each the initial graph edges. Since there is no support for advanced blending modes in **SVG** yet we use the *stroke-opacity* to mark overlapping segments.

#### d3v5
```javascript
// Define the line generator
var d3line = d3.line()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; })
.curve(d3.curveLinear); // Use curveLinear for "linear" interpolation

// Iterate over the results and draw lines
results.forEach(function(edge_subpoint_data) {
svg.append("path")
.attr("d", d3line(edge_subpoint_data))
.style("stroke-width", 1)
.style("stroke", "#ff2222")
.style("fill", "none")
.style("stroke-opacity", 0.15); // Use opacity as blending
});
```
#### d3v3
```javascript
var d3line = d3.svg.line()
.x(function(d){ return d.x; })
Expand Down