
Security News
Node.js TSC Declines to Endorse Feature Bounty Program
The Node.js TSC opted not to endorse a feature bounty program, citing concerns about incentives, governance, and project neutrality.
bootstrap-vue-heatmap
Advanced tools
A simple heatmap component based on Bootstrap-Vue tables (a.k.a, b-table
).
This component implements the heatmap as a table because of the flexibility and intuitive interaction. Other libraries implement heatmap more chart-like, e.g., E-charts heatmap, which doesn't have many built-in interactions (e.g., sorting), and we have to code them by hand.
Based on b-table
, the heatmap comes with flexible options out of the box:
npm i bootstrap-vue-heatmap
# if you use yarn:
yarn add bootstrap-vue-heatmap
<script>
import Vue from 'vue';
import BootstrapVueHeatmap from '@/bootstrap-vue-heatmap.vue';
import { BCard } from 'bootstrap-vue'
Vue.component('b-card', BCard)
// Uncomment the following to import BootstrapVue CSS files if you
// have not done so when registering BootstrapVue. Order is important.
// Check out: https://bootstrap-vue.org/docs#using-module-bundlers
// import 'bootstrap/dist/css/bootstrap.min.css'
// import 'bootstrap-vue/dist/bootstrap-vue.css'
const Cities = [
'Berkeley',
'Mexico City',
'Mumbai',
'New York',
'Shanghai',
'Tokyo',
'Toronto'
];
export default Vue.extend({
name: 'ServeDev',
components: {
BootstrapVueHeatmap
},
data() {
return {
nonNumericFields: ['City'],
numericFields: [
'2021-06-27 8:00',
'2021-06-27 8:10',
'2021-06-27 8:20',
'2021-06-27 8:30',
'2021-06-27 8:40',
'2021-06-27 8:50',
'2021-06-27 9:00'
],
data: Cities.map(city => ({
City: city,
'2021-06-27 8:00': Math.floor(Math.random() * 9),
'2021-06-27 8:10': Math.floor(Math.random() * 9),
'2021-06-27 8:20': Math.floor(Math.random() * 9),
'2021-06-27 8:30': Math.floor(Math.random() * 9),
'2021-06-27 8:40': Math.floor(Math.random() * 9),
'2021-06-27 8:50': Math.floor(Math.random() * 9),
'2021-06-27 9:00': Math.floor(Math.random() * 9)
}))
}
}
});
</script>
<template>
<div id="app">
<b-card
title="Heatmap"
>
<bootstrap-vue-heatmap
:non-numeric-fields="nonNumericFields"
:numeric-fields="numericFields"
:data="data"
/>
</b-card>
</div>
</template>
Low
, Medium
, High
)
data
propsName | Type | Description |
---|---|---|
non-numeric-fields | Array | A list of non-numeric fields (strings). These columns will not be color-coded. |
numeric-fields | Array | A list of numeric fields (strings). These columns will be color-coded. |
data | Array | A list of data objects. The keys of each object should be either a numeric or non-numeric field. |
compact | Boolean | A flag to indicate if the heatmap is rendering in compact mode. It allows the heatmap to show more data with less horizontal span. |
sticky-fields | Array | A list of fields that are stick to the left of the heatmap when the heatmap has a horizontal scrollbar. |
fixed-decimal-places | Number | Boolean | Formats a the numermic cells using Javascript fixed-point notation. If passed in as a number, it denotes the number of decimal places to display. |
Install dependencies:
yarn install --dev
Build component:
yarn build
Run example app locally:
yarn serve
Lints and fixes files:
yarn lint
Generate component documentation:
yarn doc src/bootstrap-vue-heatmap.vue
Released under the MIT License. Copyright (c) Bootstrap-vue-heatmap.
FAQs
A simple heatmap component based on Bootstrap-Vue
The npm package bootstrap-vue-heatmap receives a total of 2 weekly downloads. As such, bootstrap-vue-heatmap popularity was classified as not popular.
We found that bootstrap-vue-heatmap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Node.js TSC opted not to endorse a feature bounty program, citing concerns about incentives, governance, and project neutrality.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.