文章

23

标签

23

评论

4152

数据统计

成立

2543天

文章

23篇

评论

4152条

标签

23个

最近文章

【代码测试】202511

`

        <h1 class="text-2xl md:text-3xl font-bold text-white text-center">对话拆解记录 - 图表分析</h1>
        <p class="text-center text-blue-100 mt-2">基于您上传文档的核心主题与观点可视化</p>
    </header>

    <main class="p-6 md:p-8 space-y-8">

        <!-- 1. D3.js 条形图 -->
        <section class="border border-gray-200 rounded-lg p-6 shadow-sm">
            <h2 class="text-xl font-semibold text-gray-800 mb-6 border-l-4 border-blue-600 pl-3">主要议题分布</h2>
            <p class="text-gray-600 mb-6">下图展示了文档中各主题被讨论的相对热度或详细程度。条形越长,代表该主题在文档中占的篇幅或深度越大。</p>
            <!-- D3 图表容器 -->
            <div class="w-full overflow-x-auto">
                <svg id="bar-chart" class="min-w-[500px]"></svg>
            </div>
        </section>

` <!DOCTYPE html>

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>对话拆解记录 - 图表分析</title>
<!-- 引入 Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- 引入 D3.js -->
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
    /* 使用 Inter 字体 */
    body {
        font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    }
    /* D3 图表样式 */
    .bar {
        transition: fill 0.3s ease;
    }
    .bar:hover {
        fill: #1d4ed8; /* 鼠标悬停时变为深蓝色 */
    }
    .bar-label {
        font-size: 12px;
        fill: #333;
        text-anchor: middle;
    }
    .axis-text {
        font-size: 12px;
        fill: #4b5563;
    }
    .axis path,
    .axis line {
        stroke: #d1d5db;
    }
</style>


<div class="max-w-6xl mx-auto bg-white shadow-lg rounded-2xl overflow-hidden">
    
    <!-- 头部标题 -->
    <header class="bg-gradient-to-r from-blue-600 to-blue-800 p-6 shadow-md">
        <h1 class="text-2xl md:text-3xl font-bold text-white text-center">对话拆解记录 - 图表分析</h1>
        <p class="text-center text-blue-100 mt-2">基于您上传文档的核心主题与观点可视化</p>
    </header>

    <main class="p-6 md:p-8 space-y-8">

        <!-- 1. D3.js 条形图 -->
        <section class="border border-gray-200 rounded-lg p-6 shadow-sm">
            <h2 class="text-xl font-semibold text-gray-800 mb-6 border-l-4 border-blue-600 pl-3">主要议题分布</h2>
            <p class="text-gray-600 mb-6">下图展示了文档中各主题被讨论的相对热度或详细程度。条形越长,代表该主题在文档中占的篇幅或深度越大。</p>
            <!-- D3 图表容器 -->
            <div class="w-full overflow-x-auto">
                <svg id="bar-chart" class="min-w-[500px]"></svg>
            </div>
        </section>

        <!-- 2. 核心观点拆解 -->
        <section>
            <h2 class="text-xl font-semibold text-gray-800 mb-6 border-l-4 border-blue-600 pl-3">核心观点拆解</h2>
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                
                <!-- 卡片1: 智能硬件创始人 -->
                <div class="bg-blue-50 border border-blue-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-blue-800 mb-3">智能硬件创始人的能力</h3>
                    <ul class="list-disc list-inside space-y-2 text-gray-700">
                        <li><strong>用户同理心:</strong>关注真实需求,而非幻想。</li>
                        <li><strong>第一性思考:</strong>对技术工程有良好拆解和空间结构感。</li>
                        <li><strong>产品品味:</strong>对美感和整体感觉有判断力。</li>
                        <li><strong>全栈团队力:</strong>能组建和领导覆盖设计、生产、量产、销售的团队。</li>
                    </ul>
                </div>

                <!-- 卡片2: IP打造:五维评估 -->
                <div class="bg-green-50 border border-green-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-green-800 mb-3">IP打造:五维评估</h3>
                    <p class="text-sm text-gray-600 mb-3">用于筛选(5年以上经验)老师的IP罗盘:</p>
                    <ol class="list-decimal list-inside space-y-2 text-gray-700">
                        <li><strong>表现力</strong> (镜头感, 叙事能力)</li>
                        <li><strong>内容力</strong> (储备, 经历, 迭代意愿)</li>
                        <li><strong>商业力</strong></li>
                        <li><strong>赛道竞争力</strong> (肖像能力, 背书成就)</li>
                        <li><strong>沟通力</strong></li>
                    </ol>
                </div>

                <!-- 卡片3: PREP 内容结构 -->
                <div class="bg-yellow-50 border border-yellow-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-yellow-800 mb-3">PREP 内容结构</h3>
                    <p class="text-sm text-gray-600 mb-3">用于中长视频、抓住用户注意力的结构:</p>
                    <div class="space-y-3">
                        <div class="flex items-start">
                            <span class="text-2xl font-bold text-yellow-700 w-8">P</span>
                            <span class="ml-2 text-gray-700"><strong>Point (观点):</strong> 瞬间抓住注意力 (如: "我一顿饭花了5万美金...")</span>
                        </div>
                        <div class="flex items-start">
                            <span class="text-2xl font-bold text-yellow-700 w-8">R</span>
                            <span class="ml-2 text-gray-700"><strong>Reason (原因):</strong> 为什么我能做到?延续注意力。</span>
                        </div>
                        <div class="flex items-start">
                            <span class="text-2xl font-bold text-yellow-700 w-8">E</span>
                            <span class="ml-2 text-gray-700"><strong>Example (例子):</strong> 讲故事 (运用好莱坞编剧结构)。</span>
                        </div>
                        <div class="flex items-start">
                            <span class="text-2xl font-bold text-yellow-700 w-8">P</span>
                            <span class="ml-2 text-gray-700"><strong>Point (观点):</strong> 回到观点或升华,建立人设高度。</span>
                        </div>
                    </div>
                </div>

                <!-- 卡片4: 平台逻辑 -->
                <div class="bg-indigo-50 border border-indigo-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-indigo-800 mb-3">平台逻辑对比</h3>
                    <div class="space-y-4">
                        <div>
                            <h4 class="font-semibold text-gray-700">抖音</h4>
                            <p class="text-gray-600">逻辑:<strong class="text-indigo-700">人性的真我</strong>(抓马、戏剧性、骨子里的)。</d>
                        </div>
                        <div>
                            <h4 class="font-semibold text-gray-700">视频号</h4>
                            <p class="text-gray-600">逻辑:<strong class="text-indigo-700">人性的超我</strong>(嵌入熟人社交、正能量、美好)。</p>
                        </div>
                    </div>
                </div>
                
                <!-- 卡片5: 视频号运营 -->
                <div class="bg-red-50 border border-red-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-red-800 mb-3">视频号运营 (一鱼六吃)</h3>
                    <div class="grid grid-cols-2 gap-4">
                        <div>
                            <h4 class="font-semibold text-gray-700">公域</h4>
                            <ul class="list-disc list-inside text-gray-600">
                                <li>短视频</li>
                                <li>直播</li>
                                <li>公众号</li>
                                <li>问一问</li>
                            </ul>
                        </div>
                        <div>
                            <h4 class="font-semibold text-gray-700">私域</h4>
                            <ul class="list-disc list-inside text-gray-600">
                                <li>私聊</li>
                                <li>群聊</li>
                                <li>朋友圈</li>
                            </ul>
                        </div>
                    </div>
                </div>
                
                <!-- 卡片6: 核心理念 -->
                <div class="bg-gray-50 border border-gray-200 rounded-lg p-5 shadow-sm hover:shadow-md transition-shadow duration-300">
                    <h3 class="text-lg font-semibold text-gray-800 mb-3">核心理念:信任</h3>
                    <ul class="list-disc list-inside space-y-2 text-gray-700">
                        <li>高客单来源于<strong class="text-blue-700">信任</strong>。</li>
                        <li>信任来源于<strong class="text-blue-700">重逢</strong> (多次见到)。</li>
                        <li>关系的本质是<strong class="text-blue-700">无意图的对你好</strong>。</li>
                        <li>做内容就是先对别人好 (提供价值)。</li>
                    </ul>
                </div>

            </div>
        </section>

    </main>
</div>

<!-- D3.js 绘图脚本 -->
<script>
    // 确保 DOM 加载完成后再执行脚本
    window.addEventListener('DOMContentLoaded', (event) => {
        // 1. 定义数据 (基于文档内容的主观评估)
        const data = [
            { topic: "视频号/内容运营", value: 10 },
            { topic: "IP打造/MCN", value: 8 },
            { topic: "智能硬件创业", value: 7 },
            { topic: "文化/疗愈", value: 5 },
            { topic: "平台对比 (抖/视)", value: 4 },
            { topic: "风险投资", value: 3 }
        ];

        // 2. 设置 SVG 尺寸
        const margin = { top: 20, right: 30, bottom: 100, left: 40 };
        const width = 600 - margin.left - margin.right;
        const height = 400 - margin.top - margin.bottom;

        // 3. 创建 SVG 容器
        const svg = d3.select("#bar-chart")
            .attr("width", width + margin.left + margin.right)
            .attr("height", height + margin.top + margin.bottom)
            .append("g")
            .attr("transform", `translate(${margin.left},${margin.top})`);

        // 4. 创建比例尺
        // X 轴 (序数比例尺)
        const x = d3.scaleBand()
            .domain(data.map(d => d.topic))
            .range([0, width])
            .padding(0.4);

        // Y 轴 (线性比例尺)
        const y = d3.scaleLinear()
            .domain([0, d3.max(data, d => d.value)])
            .nice()
            .range([height, 0]);

        // 5. 绘制坐标轴
        // X 轴
        const xAxis = svg.append("g")
            .attr("transform", `translate(0,${height})`)
            .call(d3.axisBottom(x));
        
        xAxis.selectAll("text")
            .attr("class", "axis-text")
            .attr("transform", "translate(-10,10)rotate(-45)")
            .style("text-anchor", "end");

        xAxis.selectAll("path, line").attr("class", "axis");

        // Y 轴
        const yAxis = svg.append("g")
            .call(d3.axisLeft(y).ticks(5));
        
        yAxis.selectAll("text").attr("class", "axis-text");
        yAxis.selectAll("path, line").attr("class", "axis");

        // 6. 绘制条形
        svg.selectAll(".bar")
            .data(data)
            .enter()
            .append("rect")
            .attr("class", "bar")
            .attr("x", d => x(d.topic))
            .attr("y", d => y(d.value))
            .attr("width", x.bandwidth())
            .attr("height", d => height - y(d.value))
            .attr("fill", "#3b82f6") // 蓝色
            .attr("rx", 4) // 圆角
            .attr("ry", 4);

        // 7. 添加条形顶部的数值标签
        svg.selectAll(".bar-label")
            .data(data)
            .enter()
            .append("text")
            .attr("class", "bar-label")
            .attr("x", d => x(d.topic) + x.bandwidth() / 2)
            .attr("y", d => y(d.value) - 5) // 在条形上方 5px 处
            .text(d => d.value);

        // 8. 响应式调整
        function resize() {
            const container = d3.select("#bar-chart").node().parentElement;
            // 添加保护,确保 container 存在
            if (!container) return; 
            
            const newWidth = container.clientWidth;
            
            svg.attr("width", newWidth);
            
            const newChartWidth = newWidth - margin.left - margin.right;
            
            // 更新 X 比例尺
            x.range([0, newChartWidth]);
            
            // 更新 X 轴
            xAxis.call(d3.axisBottom(x));
            xAxis.selectAll("text")
                .attr("transform", "translate(-10,10)rotate(-45)")
                .style("text-anchor", "end");

            // 更新条形
            svg.selectAll(".bar")
                .attr("x", d => x(d.topic))
                .attr("width", x.bandwidth());
                
            // 更新标签
            svg.selectAll(".bar-label")
                .attr("x", d => x(d.topic) + x.bandwidth() / 2);
        }

        // 初始调用和窗口大小改变时调用
        resize();
        d3.select(window).on('resize', resize);
    });
</script>


【代码测试】202511

发布于

November 18, 2025

分类

加入我们

版权协议

MIT

评论
😀
已有 5 条评论

    华纳公司官方开户渠道?(183-8890-9465)-薇-STS5099【6011643】
    如何通过官方渠道申请华纳公司账户?(183-8890-9465)-薇-STS5099【6011643】
    华纳总公司官方开户指南?(183-8890-9465)-薇-STS5099【6011643】
    华纳公司官方开户所需材料?(183-8890-9465)-薇-STS5099【6011643】
    华纳官方开户流程?(183-8890-9465)-薇-STS5099【6011643】
    华纳公司官方开户申请步骤?(183-8890-9465)-薇-STS5099【6011643】
    华纳官方开户指南?(183-8890-9465)-薇-STS5099【6011643】
    华纳总公司官方开户?(183-8890-9465)-薇-STS5099【6011643】
    华纳公司官方开户所需材料?(183-8890-9465)-薇-STS5099【6011643】
    华纳官方开户申请流程?(183-8890-9465)-薇-STS5099【6011643】

    《华纳圣淘沙公司开户流程全解析》→ 官方顾问一对一指导??? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙开户步骤详解》→ 」专属通道快速办理??? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙账户注册指南》→ 扫码获取完整资料清单?「微?? 安全联系:183第三段8890第四段9465
    《新手开通华纳圣淘沙公司账户指南》→ 限时免费咨询开放??? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙企业开户标准流程》→ 资深顾问实时解答疑问??? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙开户步骤全景图》→ 点击获取极速开户方案??? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙账户创建全流程手册》→ 预约顾问免排队服务?9?? 安全联系:183第三段8890第四段9465 《从零开通华纳圣淘沙公司账户》→ 添加客服领取开户工具包?? 安全联系:183第三段8890第四段9465
    《官方授权:华纳圣淘沙开户流程》→ 认证顾问全程代办?」?? 安全联系:183第三段8890第四段9465
    《华纳圣淘沙开户说明书》→立即联系获取电子版文件??? 安全联系:183第三段8890第四段9465

    寻找华纳圣淘沙公司开户代理(183-8890-9465薇-STS5099】

    华纳圣淘沙官方合作开户渠道(183-8890-9465薇-STS5099】

    华纳圣淘沙公司开户代理服务(183-8890-9465薇-STS5099】

    华纳圣淘沙公司开户咨询热线(183-8890-9465薇-STS5099】

    联系客服了解华纳圣淘沙开户

    (183-8890-9465薇-STS5099】
    华纳圣淘沙公司开户专属顾问

    (183-8890-9465薇-STS5099】

    华纳圣淘沙公司开户新手教程

    零基础学会(183-8890-9465薇-STS5099)
    华纳圣淘沙公司开户

    华纳圣淘沙公司开户保姆级教程(183-8890-9465薇-STS5099)

    一步步教你开通华纳圣淘沙公司账户(183-8890-9465薇-STS5099)

    华纳圣淘沙公司开户分步图解

    首次开户必看:(183-8890-9465薇-STS5099)
    华纳圣淘沙全攻略

    华纳圣淘沙公司开户实操手册(183-8890-9465薇-STS5099)
    华纳圣淘沙开户流程视频教程

    手把手教学:(183-8890-9465薇-STS5099)
    华纳圣淘沙公司开户

    华纳圣淘沙公司开户完全指南(183-8890-9465薇-STS5099)

    华纳圣淘沙公司开户新手教程

    零基础学会(183-8890-9465薇-STS5099)
    华纳圣淘沙公司开户

    华纳圣淘沙公司开户保姆级教程(183-8890-9465薇-STS5099)

    一步步教你开通华纳圣淘沙公司账户(183-8890-9465薇-STS5099)

    华纳圣淘沙公司开户分步图解

    首次开户必看:(183-8890-9465薇-STS5099)
    华纳圣淘沙全攻略

    华纳圣淘沙公司开户实操手册(183-8890-9465薇-STS5099)
    华纳圣淘沙开户流程视频教程

    手把手教学:(183-8890-9465薇-STS5099)
    华纳圣淘沙公司开户

    华纳圣淘沙公司开户完全指南(183-8890-9465薇-STS5099)

感谢支持!

微信二维码

请使用微信扫描二维码打赏。

支付宝二维码

请使用支付宝扫描二维码打赏。