用Vue3和uPlot绘制一个交互式3D图

使用 uPlot 在 Vue 中创建交互式图表 uPlot 是一个轻量级、高性能的图表库,适用于创建各种交互式图表。它具有丰富的功能,包括可自定义的轴、网格、刻度和交互性。本篇博客将介绍如何使用 uPlot 在 Vue 中创建交互式图表。本例代码展示了如何使用 uPlot 创建一个带有网格、轴和多个系列的交互式折线图。用户可以与图表进行交互,例如缩放、平移和悬停以查看数据点的详细信息。通过本例代码,我们展示了如何使用 uPlot 在 Vue 中创建交互式图表。uPlot 提供了丰富的功能和高度的可定制性,使我们能够创建各种类型的图表。 阅读详情

Alt

本文由ScriptEcho平台提供技术支持

项目地址:传送门

基于 uPlot.js 的交互式图表开发

应用场景

uPlot.js 是一款轻量级、可定制的图表库,可用于创建交互式图表,在数据可视化和分析应用中广泛应用。

基本功能

此代码演示了如何使用 uPlot.js 创建一个交互式图表,其中包含以下功能:

  • 动态数据生成
  • 自定义轴范围和标签
  • 可定制的系列和颜色

功能实现步骤及关键代码分析

1. 数据生成

首先,getData() 函数生成了一组数据,其中 x 轴的值从 0 到 500000,y 轴的值由 f() 函数计算。

function getData(max) {
   
   
  const data = [Array(loop), Array(loop)]

  for (let x = 0; x 
ThreeJS之3D柱形图 学习threejs第二篇,3D柱形图练习,本文参考了网上的实现方式,用html方式进行了实现。通过对数据源的循环,以此生成矩形图,图表使用顶点颜色,同时设置材料的vertexColors属性。此处box1.addAttribute,与threejs的版本有关,新版本中移除了该方法。柱形图分为上下两部分,因此使用了二维数组,表示上半部分和下半部分。 阅读详情

相关推荐

Chart.js实战:表格数据快速可视化,超轻量图表工具全解析

数据可视化是数据分析与前端开发中的高频需求,其核心是将结构化表格数据转换为直观的图表,以便快速洞察趋势与异常。实现方式上,从Excel原生图表到重量级BI工具,再到基于Canvas渲染的轻量级前端库,各有适用场景。Chart.js作为一款超轻量图表工具,凭借不足百KB的体积、极低的学习成本和灵活的配置能力,成为中小项目与日常报表的优选方案。它通过将表格中的行与列映射为图表所需的labels和datasets数据结构,支持柱状图、折线图、饼图等多种类型,并可在浏览器中直接渲染。实际工程中,需重点处理表格数据清

congji3817的博客 621

uplot

用于绘制的通用软件包 请注意,此程序包仍在开发中1.0版将是第一个主要版本在此之前,请考虑此代码易变 但是,只需调用pip install uplot即可进行pip install uplot

uPlot::chart_increasing:一个小的,快速的图表,用于显示时间序列,线,面,ohlc和条形图

:chart_increasing: μ图 小型(〜30 )图表,用于显示时间序列,线,面,欧姆和条形图(麻省理工学院许可) 介绍 μPlot是基于的图表,可绘制,线条,面积,OHLC和条形图; 从冷启动开始,它可以创建一个交互式图表,在135ms内包含150,000个数据点,线性缩放比例 。 除了快速的初始渲染外,缩放和光标性能是所有类似制图库中最好的。 它的大小约为30 KB,可能是最小且最快的时间序列绘图仪,它没有使用WebGL着色器或WASM,这两种绘图器的启动成本和代码大小都高得多。 166,650点长凳: ://leeoniya.github.io/uPlot/bench/uPlot.html 但是,如果您需要

uPlot-lazy-interface:uPlot界面简化了基本图表的绘制

uPlot惰性接口 的简化界面,轻量级( ),超快速(检查基准)图表库。 uPlot是一个很好的库,可以可视化时间序列数据,但是由于许多设置选项和旨在优化性能的界面,因此入门可能会有些复杂。 如果您不需要调整图表的最后一个细节,而只想快速绘制一些具有合理默认值的基本点,线或条形图,那么“ uPlot-lazy”(〜5KB)是正确的扩展你 ;-)。 快速开始 首先包含uPlot库,然后像这样添加uPlot-lazy: [removed][removed] <link rel="stylesheet" href="uPlot.min.css"> [removed][removed] 所有“懒惰”接口都可以通过以下uPlot.lazy获得: uPlot.lazy 。 要使用默认设置(通过直线连接的点

Apache Paimon快照管理实战:如何避免Flink作业中的反压问题?

本文深入探讨了如何通过优化Apache Paimon的快照管理机制来避免Flink作业中的反压问题。详细解析了同步与异步快照过期模式的适用场景及配置建议,并提供了Checkpoint策略与状态后端的协同优化方案,帮助提升实时数据处理的性能和稳定性。

i1j2k的博客 179

【XR技术介绍】深度解析|AI眼镜核心技术架构:从硬件层到端云AI全链路拆解

本文将逐层拆解AI眼镜完整技术架构,梳理硬件、感知、光学、端侧AI、软件云端五大核心层级,剖析核心数据流与行业技术瓶颈,同时附上标准化技术架构图,适合技术学习、方案汇报、行业科普使用。

houdou112358的博客 468

飞书多维表格+影刀RPA:我如何用3个指令搞定每周的销售数据自动汇总(附完整配置截图)

本文详细介绍了如何利用飞书多维表格和影刀RPA实现销售数据的自动化汇总,通过三个核心指令(建立链接、列出记录、更新记录)简化繁琐的手工操作。文章包含完整的配置截图和实战指南,帮助用户快速部署自动化流程,提升工作效率。

weixin_29273849的博客 290

3D医学影像分割实战:从数据预处理到模型训练全流程解析

本文详细解析了3D医学影像分割的全流程,从数据预处理到模型训练,重点介绍了nnUNet框架的应用技巧。通过实战案例,帮助开发者掌握如何处理复杂的.nii.gz文件格式、优化数据预处理流程以及高效训练3D分割模型,特别适合医学影像分析领域的从业者参考。

weixin_29098367的博客 228

23、关联挖掘到相关性分析及约束关联挖掘详解

本文详细解析了从关联挖掘到相关性分析的发展过程,以及基于约束的关联挖掘方法。文章介绍了传统支持-置信度框架的局限性,并引入Lift、χ2、All Confidence和Cosine等度量来评估规则的相关性。同时探讨了多种规则约束在数据挖掘中的应用机制及其优化效果,旨在提高挖掘效率和规则质量。最后结合实际案例说明如何综合运用相关性度量与规则约束以满足业务需求,并展望了数据挖掘技术的未来发展。

aa123的博客 109

ubuntu20 安装px4、mavros、QGroundControl

首先安装一下ant,否则没法运行,同时因20.04的缺少动态库libawt_xawt.so无法被Java8给调用,我的解决办法是去18.04把18.04的相同路径下的动态库libawt_xawt.so移动到20.04的/usr/lib/jvm/java-11-openjdk-amd64/lib/路径中。用rosdepc的时候,你得确保你用的是鱼香ROS的提供的ROS安装方法,否则是没有rosdepc的。make px4_sitl gazebo之前,可以安装一下gazebo的 模型。二、安装MAVROS。

qq_58060770的博客 3354

老电脑续命神器:Windows 11 26H1 精简游戏版,帧率稳定无压力!(Win11 26H1 极致精简游戏版(3.17G):装完只占 8G 内存,Ultra CPU 性能拉满)

旧电脑福音也能安装windows11畅玩游戏🎮:文章分享一款 Windows 11 26H1 精简游戏版,仅 3.17G、C 盘占用 8G,开机进程约 50 个,内存占用 1.4G,内置游戏优化与运行库,支持离线安装、跳过 TPM 检测,让老电脑也能畅玩 3A 游戏和办公娱乐 🚀。

XiaoqiangClub的博客 1125

arkts编译报错-arkts-limited-stdlib错误【Bug已完美解决-鸿蒙开发】

在使用 Deveco Studio 4.0 beta2 开发应用时,报错。ERROR: ArkTS:ERROR File: D:/prRevivw/3792/applications_appsamgCSDNo”见台难忘Usage of standardlibrary is restricted (arkts-limited-stdlib)这是 ArkTS 新增的语法规则。

一键难忘的博客 3787

InTheHand.Net.Personal+BlueTooth4,蓝牙开发

项目中有蓝牙开发的必备dll,现在网上相关的文档博客不少,有的说的多有的说少,但是却很少有这两个dll,分享一下。

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 使用AntV L7的地图数据可视化之基础图层渲染
下一篇: 用Vue3和Two.js打造一个炫酷的3D图像展示
ScriptEcho
博客等级 码龄3年 1304粉丝 150原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址