Heatmap Color Scales
How do I make an heatmap color scales?
What is a heatmap color scales? How do you make a heatmap color scales? This script and codes were developed by Steve Pepple on 22 June 2022, Wednesday.
Heatmap Color Scales - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Heatmap Color Scales</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<p>Spectral Scale</p>
<p class="small">Red to Blue diverging scale</p>
<div id="scale1" class="scale"></div>
<p>Pink Scale</p>
<p class="small">Pink to Green diverging scale</p>
<div id="pink" class="scale"></div>
<p>Pink Scale</p>
<p class="small">Pink to Green diverging scale</p>
<div id="green" class="scale"></div>
<p>Bi-variant Scale</p>
<p class="small">Blend Pink and Green Scale</p>
<div id="bivar" class="scale"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.1.1/chroma.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Heatmap Color Scales - Script Codes CSS Codes
body { background: #F7F7F7; font-family: Helvetica; padding-left: 30px; margin:0px; }
p { color: #222; clear: left; padding-top: 12px; margin-bottom: 8px; font-weight: 200; font-size: 1.2em }
p.small { color: #444; font-size: 0.9em; padding-top: 0px; margin-top:0px; }
.scale { margin-bottom: 2vm;}
.color { float:left; margin-right: 1vw;
}
Heatmap Color Scales - Script Codes JS Codes
scale = d3.scale.linear();
// PRGn: Purple to Green
// BrBG: Brown to Blue
var scale1 = chroma_scale(12, chroma.scale("Spectral"));
showColors("scale1", scale1)
var pink = chroma_scale(12, chroma.scale("PuRd"));
showColors("pink", pink)
var green = chroma_scale(12, chroma.scale("BuGn"));
showColors("green", green)
var bivar = [];
for (i = 0; i < pink.length; i++) { console.log(pink[i]) var blended = chroma.blend(green[i].hex(), pink[i].hex(), 'darken'); bivar.push(blended); console.log(blended)
}
showColors("bivar", bivar)
function showColors(id, colors) { var box = $("#" + id); _.each(colors, function(color) { var item = $("<div class='color'>"); item.css("background", color.hex()) item.css("height", "4vw"); item.css("width", "4vw") box.append(item) });
}
function chroma_scale(length, chroma_scale) { var colors = []; scale.domain([1, length]) var color_scale = chroma.scale(); for (var i = 1; i <= length; i++) { var val = scale(i) colors.push(chroma_scale(val)); } return colors;
}

Developer | Steve Pepple |
Username | stevepepple |
Uploaded | June 22, 2022 |
Rating | 3 |
Size | 2,331 Kb |
Views | 82,943 |
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 |
Geofence Example | 9,902 Kb |
LA Point-of-Interest Analysis | 4,323 Kb |
Population Density by County | 3,520 Kb |
3D Map Sphere using Three.js | 2,743 Kb |
Data Canvas Realtime Neighborhood Sensors | 7,742 Kb |
Oakland Instagram Colors | 2,966 Kb |
Bay Area Bus Stops and Businesses | 1,869 Kb |
Heat Map of LA POIs | 2,681 Kb |
Bay Area Example of ViziCities | 2,654 Kb |
Isometric Treemap Visualization of Money Allocation | 3,403 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 |
Responsive Section hover effect to show content | Berdejitendra | 2,540 Kb |
Birthday Party Starter | Aussieyang | 1,629 Kb |
Wikipedia Viewer | Thalpha | 4,426 Kb |
Scroll using CSS | Casperovic | 2,159 Kb |
A Pen by Shidhin | Shidhincr | 5,015 Kb |
Draggables in pure angular | Rlo206 | 5,167 Kb |
Template | Indra_z85 | 2,323 Kb |
Content Changer | Cliffpyles | 4,538 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
Text Looping Transition | Agelber | 5,619 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!