MarkTechPost@AI 08月19日
Creating Dashboards Using Vizro MCP: Vizro is an Open-Source Python Toolkit by McKinsey
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Vizro是由麦肯锡推出的开源Python工具包,旨在简化数据可视化仪表盘的创建过程。用户只需通过JSON、YAML或Python字典进行少量配置,即可快速构建多页面仪表盘,显著减少了传统编码工作量。Vizro基于Plotly、Dash和Pydantic构建,结合了开源的灵活性与内置的最佳实践,易于学习且高度可定制。本文将指导用户如何利用Vizro MCP服务器,结合Claude Desktop,从数据创建到生成包含多种交互式图表和筛选器的仪表盘,实现从原型到生产的无缝迁移。

📈 **Vizro简化仪表盘开发**:Vizro是一个开源Python工具包,由麦肯锡开发,能够通过简单的配置(JSON、YAML或Python字典)快速创建美观且可投入生产的数据可视化仪表盘,大大减少了开发时间和代码量。

🚀 **技术栈与优势**:Vizro建立在Plotly、Dash和Pydantic之上,融合了开源的灵活性与设计和可扩展性的最佳实践。它上手快,对高级用户高度可定制,能够支持从原型开发到生产环境的无缝过渡。

💡 **集成Claude Desktop创建仪表盘**:文章详细介绍了如何通过Vizro MCP服务器,并结合Claude Desktop来直接生成仪表盘。这包括安装uv包管理器,配置Claude Desktop的`claude_desktop_config.json`文件,指定uvx路径,从而使Vizro MCP服务器在Claude中可用。

📊 **示例仪表盘功能**:通过一个简单的提示“create a vizro dashboard using tips dataset”,Claude能够利用Vizro MCP生成一个包含多种交互式图表的仪表盘,例如消费总额与小费的关系、每日平均小费、性别小费分布以及按用餐人数分类的小费情况。仪表盘还配备了日期、性别和吸烟状态等筛选器,支持交叉筛选分析。

Vizro is an open-source Python toolkit by McKinsey that makes it easy to build beautiful, production-ready data visualization apps. With just a few lines of configuration (via JSON, YAML, or Python dictionaries), you can create multi-page dashboards that would normally take thousands of lines of code.

Built on top of Plotly, Dash, and Pydantic, Vizro combines the flexibility of open source with in-built best practices for design and scalability. It’s quick to learn, customizable for advanced users, and powerful enough to move from prototype to production seamlessly.

In this tutorial, we’ll use the Vizro MCP server to create a dashboard directly from Claude Desktop.

Setting up the dependencies

uv package manager

To run the Vizro server, we will need the uv package manager. Install it with the following commands:

For Mac/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

For Windows:

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Once uv is downloaded, run the following command to get the location of uvx

For Mac/Linux:

For Windows:

Keep the location of uvx handy, we will need it for the config file for Claude

Claude Desktop

You can download Claude Desktop from https://claude.ai/download. Next, open the claude_desktop_config.json file located in the Claude installation directory using any text editor. If the file doesn’t exist, you can create it manually. Once opened, enter the following code:

Mac/Linux:

{  "mcpServers": {    "vizro-mcp": {      "command": "/placeholder-path/uvx",      "args": [        "vizro-mcp"      ]    }  }}

Windows:

{  "mcpServers": {    "vizro-mcp": {      "command": "placeholder-path//uvx",      "args": [        "vizro-mcp"      ]    }  }}

Replace the placeholder-path with the path of uvx

Running the Server

Once the file is configured, Vizro MCP Server should be visible in the list of servers.

Vizro comes with some sample datasets as well. You can try the following prompt to get started:

“create a vizro dashboard using tips dataset”

Claude will use the vizro-mcp to generate the dashboard and open it in your browser via PyCafe, showcasing interactive charts like tip vs total bill, average tips by day, tip distribution by gender, and tips by party size, along with filters for day, gender, and smoker status for seamless cross-filtering analysis.

The post Creating Dashboards Using Vizro MCP: Vizro is an Open-Source Python Toolkit by McKinsey appeared first on MarkTechPost.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Vizro 数据可视化 Python 仪表盘 Claude Desktop
相关文章