Colors¶
-
class
NetExplorer.models.colors.
ColorGenerator
(max_v, min_v, profile='red')¶ Generates a color gradient given a maximum value and a minimum value, using min-max normalization in a 0-50 scale.
-
profile
¶ Color profile enum element.
- Type
-
max
¶ Maximum value to generate color gradient.
- Type
float
-
min
¶ Minimum value to generate color gradient.
- Type
float
- Parameters
max_v (float) – Maximum value to generate color gradient.
min_v (float) – Minimum value to generate color gradient.
profile (string) – Valid color profile string, see ColorProfiles for a list of the valid color profiles.
-
_ColorGenerator__generate_intervals
()¶ Generates interval values for the gradient.
- Returns
- List of 50 floats defining the intervals for
the gradient.
- Return type
list of float
-
_ColorGenerator__normalize
(x)¶ Min-Max normalization for normalizing values to 0-50 scale.
- Parameters
x (float) – value to normalize to a min-max scale using min-max normalization.
- Returns
normalized value.
- Return type
float
-
get_color_legend
(units=None)¶ Returns html of legend for the color gradient.
- Parameters
units (str) – Units for the values in the legend.
- Returns
html string with the legend for the generated color gradient.
- Return type
str
-
map_color
(value)¶ Assigns a color to the provided value by using the max and min attributes as the scale and normalizing the provided value using min-max normalization.
- Parameters
value (float) – Value to transform to a color in the generated gradient between min and max attributes.
- Returns
hex color value.
- Return type
string
-
-
class
NetExplorer.models.colors.
ColorProfiles
¶ ColorProfiles enum. Stores the following color profiles:
- LINEAR GRADIENTS:
red: 50 colors form white to red.
blue: 50 colors from white to blue.
green: 50 colors from white to blue.
- DIVERGENT GRADIENTS:
blue_white: 25 colors from blue to white.
white_red: 25 colors from white to red.
blue_red: 50 colors from blue to white to red.
yellow_white: 25 colors from yellow to white.
yellow_blue: 50 colors from yellow to white to blue.
white_green: 25 colors from white to green.
red_green: 50 colors from red to white to green.
-
blue
= [<Color #f7f8ff>, <Color #f2f4ff>, <Color #edefff>, <Color #e8ebff>, <Color #e3e6ff>, <Color #dee2ff>, <Color #d9deff>, <Color #d4d9ff>, <Color #cfd5ff>, <Color #cad1ff>, <Color #c5ccff>, <Color #c0c8ff>, <Color #bbc4ff>, <Color #b5bfff>, <Color #b0bbff>, <Color #abb7ff>, <Color #a6b2ff>, <Color #a1aeff>, <Color #9caaff>, <Color #97a6ff>, <Color #92a1ff>, <Color #8d9dff>, <Color #89f>, <Color #8395ff>, <Color #7e90ff>, <Color #798cff>, <Color #7488ff>, <Color #6f84ff>, <Color #6a80ff>, <Color #657bff>, <Color #6077ff>, <Color #5b73ff>, <Color #566fff>, <Color #516bff>, <Color #4c66ff>, <Color #4762ff>, <Color #425eff>, <Color #3c5aff>, <Color #3756ff>, <Color #3252ff>, <Color #2d4eff>, <Color #284aff>, <Color #2345ff>, <Color #1e41ff>, <Color #193dff>, <Color #1439ff>, <Color #0f35ff>, <Color #0a31ff>, <Color #052dff>, <Color #0029ff>]¶
-
blue_red
= [<Color #1f77b4>, <Color #1f7bc0>, <Color #207fcc>, <Color #2082d8>, <Color #2384e0>, <Color #2c87e3>, <Color #3689e6>, <Color #3f8ce9>, <Color #4990eb>, <Color #5393ee>, <Color #5c97f0>, <Color #679bf2>, <Color #71a0f4>, <Color #7ba5f5>, <Color #86aaf7>, <Color #90b0f9>, <Color #9bb6fa>, <Color #a6bcfb>, <Color #b1c3fc>, <Color #bccbfd>, <Color #c8d3fe>, <Color #d3dbfe>, <Color #dfe4ff>, <Color #ebeeff>, <Color white>, <Color white>, <Color #fff0f0>, <Color #ffe5e5>, <Color #ffdbdb>, <Color #ffd0d0>, <Color #ffc6c6>, <Color #fbb>, <Color #ffb1b1>, <Color #ffa7a7>, <Color #ff9c9c>, <Color #ff9292>, <Color #ff8787>, <Color #ff7d7d>, <Color #ff7373>, <Color #ff6868>, <Color #ff5e5e>, <Color #ff5353>, <Color #ff4949>, <Color #ff3e3e>, <Color #ff3434>, <Color #ff2a2a>, <Color #ff1f1f>, <Color #ff1515>, <Color #ff0a0a>, <Color red>]¶
-
blue_white
= [<Color #1f77b4>, <Color #1f7bc0>, <Color #207fcc>, <Color #2082d8>, <Color #2384e0>, <Color #2c87e3>, <Color #3689e6>, <Color #3f8ce9>, <Color #4990eb>, <Color #5393ee>, <Color #5c97f0>, <Color #679bf2>, <Color #71a0f4>, <Color #7ba5f5>, <Color #86aaf7>, <Color #90b0f9>, <Color #9bb6fa>, <Color #a6bcfb>, <Color #b1c3fc>, <Color #bccbfd>, <Color #c8d3fe>, <Color #d3dbfe>, <Color #dfe4ff>, <Color #ebeeff>, <Color #f7f8ff>]¶
-
green
= [<Color #f9fff9>, <Color #f4fff4>, <Color honeydew>, <Color #ebffeb>, <Color #e7ffe7>, <Color #e2fee2>, <Color #defede>, <Color #d9fed9>, <Color #d5fed5>, <Color #d1fdd1>, <Color #cdfdcd>, <Color #c8fdc8>, <Color #c4fcc4>, <Color #c0fcc0>, <Color #bcfbbc>, <Color #b8fbb8>, <Color #b4fab4>, <Color #b0f9b0>, <Color #acf9ac>, <Color #a8f8a8>, <Color #a4f7a4>, <Color #a0f6a0>, <Color #9cf69c>, <Color #98f598>, <Color #94f494>, <Color #91f391>, <Color #8df28d>, <Color #89f189>, <Color #86f086>, <Color #82ef82>, <Color #7fee7f>, <Color #7bed7b>, <Color #78ec78>, <Color #74ea74>, <Color #71e971>, <Color #6de86d>, <Color #6ae66a>, <Color #67e567>, <Color #63e463>, <Color #60e260>, <Color #5de15d>, <Color #5adf5a>, <Color #57de57>, <Color #54dc54>, <Color #51db51>, <Color #4ed94e>, <Color #4bd74b>, <Color #48d648>, <Color #45d445>, <Color #42d242>]¶
-
red
= [<Color snow>, <Color #fff5f5>, <Color #fff0f0>, <Color #ffebeb>, <Color #ffe6e6>, <Color #ffe0e0>, <Color #ffdbdb>, <Color #ffd6d6>, <Color #ffd1d1>, <Color #fcc>, <Color #ffc7c7>, <Color #ffc2c2>, <Color #ffbdbd>, <Color #ffb8b8>, <Color #ffb3b3>, <Color #ffadad>, <Color #ffa8a8>, <Color #ffa3a3>, <Color #ff9e9e>, <Color #f99>, <Color #ff9494>, <Color #ff8f8f>, <Color #ff8a8a>, <Color #ff8585>, <Color #ff8080>, <Color #ff7a7a>, <Color #ff7575>, <Color #ff7070>, <Color #ff6b6b>, <Color #f66>, <Color #ff6161>, <Color #ff5c5c>, <Color #ff5757>, <Color #ff5252>, <Color #ff4d4d>, <Color #ff4747>, <Color #ff4242>, <Color #ff3d3d>, <Color #ff3838>, <Color #f33>, <Color #ff2e2e>, <Color #ff2929>, <Color #ff2424>, <Color #ff1f1f>, <Color #ff1a1a>, <Color #ff1414>, <Color #ff0f0f>, <Color #ff0a0a>, <Color #ff0505>, <Color red>]¶
-
red_green
= [<Color red>, <Color #ff0a0a>, <Color #ff1515>, <Color #ff1f1f>, <Color #ff2a2a>, <Color #ff3434>, <Color #ff3e3e>, <Color #ff4949>, <Color #ff5353>, <Color #ff5e5e>, <Color #ff6868>, <Color #ff7373>, <Color #ff7d7d>, <Color #ff8787>, <Color #ff9292>, <Color #ff9c9c>, <Color #ffa7a7>, <Color #ffb1b1>, <Color #fbb>, <Color #ffc6c6>, <Color #ffd0d0>, <Color #ffdbdb>, <Color #ffe5e5>, <Color #fff0f0>, <Color white>, <Color white>, <Color honeydew>, <Color #e6ffe6>, <Color #ddfedd>, <Color #d4fed4>, <Color #ccfdcc>, <Color #c3fcc3>, <Color #bbfbbb>, <Color #b2fab2>, <Color #aaf8aa>, <Color #a2f7a2>, <Color #9af59a>, <Color #93f393>, <Color #8bf28b>, <Color #84ef84>, <Color #7ced7c>, <Color #75eb75>, <Color #6ee86e>, <Color #68e568>, <Color #61e361>, <Color #5ae05a>, <Color #54dc54>, <Color #4ed94e>, <Color #48d648>, <Color #42d242>]¶
-
white_green
= [<Color #f9fff9>, <Color honeydew>, <Color #e6ffe6>, <Color #ddfedd>, <Color #d4fed4>, <Color #ccfdcc>, <Color #c3fcc3>, <Color #bbfbbb>, <Color #b2fab2>, <Color #aaf8aa>, <Color #a2f7a2>, <Color #9af59a>, <Color #93f393>, <Color #8bf28b>, <Color #84ef84>, <Color #7ced7c>, <Color #75eb75>, <Color #6ee86e>, <Color #68e568>, <Color #61e361>, <Color #5ae05a>, <Color #54dc54>, <Color #4ed94e>, <Color #48d648>, <Color #42d242>]¶
-
white_red
= [<Color snow>, <Color #fff0f0>, <Color #ffe5e5>, <Color #ffdbdb>, <Color #ffd0d0>, <Color #ffc6c6>, <Color #fbb>, <Color #ffb1b1>, <Color #ffa7a7>, <Color #ff9c9c>, <Color #ff9292>, <Color #ff8787>, <Color #ff7d7d>, <Color #ff7373>, <Color #ff6868>, <Color #ff5e5e>, <Color #ff5353>, <Color #ff4949>, <Color #ff3e3e>, <Color #ff3434>, <Color #ff2a2a>, <Color #ff1f1f>, <Color #ff1515>, <Color #ff0a0a>, <Color red>]¶
-
yellow_blue
= [<Color #e4a32d>, <Color #e6a734>, <Color #e8aa3b>, <Color #eaae42>, <Color #ecb149>, <Color #eeb550>, <Color #efb858>, <Color #f1bc5f>, <Color #f2c067>, <Color #f4c36e>, <Color #f5c776>, <Color #f6ca7e>, <Color #f8ce85>, <Color #f9d18d>, <Color #fad595>, <Color #fbd89d>, <Color #fbdba6>, <Color #fcdfae>, <Color #fde2b6>, <Color #fde6bf>, <Color #fee9c7>, <Color #feedd0>, <Color #fff0d8>, <Color #fff4e1>, <Color white>, <Color white>, <Color #ebeeff>, <Color #dfe4ff>, <Color #d3dbfe>, <Color #c8d3fe>, <Color #bccbfd>, <Color #b1c3fc>, <Color #a6bcfb>, <Color #9bb6fa>, <Color #90b0f9>, <Color #86aaf7>, <Color #7ba5f5>, <Color #71a0f4>, <Color #679bf2>, <Color #5c97f0>, <Color #5393ee>, <Color #4990eb>, <Color #3f8ce9>, <Color #3689e6>, <Color #2c87e3>, <Color #2384e0>, <Color #2082d8>, <Color #207fcc>, <Color #1f7bc0>, <Color #1f77b4>]¶
-
yellow_white
= [<Color #e4a32d>, <Color #e6a734>, <Color #e8aa3b>, <Color #eaae42>, <Color #ecb149>, <Color #eeb550>, <Color #efb858>, <Color #f1bc5f>, <Color #f2c067>, <Color #f4c36e>, <Color #f5c776>, <Color #f6ca7e>, <Color #f8ce85>, <Color #f9d18d>, <Color #fad595>, <Color #fbd89d>, <Color #fbdba6>, <Color #fcdfae>, <Color #fde2b6>, <Color #fde6bf>, <Color #fee9c7>, <Color #feedd0>, <Color #fff0d8>, <Color #fff4e1>, <Color #fff7ea>]¶