feat(block-kit): add data visualization block example#99
Closed
zimeg wants to merge 1 commit into
Closed
Conversation
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>
Member
Author
|
Closing as duplicate of #101 (same data_visualization block example) — consolidating to one PR per block. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Block Kit example for the net-new
data_visualizationblock to theblock-kitshowcase, mirroring the official docs example. Includes three meaningful chart variants:example01()— pie chart (segments)example02()— bar chart (series+axis_config)example03()— line chart (multipleseries+axis_config)slack_sdkdoes 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 smallDataVisualizationBlock(Block)subclass following the SDK's own convention (type,attributesproperty, keyword-only__init__). This keeps the example fully typed and mypy-clean while producing the correctto_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 variantsblock-kit/tests/blocks/test_data_visualization.py— deep-equality tests against expected literalsblock-kit/README.md— new bullet (alphabetical) with docs + implementation linksValidation
Ran the same checks CI runs (
.github/workflows/test.yml) for theblock-kitshowcase:ruff check— passedruff format --diff --check— passed (already formatted)mypy— passed (no issues)pytest -v(new file) — 3 passedpytest(full block-kit suite) — 35 passedNotes
Co-Authored-By: Claude svc-devxp-claude@slack-corp.com