heatmap.js来绘制热力图

Heatmap.js

  • 一、简介
  • 二、使用
    • 2.1 上手
    • 2.2 设置点的半径
    • 2.3 添加底图
    • 2.4 更多
  • 三、高级用法
    • 3.1 动态热力图
    • 3.2 鼠标跟随热力图
    • 3.3 显示数值

一、简介

Heatmap.js V2.0 是目前网络上最先进的热图可视化库。新的2.0版本 Heatmap.js 更快,拥有更强的渲染模块,使用更方便,因此您可以快速掌握和扩展自定义功能。

参考链接:

  1. 官方文档
  2. 【JS】heatmap.js v2.0,详细参数总结

二、使用

😃 先下载js使用 😃

原文:https://github.com/pa7/heatmap.js/blob/master/build/heatmap.js

或者外链引入!(建议下载,运行速度更快~)

2.1 上手

  • 初始化实例,heatmapInstance
  • 给实例设置数据(随机点)
    在这里插入图片描述
    简单教程:Minimal Configuration Example

Tips:获取文档中class="example"的第一个元素:
document.querySelector(".example");

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>HeadMap.js</title><!--Framework--><script src="js/heatmap.js" type="text/javascript"></script></head><body><h1>HeadMap</h1><div class="heatmap" style="height: 600px;width: 500px;"></div><script type="text/javascript">// minimal heatmap instance configurationvar heatmapInstance = h337.create({// only container is required, the rest will be defaults//只需要一个container,也就是最终要绘制图形的dom节点,其他都默认container: document.querySelector('.heatmap')});// now generate some random datavar points = [];var max = 0;var width = 840;var height = 400;var len = 200;while (len--) {var val = Math.floor(Math.random()*100);max = Math.max(max, val);var point = {//这里可以自定义x: Math.floor(Math.random()*width),y: Math.floor(Math.random()*height),value: val};points.push(point);}// heatmap data formatvar data = {max: max,//所有数据中的最大值data: points//最终要展示的数据};// if you have a set of datapoints always use setData instead of addData// for data initializationheatmapInstance.setData(data);</script></body>
</html>

2.2 设置点的半径

point 配置点的半径:radius: radius

var point = {x: Math.floor(Math.random()*width),y: Math.floor(Math.random()*height),value: val,// radius configuration on point basis 主要是半径的配置,radius: radius};points.push(point);
}

右图是配置了半径:
在这里插入图片描述在这里插入图片描述

2.3 添加底图

			<div class="heatmap" style=" width:700px; height: 600px;"><img src="img/classroom.png" style="width:100%; height: 100%"></div>

在这里插入图片描述

2.4 更多

修改了画布颜色,点大小等:
在这里插入图片描述
源码:

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>HeadMap.js</title><!--Framework--><script src="js/jquery-3.4.1.min.js" type="text/javascript"></script><script src="js/heatmap.js" type="text/javascript"></script></head><body><h1>HeadMap</h1><div class="heatmap" style="height: 600px;width: 500px;"></div><script type="text/javascript">// customized heatmap configurationvar heatmapInstance = h337.create({// required containercontainer: document.querySelector('.heatmap'),// backgroundColor to cover transparent areas  背景颜色,可以覆盖透明区域backgroundColor: 'rgba(0,0,0,.95)',// custom gradient colors 这里设置了颜色梯度。键值从0到1gradient: {// enter n keys between 0 and 1 here// for gradient color customization'.5': 'blue','.8': 'red','.95': 'white'},// the maximum opacity (the value with the highest intensity will have it) 最高透明度maxOpacity: .9,// minimum opacity. any value > 0 will produce // no transparent gradient transition minOpacity: .3});// now generate some random datavar points = [];var max = 0;var width = 540;var height = 600;var len = 300;while (len--) {var val = Math.floor(Math.random()*100);var radius = Math.floor(Math.random()*70);max = Math.max(max, val);var point = {x: Math.floor(Math.random()*width),y: Math.floor(Math.random()*height),value: val,radius: radius};points.push(point);}// heatmap data formatvar data = { max: max, data: points };// if you have a set of datapoints always use setData instead of addData// for data initializationheatmapInstance.setData(data);</script></body>
</html>

三、高级用法

参考官方文档,大概如下函数(命名即使用方法),具体使用见example:

官方文档:heatmap.js Documentation
在这里插入图片描述

总共有两个对象: h337是heatmap的全局变量, 而heatmapInstance是h337实例化的对象

😃 划重点 😃

官方示例:heatmap.js Examples

根据官方示例,画轮子造车,这里有:

  • 动态热力图
  • 基础热力图(basic example也就是我们之前说的)
  • 鼠标跟随热力图
  • 谷歌地图结合热力图
  • AngularJS 结合热力图
    在这里插入图片描述

3.1 动态热力图

这里我以动态热力图为目标,开始学习:
(多图数据刷新,模拟动态效果,下方可选择倍数查看)
在这里插入图片描述

headMap.js用法与前文相同,这里引入了canvas画布作为动图演示模块,引入了原文的example-commons.css样式,效果实现。

源码:

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>HeadMap.js</title><!-- 动图效果样式 --><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/commons.css"><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/example-commons.css"><!--Framework--><script src="js/heatmap.js" type="text/javascript"></script><style>.demo-wrapper {position: relative;}/* animation player css */.timeline-wrapper {position: absolute;top: 10px;left: 10px;right: 10px;height: 30px;background: white;transition: 1s ease all;border-radius: 4px;box-shadow: 0 1px 5px rgba(0, 0, 0, .65)}.heatmap-timeline {position: absolute;top: 0;right: 15px;left: 80px;height: 100%;}.heatmap-timeline .line {position: absolute;left: 0;right: 0;top: 15px;height: 2px;background: #d7d7d7;}.heatmap-timeline .time-point.active {background: black;}.heatmap-timeline .time-point {position: absolute;background: white;border: 2px solid #272727;width: 8px;height: 8px;border-radius: 100%;cursor: pointer;top: 15px;transform: translateX(-50%) translateY(-50%);}.heatmap-timeline .time-point:hover {box-shadow: 0 0 5px black;}.timeline-wrapper button {position: absolute;outline: none;color: black;background: #f2f2f2;width: 65px;height: 100%;cursor: pointer;border: none;text-transform: uppercase;border-top-left-radius: 3px;border-bottom-left-radius: 3px;}.heatmap-timeline .time-point.active {background: black;}/* end animation player css */</style></head><body><h1>HeadMap</h1><div class="wrapper"><div class="demo-wrapper"><div class="heatmap" style="position: relative;"><canvas class="heatmap-canvas" width="834" height="400" style="position: absolute; left: 0px; top: 0px;"></canvas></div><div class="timeline-wrapper"><button>play</button><div class="heatmap-timeline"><div class="line"></div><div class="time-point" style="left: 0%;"></div><div class="time-point" style="left: 5.26316%;"></div><div class="time-point" style="left: 10.5263%;"></div><div class="time-point" style="left: 15.7895%;"></div><div class="time-point" style="left: 21.0526%;"></div><div class="time-point active" style="left: 26.3158%;"></div><div class="time-point" style="left: 31.5789%;"></div><div class="time-point" style="left: 36.8421%;"></div><div class="time-point" style="left: 42.1053%;"></div><div class="time-point" style="left: 47.3684%;"></div><div class="time-point" style="left: 52.6316%;"></div><div class="time-point" style="left: 57.8947%;"></div><div class="time-point" style="left: 63.1579%;"></div><div class="time-point" style="left: 68.4211%;"></div><div class="time-point" style="left: 73.6842%;"></div><div class="time-point" style="left: 78.9474%;"></div><div class="time-point" style="left: 84.2105%;"></div><div class="time-point" style="left: 89.4737%;"></div><div class="time-point" style="left: 94.7368%;"></div><div class="time-point" style="left: 100%;"></div></div></div></div><div class="demo-controls"><button class="trigger-refresh btn" data-fps="10">Set speed to 10 frames per second</button><button class="trigger-refresh btn" data-fps="5">Set speed to 5 frames per second</button><button class="trigger-refresh btn" data-fps="1">Set speed to 1 frame per second</button><br style="clear:both"></div></div><script type="text/javascript">window.onload = function() {function generateRandomData(len) {// generate some random datavar points = [];var max = 0;var width = 840;var height = 400;while (len--) {var val = Math.floor(Math.random() * 100);max = Math.max(max, val);var point = {x: Math.floor(Math.random() * width),y: Math.floor(Math.random() * height),value: val};points.push(point);}var data = {max: max,data: points};return data;}function $(selector) {return document.querySelectorAll(selector);}function AnimationPlayer(options) {this.heatmap = options.heatmap;this.data = options.data;this.interval = null;this.animationSpeed = options.animationSpeed || 300;this.wrapperEl = options.wrapperEl;this.isPlaying = false;this.init();};AnimationPlayer.prototype = {init: function() {var dataLen = this.data.length;this.wrapperEl.innerHTML = '';var playButton = this.playButton = document.createElement('button');playButton.onclick = function() {if (this.isPlaying) {this.stop();} else {this.play();}this.isPlaying = !this.isPlaying;}.bind(this);playButton.innerText = 'play';this.wrapperEl.appendChild(playButton);var events = document.createElement('div');events.className = 'heatmap-timeline';events.innerHTML = '<div class="line"></div>';for (var i = 0; i < dataLen; i++) {var xOffset = 100 / (dataLen - 1) * i;var ev = document.createElement('div');ev.className = 'time-point';ev.style.left = xOffset + '%';ev.onclick = (function(i) {return function() {this.isPlaying = false;this.stop();this.setFrame(i);}.bind(this);}.bind(this))(i);events.appendChild(ev);}this.wrapperEl.appendChild(events);this.setFrame(0);},play: function() {var dataLen = this.data.length;this.playButton.innerText = 'pause';this.interval = setInterval(function() {this.setFrame(++this.currentFrame % dataLen);}.bind(this), this.animationSpeed);},stop: function() {clearInterval(this.interval);this.playButton.innerText = 'play';},setFrame: function(frame) {this.currentFrame = frame;var snapshot = this.data[frame];this.heatmap.setData(snapshot);var timePoints = $('.heatmap-timeline .time-point');for (var i = 0; i < timePoints.length; i++) {timePoints[i].classList.remove('active');}timePoints[frame].classList.add('active');},setAnimationData: function(data) {this.isPlaying = false;this.stop();this.data = data;this.init();},setAnimationSpeed: function(speed) {this.isPlaying = false;this.stop();this.animationSpeed = speed;}};var heatmapInstance = h337.create({container: document.querySelector('.heatmap')});// animationData contains an array of heatmap statesvar animationData = [];for (var i = 0; i < 20; i++) {animationData.push(generateRandomData(300));}var player = new AnimationPlayer({heatmap: heatmapInstance,wrapperEl: document.querySelector('.timeline-wrapper'),data: animationData,animationSpeed: 500});var controlButtons = $('.trigger-refresh');for (var i = 0; i < controlButtons.length; i++) {controlButtons[i].onclick = function() {var fps = this.dataset.fps;player.setAnimationSpeed(1 / (+fps) * 1000);};}};</script></body>
</html>

3.2 鼠标跟随热力图

主要是捕捉鼠标移动效果,再绘图:
在这里插入图片描述

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>HeadMap.js</title><!-- 动图效果样式 --><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/commons.css"><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/example-commons.css"><!--Framework--><script src="js/heatmap.js" type="text/javascript"></script><style>.demo-wrapper { position:relative; background:rgba(0,0,0,.9); }.text-bg { color:rgba(255,255,255,.8);  position:absolute; left:0; top:0; right:0; bottom:0; height:40px; width:230px; text-align:center; margin:auto; }</style></head><body><h1>HeadMap</h1><div class="wrapper"><div class="demo-wrapper"><div class="text-bg">much interesting click &amp; move zone here!</div><div class="heatmap" style="position: relative;"><canvas class="heatmap-canvas" width="834" height="400" style="position: absolute; left: 0px; top: 0px;">	</canvas></div></div></div><script type="text/javascript">window.onload = function() {var heatmapContainer = document.querySelector('.heatmap');var heatmapInstance = h337.create({container: heatmapContainer,radius: 50});heatmapContainer.onmousemove = heatmapContainer.ontouchmove = function(e) {// we need preventDefault for the touchmovee.preventDefault();var x = e.layerX;var y = e.layerY;if (e.touches) {x = e.touches[0].pageX;y = e.touches[0].pageY;}heatmapInstance.addData({ x: x, y: y, value: 1 });};heatmapContainer.onclick = function(ev) {heatmapInstance.addData({x: ev.layerX, y: ev.layerY, value:1 });};};</script></body>
</html>

3.3 显示数值

在这里插入图片描述

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>HeadMap.js</title><!-- 动图效果样式 --><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/commons.css"><link rel="stylesheet" href="https://www.patrick-wied.at/static/heatmapjs/assets/css/example-commons.css"><!--Framework--><script src="js/heatmap.js" type="text/javascript"></script><style>.legend-area { position:absolute; bottom:0; right:0; padding:10px; background:white; outline:3px solid black; line-height:1em; }h4 { margin:0; padding:0; margin-bottom:5px;}#min { float:left; }#max { float:right; }span { font-size:14px; margin:0; padding:0; }.tooltip { position:absolute; left:0; top:0; background:rgba(0,0,0,.8); color:white; font-size:14px; padding:5px; line-height:18px; display:none;}.demo-wrapper { position:relative; }</style></head><body><h1>HeadMap</h1><div class="wrapper"><div class="demo-wrapper"><div class="heatmap" style="position: relative;"><canvas class="heatmap-canvas" width="834" height="400" style="position: absolute; left: 0px; top: 0px;"></canvas></div><div class="tooltip" style="display: none; transform: translate(538px, 377px);">633</div><div class="legend-area"><h4>Legend Title</h4><span id="min">0</span><span id="max">1224</span><img id="gradient" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAKCAYAAABCHPt+AAAAx0lEQVRYR+2WwQqDMBBEn2SF6P9/Z9tTFRSULVkIpdC0kBUxgTDZax4zsx1sG7WPrDDMECdXFVkYgAiuKjNwB27AI70L584HyOIKwsCLrK4gDLxMGQQFomAUiN4vcwNSwUF/AUmgGpDaQMwZheoDpF8gpg4ZkzrMGllj+nCNE70ec8gjqxCERZoPELlYhzyzrrDOKFQfIOqQA7asPhxT6uEUQBwi6rVdZZH4KbI81mBRIIVb1fvW1RxSodTP4ZCrRdaPZW6O2gEogeBRRgNVBwAAAABJRU5ErkJggg==" style="width:100%"></div></div><div class="demo-controls"><button class="trigger-refresh btn">re-generate data</button><br style="clear:both"></div></div><script type="text/javascript">window.onload = function() {function generateRandomData(len) {// generate some random datavar points = [];var max = 0;var min = 1234;var width = 840;var height = 400;while (len--) {var val = Math.floor(Math.random()*1234);max = Math.max(max, val);min = Math.min(min, val);var point = {x: Math.floor(Math.random()*width),y: Math.floor(Math.random()*height),value: val};points.push(point);}var data = { max: max, min:min, data: points };return data;};/*  legend code */// we want to display the gradient, so we have to draw itvar legendCanvas = document.createElement('canvas');legendCanvas.width = 100;legendCanvas.height = 10;var min = document.querySelector('#min');var max = document.querySelector('#max');var gradientImg = document.querySelector('#gradient');var legendCtx = legendCanvas.getContext('2d');var gradientCfg = {};function updateLegend(data) {// the onExtremaChange callback gives us min, max, and the gradientConfig// so we can update the legendmin.innerHTML = data.min;max.innerHTML = data.max;// regenerate gradient imageif (data.gradient != gradientCfg) {gradientCfg = data.gradient;var gradient = legendCtx.createLinearGradient(0, 0, 100, 1);for (var key in gradientCfg) {gradient.addColorStop(key, gradientCfg[key]);}legendCtx.fillStyle = gradient;legendCtx.fillRect(0, 0, 100, 10);gradientImg.src = legendCanvas.toDataURL();}};/* legend code end */var heatmapInstance = h337.create({container: document.querySelector('.heatmap'),onExtremaChange: function(data) {updateLegend(data);}});// generate 200 random datapointsvar data = generateRandomData(200);heatmapInstance.setData(data);var demoWrapper = document.querySelector('.demo-wrapper');var tooltip = document.querySelector('.tooltip');function updateTooltip(x, y, value) {// + 15 for distance to cursorvar transform = 'translate(' + (x + 15) + 'px, ' + (y + 15) + 'px)';tooltip.style.MozTransform = transform; /* Firefox */tooltip.style.msTransform = transform; /* IE (9+) - note ms is lowercase */tooltip.style.OTransform = transform; /* Opera */tooltip.style.WebkitTransform = transform; /* Safari and Chrome */tooltip.style.transform = transform; /* One day, my pretty */tooltip.innerHTML = value;}demoWrapper.onmousemove = function(ev) {var x = ev.layerX;var y = ev.layerY;var value = heatmapInstance.getValueAt({x: x,y: y});tooltip.style.display = 'block';updateTooltip(x, y, value);};demoWrapper.onmouseout = function() {tooltip.style.display = 'none';};document.querySelector('.trigger-refresh').onclick = function() {heatmapInstance.setData(generateRandomData(200));};};</script></body>
</html>

大致就是这样,今日学习完工! 😃

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/26821.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

可视化图形(二):热力图-imshow()

官方文档&#xff1a;https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imshow.html?highlightimshow#matplotlib.pyplot.imshow imshow(X, cmapNone, normNone, aspectNone, interpolationNone, alphaNone, vminNone, vmaxNone, originNone, extentNone, shapeNone, f…

网页点击热力图统计

热力图&#xff0c;要么对方填写button click的名字&#xff0c;对应后台&#xff08;类似事件&#xff09;&#xff0c;要么靠坐标系来做通用的&#xff0c;这里考虑通用做法&#xff0c;做起来也是一个通用服务。 另外&#xff0c;我这边没有调研怎么显示的&#xff0c;感觉开…

可视化神器Plotly绘制热力图

公众号&#xff1a;尤而小屋作者&#xff1a;Peter编辑&#xff1a;Peter 大家好&#xff0c;我是Peter~ 之前更新了很多关于Plotly绘图的文章。今天带来的文章是基于官网和实际案例来讲解如何绘制不同需求下的热力图。 Plotly中绘制热力图有3种方式&#xff1a;heatmap、ims…

pyecharts 画地图(热力图)(世界地图,省市地图,区县地图)

一、概述 在上一篇文章中&#xff0c;链接如下&#xff1a;https://www.cnblogs.com/xiao987334176/p/13791061.html 已经介绍了pyecharts画一些基本图形&#xff0c;接下来介绍画地图 二、世界地图 from pyecharts import options as opts from pyecharts.charts import Map f…

seaborn—sns.heatmap绘制热力图

heatmap(热力图)是识别预测变量与目标变量相关性的方法&#xff0c;同时&#xff0c;也是发现变量间是否存在多重共线性的好方法。 中文文档 seaborn.heatmap(data, vminNone, vmaxNone, cmapNone, centerNone, robustFalse, annotNone, fmt.2g, annot_kwsNone,linewidths0, …

Heatmap 热力图(1)

Heatmap 热力图&#xff08;1&#xff09; 显示多个对象&#xff0c;单个属性之间的关系的时候&#xff0c;用柱状图就可以直观的比较&#xff1b;当需要比较多个对象多个属性之间的差异时&#xff0c;需要用热力图。 基于R的heatmaply和plotly交互式热力图 安装&#xff1a;…

Tableau-热力图

Tableau-表格基础上制作热力图 前言1、度量维度制作热力图1.1 拖拽维度到行或者列1.2 拖拽度量1.3 标记度量数据为颜色 2、维度维度制作热力图2.1 拖拽两个维度分别当作行和列2.2 拖拽度量 前言 热力图的制作方便我们进行根据颜色的深浅直接观察&#xff0c;而颜色深浅又是由相…

【热力图】区域地图热力图,百度地图api

最简单的地图热力图&#xff0c;用的是百度的api&#xff0c;所以取经纬度的时候最好也用百度地图。 这里已经填好百度api的key了&#xff0c;但还是建议大家注册使用自己的key&#xff0c;因为有每日额度&#xff0c;超过访问次数了就不可用了。 <script type"text/…

python热力图实现

目录 一、数据无量纲化处理 (热力图) 1.数据无量纲化处理(仅介绍本文用到的方法):min-max归一化 2.代码展示 3.效果展示 二、皮尔斯系数相关(热力图) 1.数学知识 2.代码展示(有不懂的可以私聊) 3.seaborn.heatmap属性介绍 1&#xff09;Seaborn是基于matplotlib的Pyth…

一、python可视化——热力图

热力图 1、利用热力图可以看数据表里多个特征两两的相似度。参考官方API参数及地址&#xff1a; seaborn.heatmap(data, vminNone, vmaxNone,cmapNone, centerNone, robustFalse, annotNone, fmt’.2g’, annot_kwsNone,linewidths0, linecolor’white’, cbarTrue, cbar_kws…

(GIS可视化)热力图

我们经常在百度地图上看到类似这种的热力图&#xff0c;那么这种热力图究竟是什么原理&#xff1f;我们如何应用它来分析实际问题呢&#xff1f; 1.热力图原理 热力图这个名字可能听起来很高大上&#xff0c;但是实际上它等同于我们常说的密度图。 看到上面的图片你可能 会想…

echarts 热力图heatmap

1、配置data热力图主要通过颜色去表现数值的大小,必须要配合visualMap组件使用。可以应用在直角坐标系以及地理坐标系上直角坐标系上必须要使用两个类目轴。当坐标轴为直接坐标轴时,根据x、y轴每项数据相交形成的网格来进行定位,如x:[aa,bb],y:[cc,dd],(0,0)表示第一排第一个da…

热力图可视化 plt cmap

热力图可视化 import matplotlib.pyplot as plt plt.imsave(savename, data, vmin0, vmaxdata_max, cmapturbo)cmap 的其它选择&#xff08;如 magma&#xff0c;jet&#xff09;&#xff1a; 其中cmap"jet"结果类似如下&#xff1a;

热力图 sns.heatmap 调整 图内,坐标轴,color bar 字体大小

原始 首先准备一个文件&#xff0c;我用的是csv文件 我们先看一下最原始的效果&#xff1a; 代码为&#xff1a; student pd.read_csv(./input/small_data.csv) plt.figure(figsize(25, 10)) sns.heatmap(student.corr(), annotTrue, cmapYlGnBu) plt.savefig(relevance.pn…

Origin制图之热力图(hot-map)

软件版本&#xff1a;origin 2022&#xff0c;下载链接在博主的其他文章中查看。 1.首先是数据&#xff0c;第一列为x的标签&#xff0c;可以是数值也可以是本文&#xff0c;本测试用test代替。其余为热力图数据数值。除此以外还需要Y标签或者数值。 2.按如图所示&#xff0c;拷…

热力图heatmap

这个方法又称Class Activation Map(CAM类激活映射)&#xff0c;由于这是基于分类问题的一种可视化技术&#xff0c;并且只有将全连接层改为全局平均池化才能较好的保存图像的空间信息&#xff0c;这对于训练是不利的。2017年提出了Grad-CAM&#xff0c;可以在不改变网络结构的情…

heatmap热力图

heatmap 热力图 热力图在实际中常用于展示一组变量的相关系数矩阵&#xff0c;在展示列联表的数据分布上也有较大的用途&#xff0c;通过热力图我们可以非常直观地感受到数值大小的差异状况。heatmap的API如下所示&#xff1a; 下面将演示这些主要参数的用法&#xff0c;第一件…

即时聊天系统(IM)发送文件语音视频的两种方式比较

一般情况发送消息&#xff0c;把消息通过流发送给接收方{"MessageBody": "消息内容"}&#xff0c;但是作为聊天系统这样发送消息存在两个问题&#xff1a;1&#xff0c;接收方不知道如何解析消息&#xff0c;消息是文本还是图片&#xff0c;语音&#xff0…

用腾讯即时通讯IM和实时音视频实现陪玩系统源码的语音通话功能

在陪玩系统源码中&#xff0c;用户之间主要的交流方式就是语音通话&#xff0c;实时互动性的语音通话能让人产生面对面交谈的感觉&#xff0c;所以在陪玩系统源码中&#xff0c;语音通话功能的开发非常重要&#xff0c;今天我们就一起来看看如何用腾讯即时通讯IM和实时音视频实…

Windows实时视频通话功能实现流程(实时视频系列四)

实时视频通话系列第四篇。上一篇我们介绍了在Windows环境下如何集成即构音视频SDK&#xff0c;回顾《Windows实时视频通话SDK集成指引》&#xff0c;这一篇将介绍视频直播功能实现流程。 还是以 2 人间的实时视频为例&#xff0c;主要流程如下&#xff1a; 请注意&#xff…