nowthis / sankeymatic

Make Beautiful Flow Diagrams
http://sankeymatic.com/build/
ISC License
841 stars 122 forks source link

Allow customization of 0-size flow visibility #79

Open nowthis opened 3 weeks ago

nowthis commented 3 weeks ago

Before b1af9c2, a 0-size flow in your inputs would result in an error message saying that you can't use 0 as a value, and those flows would not appear in the diagram at all.

Now that calculated flows can produce 0s, I had thought it would make sense to make such flows visible, primarily so you wouldn't wonder what happened to the line you had typed in.

However, in the few days since calculated flows have soft-launched, I've already been contacted about making 0-size flows disappear again.

I think a more robust/complete solution for 0-size flows will be:

  1. Give the user an option somewhere to say whether they want 0-size flows to be visible in the diagram or not.
  2. If they are not visible, at least mention them in the Console output so that you can still be sure that they were noticed.
  3. At this time I'm thinking it would probably make more sense to have the default be to not have the 0-size flows be visible. I think that is what a new user would expect most of the time.

In addition, I think this presents an opportunity to handle flow-less Node declarations in a similar way. Currently they just float in some unpredictable position by themselves. I think it may be better to make them invisible by default (and log their existence) just like 0-size flows.