mode / alamode

A community-maintained library of visualizations for Mode reports
MIT License
70 stars 67 forks source link

Added alamode.heatmapOverlay. #50

Open nemo opened 4 years ago

nemo commented 4 years ago

I've added an easier way to create heatmaps over existing tables. At the moment, only conditional formatting is supported.

This adds the ability to not have to know the values of the columns ahead of time. It does calculations on the fly and draws conditional formatting over an existing visualization.

Usage

<link rel="stylesheet" href="https://mode.github.io/alamode/alamode.min.css">
<script src="https://mode.github.io/alamode/alamode.min.js"></script>
<script src="https://d3js.org/d3-array.v2.min.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-format.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-time.v1.min.js"></script>
<script src="https://d3js.org/d3-time-format.v2.min.js"></script>
<script src="https://d3js.org/d3-scale.v3.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>

alamode.heatmapOverlay({
  vizId: '7768b0513c06',
  queryToken: '477b62404580',
  columns: ['CTR_Day_1', 'Sign_Up_CVR_Day_1', 'CP_Sign_Up_Day_1']
});
nemo commented 4 years ago

cc @leqilong / @anthonysimone – let me know if you're accepting PRs from outsiders on this! Trying to avoid having to copy-paste this function into all our reports 😂