3D Axis Data Visualizer Thingy
How do I make an 3d axis data visualizer thingy?
We were going to use this on an internal project but it got canned. Might be useful for some type of data viz project.. What is a 3d axis data visualizer thingy? How do you make a 3d axis data visualizer thingy? This script and codes were developed by Peter Hrynkow on 14 September 2022, Wednesday.
3D Axis Data Visualizer Thingy - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>3D Axis Data Visualizer Thingy</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="viewport"> <div class="model"> <ul class="axis"> <li class="plane x"> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <span class="label unselectable left">Min</span> <span class="label unselectable right">Max</span> </li> <li class="plane y"> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <span class="label unselectable left">Min</span> <span class="label unselectable right">Max</span> </li> <li class="plane z"> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <div class="poly"></div> <span class="label unselectable left">Min</span> <span class="label unselectable right">Max</span> </li> </ul> <ul class="cube bounds"> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> <li class="side"> <ul> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> <li class="poly"></li> </ul> </li> </ul> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
3D Axis Data Visualizer Thingy - Script Codes CSS Codes
html, body
{ width: 100%; height: 100%;
}
.container
{ width: 100%; height: 100%;
}
.unselectable
{ -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; user-select: none;
}
.viewport
{ width: 100%; height: 100%; position: relative; -webkit-transform-style: preserve-3d; -webkit-perspective: 900; -webkit-perspective-origin: 50% 20%; cursor: move;
}
.viewport *
{ -webkit-transform-style: preserve-3d; -webkit-backface-visibility: visible; margin: 0;
}
.model
{ top: 50%; left: 50%; position: absolute;
}
.poly { position: absolute; }
.plane { position: absolute; }
.plane .poly
{ width: 248px; height: 248px; border: 1px solid rgba(0,0,0,0.8);
}
.plane .poly:nth-child(1) { -webkit-transform: translate3d(0,0,0); }
.plane .poly:nth-child(2) { -webkit-transform: translate3d(0,-250px,0); }
.plane .poly:nth-child(3) { -webkit-transform: translate3d(-250px,-250px,0); }
.plane .poly:nth-child(4) { -webkit-transform: translate3d(-250px,0,0); }
.x { -webkit-transform: rotateX(90deg); }
.x .poly
{ background: #ffcccc; opacity: 0.2;
}
.y { -webkit-transform: rotateZ(90deg); }
.y .poly
{ background: #ccffcc; opacity: 0.2;
}
.z { -webkit-transform: rotateY(90deg); }
.z .poly
{ background: #ccccff; opacity: 0.2;
}
.plane .label
{ position: absolute; top: -8px; left: 260px;
}
.plane .label.right
{ left: auto; right: 260px;
}
.cube
{ position: absolute; width: 100px; height: 100px; -webkit-transform-origin: 0 0 0; -webkit-transition: all 0.5s;
}
.cube .side:nth-child(1) { -webkit-transform: translate3d(0, 0, 50px); }
.cube .side:nth-child(2) { -webkit-transform: translate3d(0, 0, -50px); }
.cube .side:nth-child(3) { -webkit-transform: translate3d(0, 0, -50px) rotateY(90deg); }
.cube .side:nth-child(4) { -webkit-transform: translate3d(-100px, 0, -50px) rotateY(90deg); }
.cube .side:nth-child(5) { -webkit-transform: translate3d(0, -50px, 0) rotateX(90deg); }
.cube .side:nth-child(6) { -webkit-transform: translate3d(0, 50px, 0) rotateX(90deg); }
.cube .poly
{ opacity: 1; width: 50px; height: 50px; background-color: #333;
}
.cube .poly:nth-child(1) { -webkit-transform: translate3d(-50px, -50px, 0); }
.cube .poly:nth-child(2) { -webkit-transform: translate3d(0, -50px, 0); }
.cube .poly:nth-child(3) { -webkit-transform: translate3d(-50px, 0, 0); }
.cube .poly:nth-child(4) { -webkit-transform: translate3d(0, 0, 0); }
3D Axis Data Visualizer Thingy - Script Codes JS Codes
$(document).ready(function(){ var mouseStartX, mouseStartY, rotX = 0, rotY = 0, rotStartX, rotStartY, viewport = $('.viewport'), win = $(window), model = $('.model'); viewport.mousedown(startDrag); viewport.get(0).addEventListener('touchstart', startDrag, false); viewport.get(0).addEventListener('touchend', stopDrag, false); win.mouseup(function(){ stopDrag(); console.log('mouse up') }) function startDrag(event) { mouseStartX = event.pageX mouseStartY = event.pageY rotStartX = rotX; rotStartY = rotY; win.mousemove(drag); win.get(0).addEventListener('touchmove', drag, false); } function drag(event) { rotX = rotStartX + ( ( mouseStartY - event.pageY ) / viewport.outerWidth() * 180 ) rotY = rotStartY - ( ( mouseStartX - event.pageX ) / viewport.outerWidth() * 180 ) model.css('webkitTransform', 'rotateX(' + rotX + 'deg) rotateY(' + rotY + 'deg)'); event.preventDefault(); event.stopPropagation(); return false; } function stopDrag() { win.unbind('mousemove'); win.get(0).removeEventListener('touchmove', drag, false); } });
Developer | Peter Hrynkow |
Username | peterhry |
Uploaded | September 14, 2022 |
Rating | 3 |
Size | 2,847 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Holographic Projection | 7,177 Kb |
CSS Starbursts | 2,605 Kb |
3D Message Flipper | 2,651 Kb |
Mobile Navigation for Big Phones | 5,830 Kb |
Curved type with SVG | 2,922 Kb |
3D Axis Data Visualizer Thingy | 2,847 Kb |
Rolldown List | 3,158 Kb |
Simple scroll prompt | 2,480 Kb |
Cross-browser vertical centering without Javascript and almost no CSS. | 1,800 Kb |
Hardward Accelerate Mask Reveal | 2,083 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Weather App 2 | MightyJoeW | 2,877 Kb |
A vuejs widget | Chrgl86 | 2,869 Kb |
Playing with transition timing | Mattgrosswork | 1,993 Kb |
Twitch | SarahDunlap | 2,937 Kb |
CSS Tooltips | Darylldoyle | 2,599 Kb |
React Vote Component | Souporserious | 5,465 Kb |
Fixed Scrolling Nav Bar | Philsinatra | 0 Kb |
Weather App | Kw7oe | 3,162 Kb |
Process Accordion | Devilskitchen | 31,432 Kb |
Layout | X-gyba | 4,234 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!