Skip to content
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

WEB-3013 - automatic semantic color tag keys #17430

Merged
merged 4 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
9 changes: 9 additions & 0 deletions content/en/dashboards/guide/semantic_colors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Semantic color guide
kind: guide
davidejones marked this conversation as resolved.
Show resolved Hide resolved
private: true
---

## Supported tag keys

{{% semantic-color %}}
6 changes: 3 additions & 3 deletions content/en/dashboards/guide/widget_colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Selecting the right colors for your graphs
kind: guide
---

In Datadog graphs, color is the primary method by which you can distinguish between series of data. Selecting the right color for your graph ensures that your teammates can parse data in your graphs, draw insights, and troubleshoot effectively.
In Datadog graphs, color is the primary method by which you can distinguish between series of data. Selecting the right color for your graph ensures that your teammates can parse data in your graphs, draw insights, and troubleshoot effectively.

{{< img src="dashboards/guide/colors/colors_top.png" alt="Under the heading 'Graph your data', the user is selecting from a list of color palettes." style="width:90%;" >}}

Expand All @@ -17,7 +17,7 @@ Categorical palettes are best used for data that needs to be differentiated, but

#### Classic

The default Classic palette uses a set of six distinct colors optimized for readability. Colors assigned to series repeat if the number of series exceeds six. Adjacent series have distinct colors.
The default Classic palette uses a set of six distinct colors optimized for readability. Colors assigned to series repeat if the number of series exceeds six. Adjacent series have distinct colors.

The Classic color palette has visual accessibility support.

Expand All @@ -38,7 +38,7 @@ For a small subset of compatible tags, Datadog automatically recognizes the mean

### Diverging palettes

Use a Diverging palette when you need to emphasize the difference in values within a data set. Diverging palettes are best suited to data that has a natural order and a natural midpoint. For example: the amount of change in memory utilization, from -100% to +100%, with a natural midpoint at 0%.
Use a Diverging palette when you need to emphasize the difference in values within a data set. Diverging palettes are best suited to data that has a natural order and a natural midpoint. For example: the amount of change in memory utilization, from -100% to +100%, with a natural midpoint at 0%.

There are two Diverging palette options: cool (green and blue) or warm (interpolates between yellow and orange).

Expand Down
2 changes: 2 additions & 0 deletions layouts/shortcodes/semantic-color.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| Tag key | Description |
| :---------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file exists so that local build doesn't throw errors, it will get replaced with the real table during the ci/cd

9 changes: 3 additions & 6 deletions local/bin/py/build/actions/pull_and_push_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def pull_and_push_file(content, content_dir):
:param content: object with a file_name, a file_path, and options to apply
:param content_dir: The directory where content should be put
"""
base_path = pathlib.Path(content["options"].get("base_path", content_dir))
with open("".join(content["globs"]), mode="r+") as f:
file_content = f.read()
boundary = re.compile(r'^-{3,}$', re.MULTILINE)
Expand All @@ -49,14 +50,10 @@ def pull_and_push_file(content, content_dir):

if output_content:
destination_path = content["options"]["dest_path"].lstrip('/')
dest_path_dir = pathlib.Path(content_dir) / pathlib.Path(destination_path)
dest_path_dir = base_path / pathlib.Path(destination_path)
dest_path_dir.mkdir(parents=True, exist_ok=True)
with open(
"{}{}{}".format(
content_dir,
destination_path,
basename(content["options"]["file_name"]),
),
dest_path_dir / pathlib.Path(basename(content["options"]["file_name"])),
mode="w+",
encoding="utf-8",
) as f:
Expand Down
11 changes: 11 additions & 0 deletions local/bin/py/build/configurations/pull_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1059,3 +1059,14 @@
bundle_excludes:
- "com.datadoghq.test"
- "com.datadoghq.sample"

- repo_name: web-ui
contents:
- action: pull-and-push-file
branch: prod
globs:
- "generated/md/external/semantic-color-documentation.md"
options:
base_path: ""
dest_path: "/layouts/shortcodes/"
file_name: "semantic-color.md"
11 changes: 11 additions & 0 deletions local/bin/py/build/configurations/pull_config_preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,3 +1062,14 @@
bundle_excludes:
- "com.datadoghq.test"
- "com.datadoghq.sample"

- repo_name: web-ui
contents:
- action: pull-and-push-file
branch: prod
globs:
- "generated/md/external/semantic-color-documentation.md"
options:
base_path: ""
dest_path: "/layouts/shortcodes/"
file_name: "semantic-color.md"