Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix annotations font color #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
black reformatting
  • Loading branch information
ben-dem committed Nov 11, 2020
commit 413eed601049e9ee1104ad241d224764030bbdfb
32 changes: 5 additions & 27 deletions 32 packages/python/plotly/plotly/figure_factory/_annotated_heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ def create_annotated_heatmap(
colorscale_validator = ColorscaleValidator()
colorscale = colorscale_validator.validate_coerce(colorscale)
annotations = _AnnotatedHeatmap(
z,
x,
y,
annotation_text,
colorscale,
font_colors,
reversescale,
**kwargs
z, x, y, annotation_text, colorscale, font_colors, reversescale, **kwargs
).make_annotations(**kwargs)

if x or y:
Expand All @@ -127,9 +120,7 @@ def create_annotated_heatmap(
)
layout = dict(
annotations=annotations,
xaxis=dict(
ticks="", dtick=1, side="top", gridcolor="rgb(0, 0, 0)"
),
xaxis=dict(ticks="", dtick=1, side="top", gridcolor="rgb(0, 0, 0)"),
yaxis=dict(ticks="", dtick=1, ticksuffix=" "),
)
else:
Expand All @@ -144,10 +135,7 @@ def create_annotated_heatmap(
layout = dict(
annotations=annotations,
xaxis=dict(
ticks="",
side="top",
gridcolor="rgb(0, 0, 0)",
showticklabels=False,
ticks="", side="top", gridcolor="rgb(0, 0, 0)", showticklabels=False,
),
yaxis=dict(ticks="", ticksuffix=" ", showticklabels=False),
)
Expand Down Expand Up @@ -180,15 +168,7 @@ class _AnnotatedHeatmap(object):
"""

def __init__(
self,
z,
x,
y,
annotation_text,
colorscale,
font_colors,
reversescale,
**kwargs
self, z, x, y, annotation_text, colorscale, font_colors, reversescale, **kwargs
):

self.z = z
Expand Down Expand Up @@ -262,9 +242,7 @@ def get_text_color(self):
elif isinstance(self.colorscale, list):

min_col = to_rgb_color_list(self.colorscale[0][1], [255, 255, 255])
max_col = to_rgb_color_list(
self.colorscale[-1][1], [255, 255, 255]
)
max_col = to_rgb_color_list(self.colorscale[-1][1], [255, 255, 255])

# swap min/max colors if reverse scale
if self.reversescale:
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.