-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
another ordering question #86
Comments
I ended up finding a workaround for the main question in this issue by introducing a dummy node into the dataset, called "Vehicle2", and assigning all the flow from "Vehicle" to the final services through this node. Then, I could apply whatever order I wanted.
|
Hi, I think you can do this without adding any fake nodes into the actual dataset. The problem is that you want the flows coming from Factory to go through the Factory materials waypoint on their way from Passive Systems to Final Services, but you want the flows from Vehicle and Building to go directly. The simplest solution is probably to split the Passive Systems subgroup into 3. Something like: nodes = {
# instead of 'Passive Systems':ProcessGroup(passive_systems),
'Vehicles': ProcessGroup(['Vehicles']),
'Factory': ProcessGroup(['Factory']),
'Building': ProcessGroup(['Building']),
}
ordering = [
#...
['Vehicles', 'Factory', 'Building'],
['VehiclesWaypoint1', 'Factory materials','BuildingsWaypoint1'],
['VehiclesWaypoint2', 'Material', 'BuildingsWaypoint2'],
['Final Services'],
]
bundles = [
# instead of Bundle('Passive Systems','Material',waypoints=['Factory materials']),
Bundle('Vehicles', 'Passive Systems', waypoints=['VehiclesWaypoint1', 'VehiclesWaypoint2']),
Bundle('Factory', 'Material', waypoints=['Factory materials']),
Bundle('Material','Final Services'),
Bundle('Buildings', 'Passive Systems', waypoints=['VehiclesWaypoint1', 'VehiclesWaypoint2']),
] Hope that makes sense. |
Thanks for the nice example -- would you like to add it to the cookbook when you get it working? https://github.com/ricklupton/floweaver/tree/master/docs/cookbook For your other questions, shifting the text with CSS is probably difficult because the position is calculated in pixels relative to the size of the node. You could try playing with MathJax -- I don't think this is possible at the moment. I created an issue to keep track of this: ricklupton/ipysankeywidget#43 Hiding lines: Yes you should be able to do this with CSS. Try using the DOM inspector to see what the structure is -- something like .sankey .node line { display: none; } |
One more thing -- you commented in your code "keys have numbers to enforce ordering: #65" but that applies only to the flow partition (set with Now that I say this, I'm not actually sure the problem in #65 happens for any good reason -- the sorting of links sharing a source or target could probably preserve the order given in the partition. Need to check in the code if there's a reason why this wouldn't work. |
Sorry for the delayed reply, and thanks for all the info. Your strategy for the strand ordering makes sense -- I'll work on updating the example to use it. Happy to add it to the cookbook when it's finished. :) (though some flows are estimated from the original figure, so it should probably have a disclaimer) |
Hi there,
First of all, great job on floweaver! I hadn't seen it until yesterday, and it was reasonably easy to get up and running with it. The results have been encouraging so far!
I'm trying to use floweaver to make a similar sankey to the fantastic one in "The efficient use of energy: Tracing the global flow of energy from fuel to service", Jonathan M. Cullen, Julian M. Allwood. Below is the original:
I thought I'd start by recreating the original. Here is my first attempt:
I'm learning how to use floweaver, so pardon the messiness. (happy to post the csv if it is useful)
My main question has to do with ordering. Obviously, the blue 'Vehicle' flow at the right that dips down and comes back up is suboptimal. We would like to have it above the 'material' flow. The 'material' and 'building' flows are constructed using Waypoints in this line:
Because of this, I can only figure out how to put both above, or both below, as pictured. Any ideas? Is there a better way to do this kind of passthrough?
I also have a couple small questions about formatting labels (sorry if they should be separate issues each):
text-align
andvertical-align
). I've tried this using the snippet below, but it doesn't work:Any ideas to shift these labels?
I'd also love to use MathJax in the text labels as I do with matplotlib (e.g. for the units at the far right). Any chance this works? I tried using $ signs, without any luck.
Is there a way to turn off the vertical lines at each node?
Thanks,
sam
The text was updated successfully, but these errors were encountered: