Skip to content

feat(block-kit): add data visualization block example#99

Closed
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-data-visualization-example-wt
Closed

feat(block-kit): add data visualization block example#99
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-data-visualization-example-wt

Conversation

@zimeg

@zimeg zimeg commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds a Block Kit example for the net-new data_visualization block to the block-kit showcase, mirroring the official docs example. Includes three meaningful chart variants:

  • example01() — pie chart (segments)
  • example02() — bar chart (series + axis_config)
  • example03() — line chart (multiple series + axis_config)

slack_sdk does not yet ship a typed class for this block (confirmed absent in both 3.40.0 and the pinned 3.42.0), so the example defines a small DataVisualizationBlock(Block) subclass following the SDK's own convention (type, attributes property, keyword-only __init__). This keeps the example fully typed and mypy-clean while producing the correct to_dict() payload.

Docs: https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block

Changes

  • block-kit/src/blocks/data_visualization.py — new example with pie/bar/line variants
  • block-kit/tests/blocks/test_data_visualization.py — deep-equality tests against expected literals
  • block-kit/README.md — new bullet (alphabetical) with docs + implementation links

Validation

Ran the same checks CI runs (.github/workflows/test.yml) for the block-kit showcase:

  • ruff check — passed
  • ruff format --diff --check — passed (already formatted)
  • mypy — passed (no issues)
  • pytest -v (new file) — 3 passed
  • pytest (full block-kit suite) — 35 passed

Notes

  • The line chart's second series uses distinct values; the docs example duplicated the first series' values verbatim, which appears to be a copy-paste artifact.
  • One block per PR; opened as draft, not marking ready for review.

Co-Authored-By: Claude svc-devxp-claude@slack-corp.com

Add pie, bar, and line chart examples for the net-new data_visualization
block. slack_sdk does not yet ship a typed class for this block, so the
example defines a DataVisualizationBlock subclass following the SDK
convention.

https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg

zimeg commented Jun 27, 2026

Copy link
Copy Markdown
Member Author

Closing as duplicate of #101 (same data_visualization block example) — consolidating to one PR per block.

@zimeg zimeg closed this Jun 27, 2026
@zimeg zimeg deleted the feat/block-kit-data-visualization-example-wt branch June 27, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant