Skip to content

Commit b72f7f3

Browse files
committed
Fixing check_network_option
1 parent 716a3be commit b72f7f3

File tree

4 files changed

+7659
-4898
lines changed

4 files changed

+7659
-4898
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"js-convert-case": "^4.2.0",
2727
"jspanel4": "4.16.1",
2828
"latest": "^0.2.0",
29+
"playwright": "^1.45.1",
2930
"sass": "^1.77.2",
3031
"topojson": "3.x",
3132
"underscore": "1.x"

src/clusternetwork.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var hivtrace_cluster_network_graph = function (
4141
// [OPT] attributes : A JSON object with mapped node attributes
4242

4343
// unpack compact JSON if needed
44+
4445
if (json.Settings && json.Settings.compact_json) {
4546
network.unpack_compact_json(json);
4647
}
@@ -67,7 +68,7 @@ var hivtrace_cluster_network_graph = function (
6768
network.normalize_node_attributes(json);
6869
network.ensure_node_attributes_exist(json);
6970

70-
/** SLKP 20190902: somehow our networks have malformed edges! This will remove them */
71+
/** SLKP 20190902: somehow some of our networks have malformed edges! This will remove them */
7172
json.Edges = _.filter(json.Edges, (e) => "source" in e && "target" in e);
7273

7374
var self = new HTX.HIVTxNetwork(json);
@@ -100,8 +101,7 @@ var hivtrace_cluster_network_graph = function (
100101
self.ww = network.check_network_option(
101102
options,
102103
"width",
103-
d3.select(parent_container).property("clientWidth"),
104-
null
104+
d3.select(parent_container).property("clientWidth")
105105
);
106106

107107
self.container = network_container;
@@ -127,27 +127,26 @@ var hivtrace_cluster_network_graph = function (
127127
self.dom_prefix = network.check_network_option(
128128
options,
129129
"prefix",
130-
"hiv-trace",
131-
null
130+
"hiv-trace"
132131
);
133132
self.extra_cluster_table_columns = network.check_network_option(
134133
options,
135134
"cluster-table-columns",
136-
null,
137135
null
138136
);
139137

140138
self.subcluster_table = null;
139+
141140
self.isPrimaryGraph = network.check_network_option(
142141
options,
143142
"secondary",
144143
true,
145144
false
146145
);
146+
147147
self.parent_graph_object = network.check_network_option(
148148
options,
149149
"parent_graph",
150-
null,
151150
null
152151
);
153152

@@ -159,8 +158,7 @@ var hivtrace_cluster_network_graph = function (
159158
self.today = network.check_network_option(
160159
options,
161160
"today",
162-
timeDateUtil.getCurrentDate(),
163-
null
161+
timeDateUtil.getCurrentDate()
164162
);
165163
}
166164

src/network.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function check_network_option(options, key, if_absent, if_present) {
154154

155155
if (options) {
156156
if (key in options) {
157-
return if_present || options[key];
157+
return _.isUndefined(if_present) ? options[key] : if_present;
158158
}
159159
}
160160
return if_absent;

0 commit comments

Comments
 (0)