Skip to content

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

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

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

Conversation

@zimeg

@zimeg zimeg commented Jun 27, 2026

Copy link
Copy Markdown
Member

Summary

Adds a data_visualization Block Kit example to the block-kit example set, mirroring the official docs reference. Includes four exampleNN() variants covering every chart type the docs demonstrate:

  • example01() — pie chart (labeled segments)
  • example02() — bar chart (single series + axis_config)
  • example03() — area chart (multiple series + axis_config)
  • example04() — line chart (multiple series over time + axis_config)

Each example follows the existing block pattern (e.g. header.py, section.py): it imports the block type from the published SDK and constructs an instance. No block type is defined or inlined in this example repo.

A matching test (tests/blocks/test_data_visualization.py) asserts each produced block .to_dict() deep-equals the expected literal, and a README entry was added (alphabetically, between Context actions and Divider) with docs + implementation links.

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

Dependency

data_visualization is a net-new block type. The example imports DataVisualizationBlock from slack_sdk.models.blocks, which is not yet present in the released slack_sdk (3.42.0 in this repo's requirements). This PR depends on the corresponding SDK PR that adds the typed DataVisualizationBlock class landing and being released. The import is written as if the type exists, per repo convention; it is intentionally NOT hand-rolled here.

Validation

  • pytest tests/blocks/test_data_visualization.pyFAILS to collect on the current slack_sdk 3.42.0 with ImportError: cannot import name 'DataVisualizationBlock' from 'slack_sdk.models.blocks'. This is expected until the SDK PR lands; the test will pass once the type is available.
  • Sanity check: neighboring suites (test_header.py, test_section.py) still pass (4 passed), confirming the change does not break unrelated collection.

Reporting honestly: the new test does not pass yet because the SDK type it imports is unreleased.

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

Mirror the official docs data_visualization block with pie, bar, area,
and line chart examples, plus tests and a README entry.

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

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
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