Skip to content

Commit

Permalink
fix #181 Flow diagram variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywokim committed Jun 10, 2020
1 parent 2943c24 commit cfd1556
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/flow_diagram.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ <h5 class="modal-title">Export Flow Diagram</h5>
$($('#flow-variables').find('select')).each(function (i) { order.push(this.value); });
let variables = order.length;

let values = [], source_values = [], target_values = [], all_values = [], labels = [];
let values = [], source_values = [], target_values = [], all_values = [], labels = [], vars = [];
for (let i = 0; i < variables; i++) {
variable = order[i];
let n = data.length;
Expand All @@ -148,7 +148,8 @@ <h5 class="modal-title">Export Flow Diagram</h5>
}
n = values.length;
for (let j = 0; j < n; j++) {
labels.push(MT.titleize(variable + ' ' + values[j]));
labels.push(MT.titleize(values[j]));
vars.push(MT.titleize(variable));
let value = variable + '-' + values[j] + '-' + i;
if (i < variables - 1) source_values.push(value);
if (i > 0) target_values.push(value);
Expand Down Expand Up @@ -199,7 +200,9 @@ <h5 class="modal-title">Export Flow Diagram</h5>
width: 0.5
},
label: labels.map(MT.titleize),
color: session.style.widgets['flow-showNodes'] ? session.style.widgets['node-color'] : session.style.widgets['link-color']
color: session.style.widgets['flow-showNodes'] ? session.style.widgets['node-color'] : session.style.widgets['link-color'],
customdata: vars.map(MT.titleize),
hovertemplate: "<b> %{customdata}: %{label} </b><br>Incoming flow count: %{targetLinks.length} <br>Outgoing flow count: %{sourceLinks.length}"+ "<extra>%{value}</extra>"
},
link: { source, target, value }
}], {
Expand Down

0 comments on commit cfd1556

Please sign in to comment.