Skip to content

Commit

Permalink
Clarify which node / resource types support node_color (#4493)
Browse files Browse the repository at this point in the history
clarifies which node type supports `node_color`. Resolves #4492
  • Loading branch information
mirnawong1 authored Jan 10, 2024
2 parents 7db1329 + e341696 commit bcebadf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions website/docs/reference/analysis-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ analyses:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
config:
[tags](/reference/resource-configs/tags): <string> | [<string>]
columns:
Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/model-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ models:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[latest_version](/reference/resource-properties/latest_version): <version_identifier>
[deprecation_date](/reference/resource-properties/deprecation_date): <YAML_DateTime>
[access](/reference/resource-configs/access): private | protected | public
Expand Down
15 changes: 10 additions & 5 deletions website/docs/reference/resource-configs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ models:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")

```

Expand All @@ -44,7 +45,7 @@ models:
- name: model_name
docs:
show: true | false
node_color: "black"
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>
Expand All @@ -67,7 +68,7 @@ seeds:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```

</File>
Expand All @@ -81,6 +82,7 @@ seeds:
- name: seed_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -97,6 +99,7 @@ snapshots:
[<resource-path>](/reference/resource-configs/resource-path):
+docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```

Expand All @@ -111,6 +114,7 @@ snapshots:
- name: snapshot_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -130,6 +134,7 @@ analyses:
- name: analysis_name
docs:
show: true | false
node_color: color_id # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
```
</File>

Expand All @@ -156,7 +161,7 @@ macros:
</Tabs>

## Definition
The docs field can be used to provide documentation-specific configuration to models. It supports the doc attribute `show`, which controls whether or not models are shown in the auto-generated documentation website. It also supports `node_color` for some node types.
The docs field can be used to provide documentation-specific configuration to models. It supports the doc attribute `show`, which controls whether or not models are shown in the auto-generated documentation website. It also supports `node_color` for models, seeds, snapshots, and analyses. Other node types are not supported.

**Note:** Hidden models will still appear in the dbt DAG visualization but will be identified as "hidden.”

Expand Down Expand Up @@ -204,9 +209,9 @@ models:

## Custom node colors

The `docs` attribute now supports `node_color` to customize the display color of some node types in the DAG within dbt docs. You can define node colors in the files below and apply overrides where needed.
The `docs` attribute now supports `node_color` to customize the display color of some node types in the DAG within dbt docs. You can define node colors in the following files and apply overrides where needed. Note, you need to run or re-run the command `dbt docs generate`.

`node_color` hiearchy:
`node_color` hierarchy:

`<example-sql-file.sql>` overrides `schema.yml` overrides `dbt_project.yml`

Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/seed-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ seeds:
[description](/reference/resource-properties/description): <markdown_string>
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[config](/reference/resource-properties/config):
[<seed_config>](/reference/seed-configs): <config_value>
[tests](/reference/resource-properties/data-tests):
Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/snapshot-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ snapshots:
[meta](/reference/resource-configs/meta): {<dictionary>}
[docs](/reference/resource-configs/docs):
show: true | false
node_color: <color_id> # Use name (such as node_color: purple) or hex code with quotes (such as node_color: "#cd7f32")
[config](/reference/resource-properties/config):
[<snapshot_config>](/reference/snapshot-configs): <config_value>
[tests](/reference/resource-properties/data-tests):
Expand Down

0 comments on commit bcebadf

Please sign in to comment.