diff --git a/src/algorithms/draw.cpp b/src/algorithms/draw.cpp index ac4eea00..47e03e5c 100644 --- a/src/algorithms/draw.cpp +++ b/src/algorithms/draw.cpp @@ -138,9 +138,34 @@ void draw_svg(std::ostream &out, auto& x_off = range.x_offset; auto& y_off = range.y_offset; //const algorithms::color_t node_color = !node_id_to_color.empty() ? node_id_to_color[graph.get_id(handle)] : COLOR_BLACK; + + std::vector highlights; + for (auto& handle : component) { uint64_t a = 2 * number_bool_packing::unpack_number(handle); algorithms::color_t color = node_id_to_color.empty() ? COLOR_BLACK : node_id_to_color[graph.get_id(handle)]; + if (color == COLOR_BLACK || color == COLOR_LIGHTGRAY) { + out << "" + << std::endl; + } else { + highlights.push_back(handle); + } + } + + // color highlights + for (auto& handle : highlights) { + uint64_t a = 2 * number_bool_packing::unpack_number(handle); + algorithms::color_t color = node_id_to_color.empty() ? COLOR_BLACK : node_id_to_color[graph.get_id(handle)]; out << "" << std::endl; - } } diff --git a/src/subcommand/draw_main.cpp b/src/subcommand/draw_main.cpp index a42e18d6..d925971c 100644 --- a/src/subcommand/draw_main.cpp +++ b/src/subcommand/draw_main.cpp @@ -41,7 +41,7 @@ int main_draw(int argc, char **argv) { args::ValueFlag png_height(visualizations_opts, "FILE", "Height of PNG rendering (default: 1000).", {'H', "png-height"}); args::ValueFlag png_border(visualizations_opts, "FILE", "Size of PNG border in bp (default: 10).", {'E', "png-border"}); args::Flag color_paths(visualizations_opts, "color-paths", "Color paths (in PNG output).", {'C', "color-paths"}); - args::ValueFlag render_scale(visualizations_opts, "N", "Image scaling (default 0.001).", {'R', "scale"}); + args::ValueFlag svg_render_scale(visualizations_opts, "N", "SVG image scaling (default 0.01).", {'R', "scale"}); args::ValueFlag render_border(visualizations_opts, "N", "Image border (in approximate bp) (default 100.0).", {'B', "border"}); args::ValueFlag png_line_width(visualizations_opts, "N", "Line width (in approximate bp) (default 10.0).", {'w', "line-width"}); //args::ValueFlag png_line_overlay(parser, "N", "line width (in approximate bp) (default 10.0)", {'O', "line-overlay"}); @@ -174,7 +174,7 @@ int main_draw(int argc, char **argv) { const double _png_line_width = png_line_width ? args::get(png_line_width) : 10.0; const bool _color_paths = args::get(color_paths); const double _png_path_line_spacing = png_path_line_spacing ? args::get(png_path_line_spacing) : 0.0; - const double svg_scale = !render_scale ? 0.01 : args::get(render_scale); + const double svg_scale = !svg_render_scale ? 0.01 : args::get(svg_render_scale); size_t max_node_depth = 0; graph.for_each_handle( [&](const handle_t& h) {