soxofaan / d3-plugin-captain-sankey Goto Github PK
View Code? Open in Web Editor NEWFriendly (subtree) fork of the "sankey" plugin from https://github.com/d3/d3-plugins
License: Other
Friendly (subtree) fork of the "sankey" plugin from https://github.com/d3/d3-plugins
License: Other
I added a marker:
//marker-end of path
svg.append('marker')
.attr('id', "end-arrow")
.attr('markerHeight', 2.5)
.attr('markerWidth', 2, 5)
.attr('orient', 'auto')
.attr('refX', -5)
.attr('refY', 0)
.attr('viewBox', '-5 -5 20 10')
.append('path')
.attr('d', 'M 0,0 m -5,-5 L 0,0 L -5,5 Z')
.style("fill", "#969696");
And then here:
// Enter + Update
links.attr('d', path)
.style("marker-end", "url(#end-arrow)")
.style("stroke-width", function (d) {
return Math.max(1, d.dy);
});
And a slight mod to sankey.js for some room to draw the arrow at the end of the path:
function link(d) {
var xs = d.source.x + d.source.dx,
//added the following to shrink the path so there is room for the arrow;
//however path bunches up in cycle demo, is there a way to smooth out the path a bit
xt = d.target.x - (d.dy / 2),
//xt = d.target.x,
Is there a way to smooth out the path a bit so that it doesn't bunch up as shown in the png.
when there are cycles in the graph, sankey ends up in an endless loop
Has anyone worked on creating a drop-off from node just like an exit.
i have the same related problem : http://stackoverflow.com/questions/35284063/showing-drop-off-on-google-sankey-chart/36038303
is it possible to have the same Google Analytics option in order to display exit links (without target) with a red arrow pointing down ?
Hi,
I'm very much interested in the cycles support extension developed here.
But after reading through d3's original sankey plugin issues and here, it's not clear to me whether this project is still active or it has been subsumed into other d3's official repo, like d3-sankey.
I'll be closing this when I have an answer.
Thanks.
exposing the scales could also make things more versatile
related to #4 and d3/d3-plugins#1
In computeNodeDepths, the node position recalculation is based on a weighted average of the centers of the source/target nodes of incoming/outgoing links.
It would probably be better to use the centers of only the node fractions corresponding with the links
Hey @soxofaan, you look like the expert with this plugin.
I was just wondering how feasible it would be to modify it to allow for variable nodeWidth
s, so that each node could be a block that displayed some other information inside.
In particular, my application is a timeline where groups split and re-join, and I'd like to fix the x-axis to reflect the beginning and end of these groups (i.e. real-time) rather than fixed-width and fixed spacing. It seems like setting the .dx
values to a parameter rather than a fixed value is pretty simple; I'm just wondering how much it would mess up the layout algorithm. Any thoughts would be much appreciated!
cc @ldworkin
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.