戒酒的李白

【展示页完善】各种子菜单的显示完善

  1 +from flask import Flask,session,render_template,redirect,Blueprint,request
  2 +from snownlp import SnowNLP
  3 +from utils.getHomePageData import *
  4 +from utils.getHotWordPageData import *
  5 +from utils.getTableData import *
  6 +from utils.getPublicData import getAllHotWords
  7 +from utils.getEchartsData import *
  8 +pb = Blueprint('page',__name__,url_prefix='/page',template_folder='templates')
  9 +
  10 +@pb.route('/home')
  11 +def home():
  12 + username = session.get('username')
  13 + articleLenMax,likeCountMaxAuthorName,cityMax = getHomeTagsData()
  14 + commentsLikeCountTopFore = getHomeCommentsLikeCountTopFore()
  15 + xData,yData = getHomeArticleCreatedAtChart()
  16 + typeChart = getHomeTypeChart()
  17 + createAtChart = getHomeCommentCreatedChart()
  18 + # getUserNameWordCloud()
  19 + return render_template('index.html',
  20 + username=username,
  21 + articleLenMax=articleLenMax,
  22 + likeCountMaxAuthorName=likeCountMaxAuthorName,
  23 + cityMax=cityMax,
  24 + commentsLikeCountTopFore=commentsLikeCountTopFore,
  25 + xData=xData,
  26 + yData=yData,
  27 + typeChart=typeChart,
  28 + createAtChart=createAtChart
  29 + )
  30 +
  31 +@pb.route('/hotWord')
  32 +def hotWord():
  33 + username = session.get('username')
  34 + hotWordList = getAllHotWords()
  35 + defaultHotWord = hotWordList[0][0]
  36 + if request.args.get('hotWord'):defaultHotWord = request.args.get('hotWord')
  37 + hotWordLen = getHotWordLen(defaultHotWord)
  38 + xData,yData = getHotWordPageCreatedAtCharData(defaultHotWord)
  39 + sentences = ''
  40 + value = SnowNLP(defaultHotWord).sentiments
  41 + if value == 0.5:
  42 + sentences = '中性'
  43 + elif value > 0.5:
  44 + sentences = '正面'
  45 + elif value < 0.5:
  46 + sentences = '负面'
  47 +
  48 + comments = getCommentFilterData(defaultHotWord)
  49 + return render_template('hotWord.html',
  50 + username=username,
  51 + hotWordList=hotWordList,
  52 + defaultHotWord=defaultHotWord,
  53 + hotWordLen=hotWordLen,
  54 + sentences=sentences,
  55 + xData=xData,
  56 + yData=yData,
  57 + comments=comments
  58 + )
  59 +
  60 +@pb.route('/tableData')
  61 +def tableData():
  62 + username = session.get('username')
  63 + defaultFlag = False
  64 + if request.args.get('flag'):defaultFlag = True
  65 + tableData = getTableDataList(defaultFlag)
  66 + return render_template('tableData.html',
  67 + username=username,
  68 + tableData=tableData,
  69 + defaultFlag=defaultFlag
  70 + )
  71 +
  72 +@pb.route('/articleChar')
  73 +def articleChar():
  74 + username = session.get('username')
  75 + typeList = getTypeList()
  76 + defaultType = typeList[0]
  77 + if request.args.get('type'): defaultType = request.args.get('type')
  78 + xData,yData = getArticleCharLikeCount(defaultType)
  79 + x1Data,y1Data = getArticleCharCommentsLen(defaultType)
  80 + x2Data,y2Data = getArticleCharRepotsLen(defaultType)
  81 + return render_template('articleChar.html',
  82 + username=username,
  83 + typeList=typeList,
  84 + defaultType=defaultType,
  85 + xData=xData,
  86 + yData=yData,
  87 + x1Data=x1Data,
  88 + y1Data=y1Data,
  89 + x2Data=x2Data,
  90 + y2Data=y2Data
  91 + )
  92 +
  93 +@pb.route('/ipChar')
  94 +def ipChar():
  95 + username = session.get('username')
  96 + articleRegionData = getIPCharByArticleRegion()
  97 + commentRegionData = getIPCharByCommentsRegion()
  98 + return render_template('ipChar.html',
  99 + username=username,
  100 + articleRegionData=articleRegionData,
  101 + commentRegionData=commentRegionData
  102 + )
  103 +
  104 +@pb.route('/commentChar')
  105 +def commentChar():
  106 + username = session.get('username')
  107 + xData,yData = getCommentCharDataOne()
  108 + genderPieData = getCommentCharDataTwo()
  109 + return render_template('commentChar.html',
  110 + username=username,
  111 + xData=xData,
  112 + yData=yData,
  113 + genderPieData=genderPieData
  114 + )
  115 +
  116 +@pb.route('/yuqingChar')
  117 +def yuqingChar():
  118 + username = session.get('username')
  119 + xData,yData,bieData = getYuQingCharDataOne()
  120 + bieData1,bieData2 = getYuQingCharDataTwo()
  121 + x1Data,y1Data = getYuQingCharDataThree()
  122 + return render_template('yuqingChar.html',
  123 + username=username,
  124 + xData=xData,
  125 + yData=yData,
  126 + bieData=bieData,
  127 + bieData1=bieData1,
  128 + bieData2=bieData2,
  129 + x1Data=x1Data,
  130 + y1Data=y1Data
  131 + )
  132 +
  133 +@pb.route('/articleCloud')
  134 +def articleCloud():
  135 + username = session.get('username')
  136 + return render_template('articleContentCloud.html',
  137 + username=username
  138 + )
  1 +{% extends 'base_page.html' %}
  2 +{% block title %}
  3 + 热词统计
  4 +{% endblock %}
  5 +
  6 +{% block nav %}
  7 +<nav class="iq-sidebar-menu">
  8 + <ul id="iq-sidebar-toggle" class="side-menu">
  9 + <li class="px-3 pt-3 pb-2 ">
  10 + <span class="text-uppercase small font-weight-bold">首页</span>
  11 + </li>
  12 + <li class=" sidebar-layout">
  13 + <a href="/page/home" class="svg-icon">
  14 + <i class="">
  15 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  16 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
  17 + </svg>
  18 + </i>
  19 + <span class="ml-2">首页</span>
  20 + </a>
  21 + </li>
  22 + <li class="active sidebar-layout">
  23 + <a href="/page/hotWord" class="svg-icon ">
  24 + <i class="">
  25 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  26 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
  27 + </svg>
  28 + </i>
  29 + <span class="ml-2">热词统计</span>
  30 + </a>
  31 + </li>
  32 + <li class=" sidebar-layout">
  33 + <a href="/page/tableData" class="svg-icon">
  34 + <i class="">
  35 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  36 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
  37 + </svg>
  38 + </i>
  39 + <span class="ml-2">微博舆情统计</span>
  40 + </a>
  41 + </li>
  42 + <li class="px-3 pt-3 pb-2 ">
  43 + <span class="text-uppercase small font-weight-bold">数据可视化</span>
  44 + </li>
  45 + <li class=" sidebar-layout">
  46 + <a href="/page/articleChar" class="svg-icon">
  47 + <i class="">
  48 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  49 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
  50 + </svg>
  51 + </i>
  52 + <span class="ml-2">文章分析</span>
  53 + </a>
  54 + </li>
  55 + <li class=" sidebar-layout">
  56 + <a href="/page/ipChar" class="svg-icon">
  57 + <i class="">
  58 + <svg class="icon line" width="18" id="receipt" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" stroke="currentColor">
  59 + <path d="M17,16V3L13,5,10,3,7,5,3,3V17.83A3.13,3.13,0,0,0,5.84,21,3,3,0,0,0,9,18V17a1,1,0,0,1,1-1H20a1,1,0,0,1,1,1v1a3,3,0,0,1-3,3H6" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path>
  60 + <line x1="8" y1="10" x2="12" y2="10" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></line>
  61 + </svg>
  62 + </i>
  63 + <span class="ml-2">IP分析</span>
  64 + </a>
  65 + </li>
  66 + <li class=" sidebar-layout">
  67 + <a href="/page/commentChar" class="svg-icon">
  68 + <i class="">
  69 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  70 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path>
  71 + </svg>
  72 + </i><span class="ml-2">评论分析</span>
  73 + </a>
  74 + </li>
  75 + <li class=" sidebar-layout">
  76 + <a href="/page/yuqingChar" class="svg-icon">
  77 + <i class="">
  78 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  79 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
  80 + </svg>
  81 + </i>
  82 + <span class="ml-2">舆情分析</span>
  83 + </a>
  84 + </li>
  85 + <li class="px-3 pt-3 pb-2">
  86 + <span class="text-uppercase small font-weight-bold">词云图</span>
  87 + </li>
  88 + <li class=" sidebar-layout">
  89 + <a href="/page/articleCloud" class="svg-icon">
  90 + <i class="">
  91 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  92 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
  93 + </svg>
  94 + </i><span class="ml-2">文章内容词云图</span>
  95 + </a>
  96 + </li>
  97 + </ul>
  98 + </nav>
  99 +{% endblock %}
  100 +{% block content %}
  101 + <div class="container-fluid">
  102 + <div class="row">
  103 + <div class="col-md-12 mb-4 mt-1">
  104 + <div class="d-flex flex-wrap justify-content-between align-items-center">
  105 + <h4 class="font-weight-bold">热词统计页</h4>
  106 + </div>
  107 + </div>
  108 + </div>
  109 + <div class="row">
  110 + <div class="col-lg-12">
  111 + <div class="card card-block card-stretch card-height">
  112 + <div class="card-body">
  113 + <div class="collapse" id="form-element-15">
  114 + <div class="card"><kbd class="bg-dark"><pre id="select-size" class="text-white"><code>
  115 +&lt;div class="form-group"&gt;
  116 + &lt;label&gt;Small&lt;/label&gt;
  117 + &lt;select class="form-control form-control-sm mb-3"&gt;
  118 + &lt;option selected=""&gt;Open this select menu&lt;/option&gt;
  119 + &lt;option value="1"&gt;One&lt;/option&gt;
  120 + &lt;option value="2"&gt;Two&lt;/option&gt;
  121 + &lt;option value="3"&gt;Three&lt;/option&gt;
  122 + &lt;/select&gt;
  123 +&lt;/div&gt;
  124 +&lt;div class="form-group"&gt;
  125 + &lt;label&gt;Default&lt;/label&gt;
  126 + &lt;select class="form-control mb-3"&gt;
  127 + &lt;option selected=""&gt;Open this select menu&lt;/option&gt;
  128 + &lt;option value="1"&gt;One&lt;/option&gt;
  129 + &lt;option value="2"&gt;Two&lt;/option&gt;
  130 + &lt;option value="3"&gt;Three&lt;/option&gt;
  131 + &lt;/select&gt;
  132 +&lt;/div&gt;
  133 +&lt;div class="form-group"&gt;
  134 + &lt;label&gt;Large&lt;/label&gt;
  135 + &lt;select class="form-control form-control-lg"&gt;
  136 + &lt;option selected=""&gt;Open this select menu&lt;/option&gt;
  137 + &lt;option value="1"&gt;One&lt;/option&gt;
  138 + &lt;option value="2"&gt;Two&lt;/option&gt;
  139 + &lt;option value="3"&gt;Three&lt;/option&gt;
  140 + &lt;/select&gt;
  141 +&lt;/div&gt;
  142 +</code></pre></kbd></div>
  143 + </div>
  144 + <div class="form-group">
  145 + <label>热词选择</label>
  146 + <select onchange="hotWordChange(event)" class="form-control mb-3">
  147 + {% for i in hotWordList %}
  148 + {% if defaultHotWord == i[0] %}
  149 + <option selected value="{{ i[0] }}">{{ i[0] }}</option>
  150 + {% else %}
  151 + <option value="{{ i[0] }}">{{ i[0] }}</option>
  152 + {% endif %}
  153 + {% endfor %}
  154 + </select>
  155 + <script>
  156 + function hotWordChange(e){
  157 + window.location.href = 'http://127.0.0.1:5000/page/hotWord?hotWord=' + e.target.value
  158 + }
  159 + </script>
  160 + </div>
  161 + </div>
  162 + </div>
  163 +
  164 + </div>
  165 + </div>
  166 + <div class="row" style="justify-content: center">
  167 + <div class="col-md-6 col-xl-6">
  168 + <div class="card">
  169 + <div class="card-body">
  170 + <h4 class="card-title font-size-16 mt-0">{{ defaultHotWord }}</h4>
  171 + </div>
  172 + <ul class="list-group list-group-flush">
  173 + <li class="list-group-item">热词名称:{{ defaultHotWord }}</li>
  174 + <li class="list-group-item">出现次数:{{ hotWordLen }}次</li>
  175 + <li class="list-group-item">热词情感:{{ sentences }}</li>
  176 + </ul>
  177 + </div>
  178 +
  179 + </div>
  180 + </div>
  181 + <div class="row">
  182 + <div class="col-lg-12">
  183 + <div class="card">
  184 + <div class="card-body">
  185 + <h4 class="card-title font-size-16 mt-0">热词年份变化趋势</h4>
  186 + </div>
  187 + <div id="main" style="width:100%;height: 450px"></div>
  188 + </div>
  189 + </div>
  190 + </div>
  191 + <div class="row">
  192 + <div class="col-lg-12">
  193 + <div class="card">
  194 + <div class="card-header d-flex justify-content-between">
  195 + <div class="header-title">
  196 + <h4 class="card-title">热词查询表格</h4>
  197 + </div>
  198 + <div class="header-action">
  199 + <i data-toggle="collapse" data-target="#datatable-1" aria-expanded="false">
  200 + <svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  201 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
  202 + </svg>
  203 + </i>
  204 + </div>
  205 + </div>
  206 + <div class="card-body">
  207 + <div class="collapse" id="datatable-1">
  208 + <div class="card"><kbd class="bg-dark">
  209 + <pre id="bootstrap-datatables" class="text-white"><code>
  210 +&lt;table id="datatable" class="table data-table table-striped table-bordered" &gt;
  211 + &lt;thead&gt;
  212 + &lt;tr&gt;
  213 + &lt;th&gt;Name&lt;/th&gt;
  214 + &lt;th&gt;Position&lt;/th&gt;
  215 + &lt;th&gt;Office&lt;/th&gt;
  216 + &lt;th&gt;Age&lt;/th&gt;
  217 + &lt;th&gt;Start date&lt;/th&gt;
  218 + &lt;th&gt;Salary&lt;/th&gt;
  219 + &lt;/tr&gt;
  220 + &lt;/thead&gt;
  221 + &lt;tbody&gt;
  222 + &lt;tr&gt;
  223 + &lt;td&gt;Tiger Nixon&lt;/td&gt;
  224 + &lt;td&gt;System Architect&lt;/td&gt;
  225 + &lt;td&gt;Edinburgh&lt;/td&gt;
  226 + &lt;td&gt;61&lt;/td&gt;
  227 + &lt;td&gt;2011/04/25&lt;/td&gt;
  228 + &lt;td&gt;$320,800&lt;/td&gt;
  229 + &lt;/tr&gt;
  230 + &lt;tr&gt;
  231 + &lt;td&gt;Garrett Winters&lt;/td&gt;
  232 + &lt;td&gt;Accountant&lt;/td&gt;
  233 + &lt;td&gt;Tokyo&lt;/td&gt;
  234 + &lt;td&gt;63&lt;/td&gt;
  235 + &lt;td&gt;2011/07/25&lt;/td&gt;
  236 + &lt;td&gt;$170,750&lt;/td&gt;
  237 + &lt;/tr&gt;
  238 + &lt;tr&gt;
  239 + &lt;td&gt;Ashton Cox&lt;/td&gt;
  240 + &lt;td&gt;Junior Technical Author&lt;/td&gt;
  241 + &lt;td&gt;San Francisco&lt;/td&gt;
  242 + &lt;td&gt;66&lt;/td&gt;
  243 + &lt;td&gt;2009/01/12&lt;/td&gt;
  244 + &lt;td&gt;$86,000&lt;/td&gt;
  245 + &lt;/tr&gt;
  246 + &lt;tr&gt;
  247 + &lt;td&gt;Cedric Kelly&lt;/td&gt;
  248 + &lt;td&gt;Senior Javascript Developer&lt;/td&gt;
  249 + &lt;td&gt;Edinburgh&lt;/td&gt;
  250 + &lt;td&gt;22&lt;/td&gt;
  251 + &lt;td&gt;2012/03/29&lt;/td&gt;
  252 + &lt;td&gt;$433,060&lt;/td&gt;
  253 + &lt;/tr&gt;
  254 + &lt;tr&gt;
  255 + &lt;td&gt;Airi Satou&lt;/td&gt;
  256 + &lt;td&gt;Accountant&lt;/td&gt;
  257 + &lt;td&gt;Tokyo&lt;/td&gt;
  258 + &lt;td&gt;33&lt;/td&gt;
  259 + &lt;td&gt;2008/11/28&lt;/td&gt;
  260 + &lt;td&gt;$162,700&lt;/td&gt;
  261 + &lt;/tr&gt;
  262 + &lt;tr&gt;
  263 + &lt;td&gt;Brielle Williamson&lt;/td&gt;
  264 + &lt;td&gt;Integration Specialist&lt;/td&gt;
  265 + &lt;td&gt;New York&lt;/td&gt;
  266 + &lt;td&gt;61&lt;/td&gt;
  267 + &lt;td&gt;2012/12/02&lt;/td&gt;
  268 + &lt;td&gt;$372,000&lt;/td&gt;
  269 + &lt;/tr&gt;
  270 + &lt;tr&gt;
  271 + &lt;td&gt;Herrod Chandler&lt;/td&gt;
  272 + &lt;td&gt;Sales Assistant&lt;/td&gt;
  273 + &lt;td&gt;San Francisco&lt;/td&gt;
  274 + &lt;td&gt;59&lt;/td&gt;
  275 + &lt;td&gt;2012/08/06&lt;/td&gt;
  276 + &lt;td&gt;$137,500&lt;/td&gt;
  277 + &lt;/tr&gt;
  278 + &lt;tr&gt;
  279 + &lt;td&gt;Rhona Davidson&lt;/td&gt;
  280 + &lt;td&gt;Integration Specialist&lt;/td&gt;
  281 + &lt;td&gt;Tokyo&lt;/td&gt;
  282 + &lt;td&gt;55&lt;/td&gt;
  283 + &lt;td&gt;2010/10/14&lt;/td&gt;
  284 + &lt;td&gt;$327,900&lt;/td&gt;
  285 + &lt;/tr&gt;
  286 + &lt;tr&gt;
  287 + &lt;td&gt;Colleen Hurst&lt;/td&gt;
  288 + &lt;td&gt;Javascript Developer&lt;/td&gt;
  289 + &lt;td&gt;San Francisco&lt;/td&gt;
  290 + &lt;td&gt;39&lt;/td&gt;
  291 + &lt;td&gt;2009/09/15&lt;/td&gt;
  292 + &lt;td&gt;$205,500&lt;/td&gt;
  293 + &lt;/tr&gt;
  294 + &lt;tr&gt;
  295 + &lt;td&gt;Sonya Frost&lt;/td&gt;
  296 + &lt;td&gt;Software Engineer&lt;/td&gt;
  297 + &lt;td&gt;Edinburgh&lt;/td&gt;
  298 + &lt;td&gt;23&lt;/td&gt;
  299 + &lt;td&gt;2008/12/13&lt;/td&gt;
  300 + &lt;td&gt;$103,600&lt;/td&gt;
  301 + &lt;/tr&gt;
  302 + &lt;tr&gt;
  303 + &lt;td&gt;Jena Gaines&lt;/td&gt;
  304 + &lt;td&gt;Office Manager&lt;/td&gt;
  305 + &lt;td&gt;London&lt;/td&gt;
  306 + &lt;td&gt;30&lt;/td&gt;
  307 + &lt;td&gt;2008/12/19&lt;/td&gt;
  308 + &lt;td&gt;$90,560&lt;/td&gt;
  309 + &lt;/tr&gt;
  310 + &lt;tr&gt;
  311 + &lt;td&gt;Quinn Flynn&lt;/td&gt;
  312 + &lt;td&gt;Support Lead&lt;/td&gt;
  313 + &lt;td&gt;Edinburgh&lt;/td&gt;
  314 + &lt;td&gt;22&lt;/td&gt;
  315 + &lt;td&gt;2013/03/03&lt;/td&gt;
  316 + &lt;td&gt;$342,000&lt;/td&gt;
  317 + &lt;/tr&gt;
  318 + &lt;tr&gt;
  319 + &lt;td&gt;Charde Marshall&lt;/td&gt;
  320 + &lt;td&gt;Regional Director&lt;/td&gt;
  321 + &lt;td&gt;San Francisco&lt;/td&gt;
  322 + &lt;td&gt;36&lt;/td&gt;
  323 + &lt;td&gt;2008/10/16&lt;/td&gt;
  324 + &lt;td&gt;$470,600&lt;/td&gt;
  325 + &lt;/tr&gt;
  326 + &lt;tr&gt;
  327 + &lt;td&gt;Haley Kennedy&lt;/td&gt;
  328 + &lt;td&gt;Senior Marketing Designer&lt;/td&gt;
  329 + &lt;td&gt;London&lt;/td&gt;
  330 + &lt;td&gt;43&lt;/td&gt;
  331 + &lt;td&gt;2012/12/18&lt;/td&gt;
  332 + &lt;td&gt;$313,500&lt;/td&gt;
  333 + &lt;/tr&gt;
  334 + &lt;tr&gt;
  335 + &lt;td&gt;Tatyana Fitzpatrick&lt;/td&gt;
  336 + &lt;td&gt;Regional Director&lt;/td&gt;
  337 + &lt;td&gt;London&lt;/td&gt;
  338 + &lt;td&gt;19&lt;/td&gt;
  339 + &lt;td&gt;2010/03/17&lt;/td&gt;
  340 + &lt;td&gt;$385,750&lt;/td&gt;
  341 + &lt;/tr&gt;
  342 + &lt;tr&gt;
  343 + &lt;td&gt;Michael Silva&lt;/td&gt;
  344 + &lt;td&gt;Marketing Designer&lt;/td&gt;
  345 + &lt;td&gt;London&lt;/td&gt;
  346 + &lt;td&gt;66&lt;/td&gt;
  347 + &lt;td&gt;2012/11/27&lt;/td&gt;
  348 + &lt;td&gt;$198,500&lt;/td&gt;
  349 + &lt;/tr&gt;
  350 + &lt;tr&gt;
  351 + &lt;td&gt;Paul Byrd&lt;/td&gt;
  352 + &lt;td&gt;Chief Financial Officer (CFO)&lt;/td&gt;
  353 + &lt;td&gt;New York&lt;/td&gt;
  354 + &lt;td&gt;64&lt;/td&gt;
  355 + &lt;td&gt;2010/06/09&lt;/td&gt;
  356 + &lt;td&gt;$725,000&lt;/td&gt;
  357 + &lt;/tr&gt;
  358 + &lt;tr&gt;
  359 + &lt;td&gt;Gloria Little&lt;/td&gt;
  360 + &lt;td&gt;Systems Administrator&lt;/td&gt;
  361 + &lt;td&gt;New York&lt;/td&gt;
  362 + &lt;td&gt;59&lt;/td&gt;
  363 + &lt;td&gt;2009/04/10&lt;/td&gt;
  364 + &lt;td&gt;$237,500&lt;/td&gt;
  365 + &lt;/tr&gt;
  366 + &lt;tr&gt;
  367 + &lt;td&gt;Bradley Greer&lt;/td&gt;
  368 + &lt;td&gt;Software Engineer&lt;/td&gt;
  369 + &lt;td&gt;London&lt;/td&gt;
  370 + &lt;td&gt;41&lt;/td&gt;
  371 + &lt;td&gt;2012/10/13&lt;/td&gt;
  372 + &lt;td&gt;$132,000&lt;/td&gt;
  373 + &lt;/tr&gt;
  374 + &lt;tr&gt;
  375 + &lt;td&gt;Dai Rios&lt;/td&gt;
  376 + &lt;td&gt;Personnel Lead&lt;/td&gt;
  377 + &lt;td&gt;Edinburgh&lt;/td&gt;
  378 + &lt;td&gt;35&lt;/td&gt;
  379 + &lt;td&gt;2012/09/26&lt;/td&gt;
  380 + &lt;td&gt;$217,500&lt;/td&gt;
  381 + &lt;/tr&gt;
  382 +&lt;/table&gt;
  383 +</code></pre></kbd></div>
  384 + </div>
  385 + <p>根据选择的热词从而查询出评论数据</p>
  386 + <div class="table-responsive">
  387 + <div id="datatable-1_wrapper" class="dataTables_wrapper dt-bootstrap4">
  388 + <div class="row"><div class="col-sm-12"><table id="datatable-1" class="table data-table table-striped table-bordered dataTable" role="grid" aria-describedby="datatable-1_info">
  389 + <thead>
  390 + <tr role="row">
  391 + <th class="sorting sorting_asc" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-sort="ascending" aria-label="Name: activate to sort column descending" style="width: 250.844px;">文章ID</th>
  392 + <th class="sorting" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-label="Position: activate to sort column ascending" style="width: 392.094px;">评论用户</th>
  393 + <th class="sorting" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-label="Office: activate to sort column ascending" style="width: 190.75px;">评论性别</th>
  394 + <th class="sorting" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-label="Age: activate to sort column ascending" style="width: 84.2656px;">评论地址</th>
  395 + <th class="sorting" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-label="Start date: activate to sort column ascending" style="width: 172.594px;">评论内容</th>
  396 + <th class="text-right sorting" tabindex="0" aria-controls="datatable-1" rowspan="1" colspan="1" aria-label="Salary: activate to sort column ascending" style="width: 158.453px;">点赞量</th></tr>
  397 + </thead>
  398 + <tbody>
  399 + {% for i in comments %}
  400 + <tr class="odd">
  401 + <td class="sorting_1">{{ i[0] }}</td>
  402 + <td>{{ i[5] }}</td>
  403 + <td>
  404 + {% if i[6] =='f' %}
  405 + 女生
  406 + {% else %}
  407 + 男生
  408 + {% endif %}
  409 + </td>
  410 + <td>{{ i[3] }}</td>
  411 + <td>{{ i[4] }}</td>
  412 + <td class="text-right">👍{{ i[2] }}</td>
  413 + </tr>
  414 + {% endfor %}
  415 + </tbody>
  416 + </table></div></div>
  417 + </div>
  418 + </div>
  419 + </div>
  420 + </div>
  421 + </div>
  422 +</div>
  423 +
  424 +{% endblock %}
  425 +
  426 +{% block echarts %}
  427 + <script>
  428 + var chartDom = document.getElementById('main');
  429 + var myChart = echarts.init(chartDom);
  430 + var option;
  431 +
  432 + option = {
  433 + tooltip: {
  434 + trigger: 'axis'
  435 + },
  436 + legend: {
  437 + data: ['热词出现时间分布个数']
  438 + },
  439 + toolbox: {
  440 + show: true,
  441 + feature: {
  442 + dataView: { show: true, readOnly: false },
  443 + magicType: { show: true, type: ['line', 'bar'] },
  444 + restore: { show: true },
  445 + saveAsImage: { show: true }
  446 + }
  447 + },
  448 + calculable: true,
  449 + xAxis: [
  450 + {
  451 + type: 'category',
  452 + // prettier-ignore
  453 + data: {{ xData | tojson }}
  454 + }
  455 + ],
  456 + yAxis: [
  457 + {
  458 + type: 'value'
  459 + }
  460 + ],
  461 + dataZoom: [
  462 + {
  463 + show: true,
  464 + start: 10,
  465 + end: 60
  466 + },
  467 + {
  468 + type: 'inside',
  469 + start: 10,
  470 + end: 60
  471 + }
  472 + ],
  473 + series: [
  474 + {
  475 + name: '热词出现时间分布个数',
  476 + type: 'bar',
  477 + data: {{ yData }},
  478 + markPoint: {
  479 + data: [
  480 + { type: 'max', name: 'Max' },
  481 + { type: 'min', name: 'Min' }
  482 + ]
  483 + },
  484 + markLine: {
  485 + data: [{ type: 'average', name: 'Avg' }]
  486 + }
  487 + }
  488 + ]
  489 + };
  490 +
  491 + option && myChart.setOption(option);
  492 +
  493 + </script>
  494 +{% endblock %}
  1 +{% extends 'base_page.html' %}
  1 +{% extends 'base_page.html' %}
  2 +
  3 +{% block title %}
  4 +微博舆情统计页
  5 +{% endblock %}
  6 +{% block nav %}
  7 +<nav class="iq-sidebar-menu">
  8 + <ul id="iq-sidebar-toggle" class="side-menu">
  9 + <li class="px-3 pt-3 pb-2 ">
  10 + <span class="text-uppercase small font-weight-bold">首页</span>
  11 + </li>
  12 + <li class=" sidebar-layout">
  13 + <a href="/page/home" class="svg-icon">
  14 + <i class="">
  15 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  16 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
  17 + </svg>
  18 + </i>
  19 + <span class="ml-2">首页</span>
  20 + </a>
  21 + </li>
  22 + <li class=" sidebar-layout">
  23 + <a href="/page/hotWord" class="svg-icon ">
  24 + <i class="">
  25 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  26 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
  27 + </svg>
  28 + </i>
  29 + <span class="ml-2">热词统计</span>
  30 + </a>
  31 + </li>
  32 + <li class="active sidebar-layout">
  33 + <a href="/page/tableData" class="svg-icon">
  34 + <i class="">
  35 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  36 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
  37 + </svg>
  38 + </i>
  39 + <span class="ml-2">微博舆情统计</span>
  40 + </a>
  41 + </li>
  42 + <li class="px-3 pt-3 pb-2 ">
  43 + <span class="text-uppercase small font-weight-bold">数据可视化</span>
  44 + </li>
  45 + <li class=" sidebar-layout">
  46 + <a href="/page/articleChar" class="svg-icon">
  47 + <i class="">
  48 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  49 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
  50 + </svg>
  51 + </i>
  52 + <span class="ml-2">文章分析</span>
  53 + </a>
  54 + </li>
  55 + <li class=" sidebar-layout">
  56 + <a href="/page/ipChar" class="svg-icon">
  57 + <i class="">
  58 + <svg class="icon line" width="18" id="receipt" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" stroke="currentColor">
  59 + <path d="M17,16V3L13,5,10,3,7,5,3,3V17.83A3.13,3.13,0,0,0,5.84,21,3,3,0,0,0,9,18V17a1,1,0,0,1,1-1H20a1,1,0,0,1,1,1v1a3,3,0,0,1-3,3H6" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path>
  60 + <line x1="8" y1="10" x2="12" y2="10" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></line>
  61 + </svg>
  62 + </i>
  63 + <span class="ml-2">IP分析</span>
  64 + </a>
  65 + </li>
  66 + <li class=" sidebar-layout">
  67 + <a href="/page/commentChar" class="svg-icon">
  68 + <i class="">
  69 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  70 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path>
  71 + </svg>
  72 + </i><span class="ml-2">评论分析</span>
  73 + </a>
  74 + </li>
  75 + <li class=" sidebar-layout">
  76 + <a href="/page/yuqingChar" class="svg-icon">
  77 + <i class="">
  78 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  79 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
  80 + </svg>
  81 + </i>
  82 + <span class="ml-2">舆情分析</span>
  83 + </a>
  84 + </li>
  85 + <li class="px-3 pt-3 pb-2">
  86 + <span class="text-uppercase small font-weight-bold">词云图</span>
  87 + </li>
  88 + <li class=" sidebar-layout">
  89 + <a href="/page/articleCloud" class="svg-icon">
  90 + <i class="">
  91 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  92 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
  93 + </svg>
  94 + </i><span class="ml-2">文章内容词云图</span>
  95 + </a>
  96 + </li>
  97 + </ul>
  98 + </nav>
  99 +{% endblock %}
  100 +{% block content %}
  101 + <div class="container-fluid">
  102 + <div class="row">
  103 + <div class="col-md-12 mb-4 mt-1">
  104 + <div class="d-flex flex-wrap justify-content-between align-items-center">
  105 + <h4 class="font-weight-bold">微博舆情统计页</h4>
  106 + </div>
  107 + </div>
  108 + </div>
  109 +
  110 + <div class="row">
  111 + <div class="col-sm-12">
  112 + <div class="card">
  113 + <div class="card-header d-flex justify-content-between">
  114 + <div class="header-title">
  115 + <h4 class="card-title">微博文章统计表格 - 舆情 情感分类
  116 +</h4>
  117 + </div>
  118 + <div class="header-action">
  119 + <i data-toggle="collapse" data-target="#datatable-1" aria-expanded="false">
  120 + <svg width="20" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
  121 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path>
  122 + </svg>
  123 + </i>
  124 + </div>
  125 + </div>
  126 + <div class="card-body">
  127 + <p><a href="/page/tableData?flag=True" class="btn btn-primary btn-sm">情感分类</a></p>
  128 + <div class="table-responsive">
  129 + <div id="datatable-1_wrapper" class="dataTables_wrapper dt-bootstrap4">
  130 + <div class="row">
  131 + <table id="datatable-1" class="table data-table table-striped table-bordered dataTable" role="grid" aria-describedby="datatable-1_info">
  132 + <thead>
  133 + <tr>
  134 + <th style="font-weight: bold">
  135 + 文章ID
  136 + </th>
  137 + <th style="font-weight: bold">
  138 + 文章IP
  139 + </th>
  140 + <th style="font-weight: bold">
  141 + 点赞量
  142 + </th>
  143 + <th style="font-weight: bold">
  144 + 转发量
  145 + </th>
  146 + <th style="font-weight: bold">
  147 + 评论量
  148 + </th>
  149 + <th style="font-weight: bold">
  150 + 类型
  151 + </th>
  152 + <th style="font-weight: bold">
  153 + 内容
  154 + </th>
  155 + <th style="font-weight: bold">
  156 + 发布时间
  157 + </th>
  158 + {% if defaultFlag %}
  159 + <th style="font-weight: bold">
  160 + 情感分类
  161 + </th>
  162 + {% endif %}
  163 + </tr>
  164 + </thead>
  165 + <tbody>
  166 + {% for article in tableData %}
  167 + <tr class="even">
  168 + <td style="width:330px" class="sorting_1">
  169 + <a href="{{ article[9] }}">
  170 + {{ article[0] }}
  171 + </a>
  172 + </td>
  173 + <td style="width:90px">{{ article[4] }}</td>
  174 + <td style="width:90px">👍{{ article[1] }}</td>
  175 + <td style="width:90px">🥇{{ article[2] }}</td>
  176 + <td style="width:90px">🔥{{ article[3] }}</td>
  177 + <td style="width:90px" class="text-right">{{ article[8] }}</td>
  178 + <td style="width:155px" class="text-right">{{ article[5] }}</td>
  179 + <td style="width:90px" class="text-right">{{ article[7] }}</td>
  180 + {% if defaultFlag %}
  181 + <td style="width:90px">
  182 + {% if article[-1] == '正面' %}
  183 + <span class="text-success">
  184 + {{ article[-1] }}
  185 + </span>
  186 +
  187 + {% else %}
  188 + <span class="text-danger">
  189 + {{ article[-1] }}
  190 + </span>
  191 +
  192 + {% endif %}
  193 + </td>
  194 + {% endif %}
  195 + </tr>
  196 + {% endfor %}
  197 + </tbody>
  198 + </table>
  199 + </div>
  200 + </div>
  201 + </div>
  202 + </div>
  203 + </div>
  204 + </div>
  205 + </div>
  206 +
  207 + </div>
  208 +{% endblock %}
  209 +
  210 +
  211 +{% block echarts %}
  212 + <script>
  213 +
  214 + </script>
  215 +{% endblock %}
  1 +{% extends 'base_page.html' %}
  2 +{% block title %}
  3 + 舆情分析
  4 +{% endblock %}
  5 +{% block nav %}
  6 +<nav class="iq-sidebar-menu">
  7 + <ul id="iq-sidebar-toggle" class="side-menu">
  8 + <li class="px-3 pt-3 pb-2 ">
  9 + <span class="text-uppercase small font-weight-bold">首页</span>
  10 + </li>
  11 + <li class=" sidebar-layout">
  12 + <a href="/page/home" class="svg-icon">
  13 + <i class="">
  14 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  15 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"></path>
  16 + </svg>
  17 + </i>
  18 + <span class="ml-2">首页</span>
  19 + </a>
  20 + </li>
  21 + <li class=" sidebar-layout">
  22 + <a href="/page/hotWord" class="svg-icon ">
  23 + <i class="">
  24 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  25 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"></path>
  26 + </svg>
  27 + </i>
  28 + <span class="ml-2">热词统计</span>
  29 + </a>
  30 + </li>
  31 + <li class=" sidebar-layout">
  32 + <a href="/page/tableData" class="svg-icon">
  33 + <i class="">
  34 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  35 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"></path>
  36 + </svg>
  37 + </i>
  38 + <span class="ml-2">微博舆情统计</span>
  39 + </a>
  40 + </li>
  41 + <li class="px-3 pt-3 pb-2 ">
  42 + <span class="text-uppercase small font-weight-bold">数据可视化</span>
  43 + </li>
  44 + <li class=" sidebar-layout">
  45 + <a href="/page/articleChar" class="svg-icon">
  46 + <i class="">
  47 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  48 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path>
  49 + </svg>
  50 + </i>
  51 + <span class="ml-2">文章分析</span>
  52 + </a>
  53 + </li>
  54 + <li class=" sidebar-layout">
  55 + <a href="/page/ipChar" class="svg-icon">
  56 + <i class="">
  57 + <svg class="icon line" width="18" id="receipt" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" stroke="currentColor">
  58 + <path d="M17,16V3L13,5,10,3,7,5,3,3V17.83A3.13,3.13,0,0,0,5.84,21,3,3,0,0,0,9,18V17a1,1,0,0,1,1-1H20a1,1,0,0,1,1,1v1a3,3,0,0,1-3,3H6" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></path>
  59 + <line x1="8" y1="10" x2="12" y2="10" style="fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2;"></line>
  60 + </svg>
  61 + </i>
  62 + <span class="ml-2">IP分析</span>
  63 + </a>
  64 + </li>
  65 + <li class=" sidebar-layout">
  66 + <a href="/page/commentChar" class="svg-icon">
  67 + <i class="">
  68 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  69 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path>
  70 + </svg>
  71 + </i><span class="ml-2">评论分析</span>
  72 + </a>
  73 + </li>
  74 + <li class="active sidebar-layout">
  75 + <a href="/page/yuqingChar" class="svg-icon">
  76 + <i class="">
  77 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  78 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"></path>
  79 + </svg>
  80 + </i>
  81 + <span class="ml-2">舆情分析</span>
  82 + </a>
  83 + </li>
  84 + <li class="px-3 pt-3 pb-2">
  85 + <span class="text-uppercase small font-weight-bold">词云图</span>
  86 + </li>
  87 + <li class=" sidebar-layout">
  88 + <a href="/page/articleCloud" class="svg-icon">
  89 + <i class="">
  90 + <svg xmlns="http://www.w3.org/2000/svg" width="18" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  91 + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
  92 + </svg>
  93 + </i><span class="ml-2">文章内容词云图</span>
  94 + </a>
  95 + </li>
  96 + </ul>
  97 + </nav>
  98 +{% endblock %}
  99 +
  100 +{% block content %}
  101 + <div class="container-fluid">
  102 + <div class="row">
  103 + <div class="col-md-12 mb-4 mt-1">
  104 + <div class="d-flex flex-wrap justify-content-between align-items-center">
  105 + <h4 class="font-weight-bold">舆情分析</h4>
  106 + </div>
  107 + </div>
  108 + </div>
  109 + <div class="row">
  110 + <div class="col-lg-6">
  111 + <div class="card card-block">
  112 + <div class="card-header d-flex justify-content-between pb-0">
  113 + <div class="header-title">
  114 + <h4 class="card-title mb-0">热词情感趋势柱状图</h4>
  115 + </div>
  116 + </div>
  117 + <div class="card-body">
  118 + <div id="main" style="width: 100%;height: 450px"></div>
  119 + </div>
  120 + </div>
  121 + </div>
  122 + <div class="col-lg-6">
  123 + <div class="card card-block">
  124 + <div class="card-header d-flex justify-content-between pb-0">
  125 + <div class="header-title">
  126 + <h4 class="card-title mb-0">热词情感趋势树形图</h4>
  127 + </div>
  128 + </div>
  129 + <div class="card-body">
  130 + <div id="mainTwo" style="width: 100%;height: 450px"></div>
  131 + </div>
  132 + </div>
  133 + </div>
  134 + <div class="col-lg-6">
  135 + <div class="card card-block">
  136 + <div class="card-header d-flex justify-content-between pb-0">
  137 + <div class="header-title">
  138 + <h4 class="card-title mb-0">文章内容与评论内容舆情趋势饼状图</h4>
  139 + </div>
  140 + </div>
  141 + <div class="card-body">
  142 + <div id="mainThree" style="width: 100%;height: 450px"></div>
  143 + </div>
  144 + </div>
  145 + </div>
  146 + <div class="col-lg-6">
  147 + <div class="card card-block">
  148 + <div class="card-header d-flex justify-content-between pb-0">
  149 + <div class="header-title">
  150 + <h4 class="card-title mb-0">热词TOP10</h4>
  151 + </div>
  152 + </div>
  153 + <div class="card-body">
  154 + <div id="mainFore" style="width: 100%;height: 450px"></div>
  155 + </div>
  156 + </div>
  157 + </div>
  158 + </div>
  159 + </div>
  160 +
  161 +{% endblock %}
  162 +
  163 +{% block echarts %}
  164 + <script>
  165 + var chartDom = document.getElementById('main');
  166 + var myChart = echarts.init(chartDom);
  167 + var option;
  168 +
  169 + var colors = ['#66CC99', '#FFCC66', '#FF6666'];
  170 + option = {
  171 + title: {
  172 + text: '热词情感分析柱状图'
  173 + },
  174 + tooltip: {
  175 + trigger: 'axis'
  176 + },
  177 + legend: {
  178 + data: ['Rainfall']
  179 + },
  180 + toolbox: {
  181 + show: true,
  182 + feature: {
  183 + dataView: { show: true, readOnly: false },
  184 + magicType: { show: true, type: ['line', 'bar'] },
  185 + restore: { show: true },
  186 + saveAsImage: { show: true }
  187 + }
  188 + },
  189 + calculable: true,
  190 + xAxis: [
  191 + {
  192 + type: 'category',
  193 + // prettier-ignore
  194 + data: {{ xData | tojson }}
  195 + }
  196 + ],
  197 + yAxis: [
  198 + {
  199 + type: 'value'
  200 + }
  201 + ],
  202 + series: [
  203 + {
  204 + name: '舆情个数',
  205 + type: 'bar',
  206 + data: {{ yData }},
  207 + markPoint: {
  208 + data: [
  209 + { type: 'max', name: 'Max' },
  210 + { type: 'min', name: 'Min' }
  211 + ]
  212 + },
  213 + markLine: {
  214 + data: [{ type: 'average', name: 'Avg' }]
  215 + },
  216 + itemStyle: {
  217 + color: function (parmas) {
  218 + return colors[parmas.dataIndex % colors.length];
  219 + }
  220 + }
  221 + }
  222 + ]
  223 + };
  224 +
  225 + option && myChart.setOption(option);
  226 +
  227 + </script>
  228 + <script>
  229 + var chartDom = document.getElementById('mainTwo');
  230 + var myChart = echarts.init(chartDom);
  231 + var option;
  232 +
  233 + option = {
  234 + series: [
  235 + {
  236 + type: 'treemap',
  237 + data: {{ bieData | tojson }}
  238 + }
  239 + ]
  240 + };
  241 +
  242 + option && myChart.setOption(option);
  243 +
  244 + </script>
  245 + <script>
  246 + var chartDom = document.getElementById('mainThree');
  247 + var myChart = echarts.init(chartDom);
  248 + var option;
  249 +
  250 + option = {
  251 + tooltip: {
  252 + trigger: 'item',
  253 + formatter: '{a} <br/>{b}: {c} ({d}%)'
  254 + },
  255 + legend: {
  256 + data: [
  257 + '正面',
  258 + '负面',
  259 + '中性'
  260 + ]
  261 + },
  262 + series: [
  263 + {
  264 + name: '评论舆情结果',
  265 + type: 'pie',
  266 + selectedMode: 'single',
  267 + radius: [0, '30%'],
  268 + label: {
  269 + position: 'inner',
  270 + fontSize: 14
  271 + },
  272 + labelLine: {
  273 + show: false
  274 + },
  275 + data: {{ bieData1 | tojson }}
  276 + },
  277 + {
  278 + name: '文章舆情结果',
  279 + type: 'pie',
  280 + radius: ['45%', '60%'],
  281 + labelLine: {
  282 + length: 30
  283 + },
  284 + label: {
  285 + formatter: '{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ',
  286 + backgroundColor: '#F6F8FC',
  287 + borderColor: '#8C8D8E',
  288 + borderWidth: 1,
  289 + borderRadius: 4,
  290 + rich: {
  291 + a: {
  292 + color: '#6E7079',
  293 + lineHeight: 22,
  294 + align: 'center'
  295 + },
  296 + hr: {
  297 + borderColor: '#8C8D8E',
  298 + width: '100%',
  299 + borderWidth: 1,
  300 + height: 0
  301 + },
  302 + b: {
  303 + color: '#4C5058',
  304 + fontSize: 14,
  305 + fontWeight: 'bold',
  306 + lineHeight: 33
  307 + },
  308 + per: {
  309 + color: '#fff',
  310 + backgroundColor: '#4C5058',
  311 + padding: [3, 4],
  312 + borderRadius: 4
  313 + }
  314 + }
  315 + },
  316 + data: {{ bieData2 | tojson }}
  317 + }
  318 + ]
  319 + };
  320 +
  321 + option && myChart.setOption(option);
  322 +
  323 + </script>
  324 + <script>
  325 + var chartDom = document.getElementById('mainFore');
  326 + var myChart = echarts.init(chartDom);
  327 + var option;
  328 +
  329 + option = {
  330 + tooltip: {
  331 + trigger: 'axis',
  332 + axisPointer: {
  333 + type: 'shadow'
  334 + }
  335 + },
  336 + legend: {},
  337 + grid: {
  338 + left: '3%',
  339 + right: '4%',
  340 + bottom: '3%',
  341 + containLabel: true
  342 + },
  343 + xAxis: {
  344 + type: 'value',
  345 + boundaryGap: [0, 0.01]
  346 + },
  347 + yAxis: {
  348 + type: 'category',
  349 + data: {{ x1Data | tojson }}
  350 + },
  351 + series: [
  352 + {
  353 + name: '热词出现个数',
  354 + type: 'bar',
  355 + data:{{ y1Data }}
  356 + }
  357 + ]
  358 + };
  359 +
  360 + option && myChart.setOption(option);
  361 +
  362 + </script>
  363 +{% endblock %}