remove unused imports, explanation for show-text
"""Convert edge file and optional node file to html visualization
"""
-import pandas as pd
-import json
-from argparse import Namespace, SUPPRESS
-import sys
-
-import math
-from kgtk.visualize.visualize_api import KgtkVisualize
-
+from argparse import Namespace
from kgtk.cli_argparse import KGTKArgumentParser, KGTKFiles
+from kgtk.io.kgtkreader import KgtkReader, KgtkReaderOptions
+from kgtk.reshape.kgtkidbuilder import KgtkIdBuilderOptions
+from kgtk.value.kgtkvalueoptions import KgtkValueOptions
def parser():
@@ -26,10 +22,6 @@ def add_arguments_extended(parser: KGTKArgumentParser,
Args:
parser (argparse.ArgumentParser)
"""
- # import modules locally
- from kgtk.io.kgtkreader import KgtkReader, KgtkReaderOptions
- from kgtk.reshape.kgtkidbuilder import KgtkIdBuilder, KgtkIdBuilderOptions
- from kgtk.value.kgtkvalueoptions import KgtkValueOptions
_expert: bool = parsed_shared_args._expert
@@ -166,8 +158,9 @@ def add_arguments_extended(parser: KGTKArgumentParser,
parser.add_argument('--text-node', dest='text_node', type=str,
default=None,
- help="Specify option to show text" +
- " (None, center, above), default is None")
+ help="Specify option to show text [None|center|above], default is None. If the number of"
+ "nodes in the graph is greater than specified by --show-text-limit option, which is"
+ "500 by default, then the text will not be shown in the visualization.")
parser.add_argument('--node-categorical-scale',
dest='node_categorical_scale',
@@ -191,8 +184,7 @@ def add_arguments_extended(parser: KGTKArgumentParser,
help="Specify color gradient scale" +
" for edge d3-scale-chromatic")
- KgtkIdBuilderOptions.add_arguments(parser,
- expert=True) # Show all the options.
+ KgtkIdBuilderOptions.add_arguments(parser, expert=True) # Show all the options.
KgtkReader.add_debug_arguments(parser, expert=_expert)
KgtkReaderOptions.add_arguments(parser, mode_options=True, expert=_expert)
KgtkValueOptions.add_arguments(parser, expert=_expert)
@@ -241,7 +233,7 @@ def run(input_file: KGTKFiles,
**kwargs # Whatever KgtkFileOptions and KgtkValueOptions want.
) -> int:
-
+ from kgtk.visualize.visualize_api import KgtkVisualize
kv: KgtkVisualize = KgtkVisualize(
input_file=input_file,
output_file=output_file,
