- {{ form.font }}
-
+
+ {{ form.bg_color.label }} {{ form.bg_color }}
+
+
+
+
+
{{ form.font.help_text }}
+ {% for error in form.font.errors %}
+
{{ error }}
+ {% endfor %}
- {% for error in form.font.errors %}
-
{{ error }}
- {% endfor %}
-
{{ form.font.help_text }}
-
+
@@ -76,7 +87,7 @@
Word Cloud
-
{{ form.mask.help_text }}
+
{{ form.mask.help_text }}
@@ -84,7 +95,7 @@
Word Cloud
- {{ form.mask_coloring.help_text }}
+ {{ form.mask_coloring.help_text }}
@@ -94,13 +105,13 @@
Word Cloud
{{ form.stopwords.label }} {{ form.stopwords }}
- {{ form.stopwords.help_text }}
+ {{ form.stopwords.help_text }}
{{ form.word_len_min.label }} {{ form.word_len_min }}
{% for error in form.word_len_min.errors %}
- {{ error }}
+ {{ error }}
{% endfor %}
diff --git a/app/templates/viz/viz_result_pages/sna.html b/app/templates/viz/viz_result_pages/sna.html
index 9f5139f..c10192e 100644
--- a/app/templates/viz/viz_result_pages/sna.html
+++ b/app/templates/viz/viz_result_pages/sna.html
@@ -38,7 +38,7 @@
node.value = node.symbolSize;
node.label = {
normal: {
- show: node.symbolSize > 5
+ show: node.symbolSize > 1
}
};
node.category = node.attributes.modularity_class;
diff --git a/app/viz/core/sna.py b/app/viz/core/sna.py
index e151251..1094b17 100644
--- a/app/viz/core/sna.py
+++ b/app/viz/core/sna.py
@@ -61,13 +61,12 @@ def gen_gexf_and_pass_partition_data(
# ------ Set Attributes for gexf file ------ #
# Add Node Weight
scaled_weight_list = []
- for node_freq in tf_sum_dict_sorted[:node_num]:
- # node_freq[0] is node, node_freq[1] is node's frequency
- if node_freq[0] in isolated_nodes:
+ for node, freq in tf_sum_dict_sorted[:node_num]:
+ if node in isolated_nodes:
continue
else:
- scaled_weight = (node_freq[1] * (70 ** 2) / tf_sum_dict_sorted[0][1])**(1/2)
- scaled_weight_list.append((node_freq[0], scaled_weight))
+ scaled_weight = (freq * (70 ** 2) / tf_sum_dict_sorted[0][1])**(1/2)
+ scaled_weight_list.append((node, scaled_weight))
scaled_weight_dict = dict(scaled_weight_list)
diff --git a/app/viz/forms/base.py b/app/viz/forms/base.py
index 9e8d850..59eee23 100644
--- a/app/viz/forms/base.py
+++ b/app/viz/forms/base.py
@@ -43,7 +43,7 @@ class VizBaseForm(forms.Form):
initial=2,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-1',
+ 'class': 'form-control',
},
),
)
diff --git a/app/viz/forms/sna.py b/app/viz/forms/sna.py
index 174e8c2..4590182 100644
--- a/app/viz/forms/sna.py
+++ b/app/viz/forms/sna.py
@@ -4,11 +4,6 @@
class SnaForm(VizBaseForm):
- network_size = (
- (35, 'Small (35)'),
- (60, 'Regular (60)'),
- (100, 'Large (100)'),
- )
theme_list = (
('default', 'Default'),
('light', 'Light'),
@@ -24,21 +19,20 @@ class SnaForm(VizBaseForm):
initial='default',
widget=forms.Select(
attrs={
- 'class': 'form-control mb-3',
+ 'class': 'form-control',
},
),
)
- node_num = forms.ChoiceField(
+ node_num = forms.IntegerField(
required=True,
- label='Network Size',
- choices=network_size,
+ label='Number Of Nodes',
initial=35,
- widget=forms.Select(
+ widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-1',
+ 'class': 'form-control',
},
),
- help_text='Number of nodes',
+ help_text='The number of nodes in the result may be reduced if Remove Isolated Node is ON',
)
edge_remove_threshold = forms.IntegerField(
required=True,
@@ -46,7 +40,7 @@ class SnaForm(VizBaseForm):
initial=0,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-1',
+ 'class': 'form-control',
},
),
)
@@ -71,21 +65,21 @@ class SnaForm(VizBaseForm):
initial='fr',
widget=forms.Select(
attrs={
- 'class': 'form-control mb-3',
+ 'class': 'form-control',
},
),
)
fr_k = forms.FloatField(
required=True,
- label='Argument k',
- initial=1.0,
+ label='Argument k (Float)',
+ initial=0,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-1',
+ 'class': 'form-control',
'step': 'any',
},
),
- help_text='Optimal distance between nodes.',
+ help_text='Optimal distance between nodes. 0 equals None',
)
fa2_square = forms.IntegerField(
required=True,
@@ -93,7 +87,7 @@ class SnaForm(VizBaseForm):
initial=2,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-3',
+ 'class': 'form-control',
},
),
)
@@ -103,7 +97,7 @@ class SnaForm(VizBaseForm):
initial=100,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-3',
+ 'class': 'form-control',
},
),
)
@@ -128,7 +122,10 @@ def clean_data_file(self):
def clean_node_num(self):
node_num = self.cleaned_data['node_num']
- return int(node_num)
+ if node_num < 1:
+ self.fields['node_num'].widget.attrs['class'] += ' is-invalid'
+ raise forms.ValidationError("Number of nodes can't be less than 1")
+ return node_num
def clean_edge_remove_threshold(self):
edge_remove_threshold = self.cleaned_data['edge_remove_threshold']
diff --git a/app/viz/forms/wc.py b/app/viz/forms/wc.py
index 38f6f65..4485e4a 100644
--- a/app/viz/forms/wc.py
+++ b/app/viz/forms/wc.py
@@ -15,7 +15,7 @@ class WcForm(VizBaseForm):
initial=100,
widget=forms.NumberInput(
attrs={
- 'class': 'form-control mb-1'
+ 'class': 'form-control'
},
),
help_text='Specify the most frequent word size.',
@@ -27,7 +27,7 @@ class WcForm(VizBaseForm):
initial='white',
widget=forms.Select(
attrs={
- 'class': 'form-control mb-3',
+ 'class': 'form-control',
},
),
)