A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
color_bar.hpp
Go to the documentation of this file.
1 #ifndef GENESIS_UTILS_FORMATS_SVG_COLOR_BAR_H_
2 #define GENESIS_UTILS_FORMATS_SVG_COLOR_BAR_H_
3 
4 /*
5  Genesis - A toolkit for working with phylogenetic data.
6  Copyright (C) 2014-2018 Lucas Czech and HITS gGmbH
7 
8  This program is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21  Contact:
22  Lucas Czech <lucas.czech@h-its.org>
23  Exelixis Lab, Heidelberg Institute for Theoretical Studies
24  Schloss-Wolfsbrunnenweg 35, D-69118 Heidelberg, Germany
25 */
26 
36 
37 #include <map>
38 #include <string>
39 #include <utility>
40 #include <vector>
41 
42 namespace genesis {
43 namespace utils {
44 
45 // =================================================================================================
46 // Forward Declarations
47 // =================================================================================================
48 
49 class ColorMap;
50 class ColorNormalization;
51 class ColorNormalizationDiverging;
52 class ColorNormalizationLinear;
53 class ColorNormalizationLogarithmic;
54 
55 // =================================================================================================
56 // Svg Color Bar
57 // =================================================================================================
58 
60 {
61 public:
62 
63  // -------------------------------------------------------------
64  // Typedefs and Enums
65  // -------------------------------------------------------------
66 
67  enum class Direction
68  {
73  };
74 
75  // -------------------------------------------------------------
76  // Properties
77  // -------------------------------------------------------------
78 
80 
81  double width = 20;
82  double height = 200;
83 
84  bool with_tickmarks = true;
85  bool with_labels = true;
86 
87  size_t num_ticks = 5;
88 
89 };
90 
91 std::pair<SvgGradientLinear, SvgGroup> make_svg_color_bar(
92  SvgColorBarSettings const& settings,
93  ColorMap const& map,
94  ColorNormalization const& norm,
95  std::string const& id = ""
96 );
97 
99  ColorMap const& map,
100  std::vector<std::string> const& labels
101 );
102 
103 } // namespace utils
104 } // namespace genesis
105 
106 #endif // include guard
Store a list of colors and offer them as a map for values in range [ 0.0, 1.0 ].
Definition: map.hpp:61
SvgGroup make_svg_color_list(ColorMap const &map, std::vector< std::string > const &labels)
Definition: color_bar.cpp:354
Base class for color normalization.
std::pair< SvgGradientLinear, SvgGroup > make_svg_color_bar(SvgColorBarSettings const &settings, ColorMap const &map, ColorNormalization const &norm, std::string const &id)
Definition: color_bar.cpp:317
std::unordered_set< std::string > labels(SequenceSet const &set)
Return a set of all labels of the SequenceSet.
Definition: labels.cpp:62