D3 Command Guide
Learn how to use the D3 slash command to create powerful data visualizations
Why Use D3?
The /D3
command enables you to create sophisticated data visualizations with simple natural language commands. Perfect for:
- Visualizing sales and revenue trends
- Analyzing customer behavior patterns
- Monitoring KPIs and metrics
- Creating executive dashboards
- Exploring market data
- Presenting financial analysis
Basic Usage
Use the command followed by the description of the chart you want. Give it reference to a dataset. It’s usually better to first prepare the data in a previous step and then use the data in the D3 command (versus trying to do it all in one step).
For this example, I loaded a CSV in the first step and output it to a variable called csvOutput.
Simple Examples
Time Series Analysis
Comparative Analysis
Distribution Analysis
Part-to-Whole Analysis
Advanced Examples
Multi-Metric Dashboard
Interactive Business Analysis
Complex Time Analysis
Hierarchical Data Visualization
What Can D3 Do?
D3 offers an extensive range of visualization capabilities suited for business analytics. See documenation here: https://d3js.org/what-is-d3 and an amazing interactive example here: https://observablehq.com/@d3/gallery
Standard Business Charts
- Line charts for trend analysis
- Bar charts (vertical, horizontal, grouped, stacked)
- Pie and donut charts for composition analysis
- Area charts for cumulative trends
- Scatter plots for correlation analysis
- Bubble charts for multi-dimensional data
Advanced Visualizations
- Heat maps for performance matrices
- Tree maps for hierarchical data
- Sunburst diagrams for multi-level breakdowns
- Network graphs for relationship mapping
- Sankey diagrams for flow analysis
- Radar charts for comparative metrics
- Box plots for statistical distribution
Interactive Features
- Zoom and pan capabilities
- Interactive tooltips
- Click-through drilling
- Dynamic filtering
- Animated transitions
- Real-time updates
- Cross-chart filtering
- Custom legends and annotations
Business Intelligence Features
- Trend line overlays
- Moving averages
- Statistical annotations
- Threshold indicators
- Forecast projections
- Confidence intervals
- Outlier detection
- Benchmark comparisons
Layout Options
- Multi-chart dashboards
- Responsive sizing
- Custom color schemes
- Corporate branding integration
- Export capabilities
- Mobile optimization
- Accessible design features
Tips for Best Results
- Be specific about your data source and desired metrics
- Specify any required filtering or data transformations
- Include desired interactive features in your command
- Mention any specific styling or branding requirements
- Indicate if you need specific annotations or overlays
Remember that D3 can handle various data formats and can create both simple and complex visualizations. The key is to be clear about your data and visualization goals in your command.
Saving and Sharing Your D3 Charts
You can save and share your D3 visualizations in two simple steps:
-
First, create your visualization in one step.
-
Then, save it to global file storage in a subsequent step.
The /filestorage command will return a shareable link that you can send to colleagues. They can view and interact with your visualization directly through this link, making it easy to:
- Include visualizations in presentations
- Share insights with stakeholders
- Embed charts in internal documentation
- Archive important analytical views
- Collaborate on data analysis
Pro tip: Add descriptive names when saving your visualizations to make them easier to find and understand later.
Iterating
When you get into complex datasets and visualizations, Pinkfish may not get it right the first time. In these cases, you’ll need to have a conversation with Pinkfish to get it right. Here’s an example where I used a CSV with customer data and asked Pinkfish to display customers on a map. It took a few iterations to get it right.
Step 1: describe the data in preparation for the D3 command
Step 2, try #1 (resulted in a csv parsing error):
Step 2, try #2 (success)
Step 3: write to filestorage: