{"id":25983,"date":"2025-06-12T12:23:38","date_gmt":"2025-06-12T19:23:38","guid":{"rendered":"https:\/\/tdengine.com\/?p=25983"},"modified":"2025-09-08T16:36:25","modified_gmt":"2025-09-08T23:36:25","slug":"integrate-tdengine-with-perspective","status":"publish","type":"post","link":"https:\/\/tdengine.com\/integrate-tdengine-with-perspective\/","title":{"rendered":"Integrate TDengine with Perspective"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #141414;color:#141414\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #141414;color:#141414\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/tdengine.com\/integrate-tdengine-with-perspective\/#Video\" >Video<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/tdengine.com\/integrate-tdengine-with-perspective\/#TDengine%E2%80%93Perspective_Demo\" >TDengine&#8211;Perspective Demo<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/tdengine.com\/integrate-tdengine-with-perspective\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/tdengine.com\/integrate-tdengine-with-perspective\/#Procedure\" >Procedure<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>This article demonstrates how to integrate TDengine with Perspective for real-time stream analytics.<\/p>\n\n\n\n<h2 class=\"gb-text\"><span class=\"ez-toc-section\" id=\"Video\"><\/span>Video<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"gb-element-401cdf9e\">\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"Real-Time Stream Analytics with TDengine and Prospective\" width=\"1200\" height=\"675\" src=\"https:\/\/www.youtube.com\/embed\/I8xURVRgGZM?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n<\/div>\n\n\n\n<h2 class=\"gb-text\"><span class=\"ez-toc-section\" id=\"TDengine%E2%80%93Perspective_Demo\"><\/span>TDengine&#8211;Perspective Demo<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can explore the visualization options provided by Perspective in this demonstration environment.<\/p>\n\n\n\n<figure class=\"gb-element-2367a8d5\">\n<img decoding=\"async\" width=\"3080\" height=\"1668\" class=\"gb-media-238927c3\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&sharp=1\" alt=\"\" title=\"new-pros-flow\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1 3080w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1-300x162.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1-1024x555.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1-768x416.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1-1536x832.png?strip=all&amp;sharp=1 1536w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1-2048x1109.png?strip=all&amp;sharp=1 2048w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=616 616w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=1232 1232w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=1848 1848w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=2464 2464w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=450 450w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/new-pros-flow-1.png?strip=all&amp;sharp=1&amp;w=1920 1920w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n\n\n\n<figcaption class=\"gb-text\">Ingestion and visualization workflows in the demo environment<\/figcaption>\n<\/figure>\n\n\n\n<h3 class=\"gb-text\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Git. For more information, see <a href=\"https:\/\/git-scm.com\/\" rel=\"noopener\">the official website<\/a>.<\/li>\n\n\n\n<li>Install Docker. For more information, see <a href=\"https:\/\/www.docker.com\/\" rel=\"noopener\">the official website<\/a>.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"gb-text\"><span class=\"ez-toc-section\" id=\"Procedure\"><\/span>Procedure<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol>\n<li>\n<p>Clone the <code class=\"\" data-line=\"\">perspective-examples<\/code> repository from GitHub to your local machine and open the <code class=\"\" data-line=\"\">examples\/tdengine\/node<\/code> directory.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">git clone https:\/\/github.com\/ProspectiveCo\/perspective-examples\ncd examples\/tdengine\/node<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Run the provided script to start TDengine in a Docker container:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">.\/docker.sh<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Install Node.js dependencies:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">npm install<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Run the producer script to create a database and table in TDengine and insert simulated data in real time:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">node src\/producer.js<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Run the server script to construct a Perspective WebSocket server and a Perspective table:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">node src\/server.js<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Host the Perspective front-end with Vite.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-bash\" data-line=\"\">npm run dev<\/code><\/pre>\n<\/li>\n\n\n\n<li>\n<p>Open the URL of the Vite development server in a web browser. The default URL is <code class=\"\" data-line=\"\">http:\/\/localhost:3000<\/code>.<\/p>\n<\/li>\n<\/ol>\n\n\n\n<p>You can now visualize the sample data in your browser as shown in the following figure.<\/p>\n\n\n\n<img decoding=\"async\" width=\"1537\" height=\"1185\" class=\"gb-media-7920b372\" alt=\"\" src=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&sharp=1\" title=\"perspective-screen\" srcset=\"https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&amp;sharp=1 1537w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen-300x231.png?strip=all&amp;sharp=1 300w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen-1024x789.png?strip=all&amp;sharp=1 1024w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen-768x592.png?strip=all&amp;sharp=1 768w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&amp;sharp=1&amp;w=614 614w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&amp;sharp=1&amp;w=922 922w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&amp;sharp=1&amp;w=1229 1229w, https:\/\/eujqw4hwudm.exactdn.com\/wp-content\/uploads\/perspective-screen.png?strip=all&amp;sharp=1&amp;w=450 450w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/>\n","protected":false},"excerpt":{"rendered":"<p>This article demonstrates how to integrate TDengine with Perspective for real-time stream analytics.<\/p>\n","protected":false},"author":102,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[21],"tags":[],"ppma_author":[181],"class_list":["post-25983","post","type-post","status-publish","format-standard","hentry","category-engineering"],"authors":[{"term_id":181,"user_id":102,"is_guest":0,"slug":"tdengine-team","display_name":"TDengine Team","avatar_url":{"url":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-01-tdengine.png","url2x":"https:\/\/tdengine.com\/wp-content\/uploads\/29.03-01-tdengine.png"},"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/25983","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/users\/102"}],"replies":[{"embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/comments?post=25983"}],"version-history":[{"count":2,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/25983\/revisions"}],"predecessor-version":[{"id":25988,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/posts\/25983\/revisions\/25988"}],"wp:attachment":[{"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/media?parent=25983"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/categories?post=25983"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/tags?post=25983"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/tdengine.com\/wp-json\/wp\/v2\/ppma_author?post=25983"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}