- Install using npm:
npm install CorpGlory/vue-heatmap-component
- Import the component:
import VueHeatmapComponent from 'vue-heatmap-component';
- Register the component globally or in a separate component
<template>
<vue-heatmap-component
:data="[
{ x: 'x1', y: 'y1', value: 10 },
{ x: 'x1', y: 'y2', value: 60 },
{ x: 'x2', y: 'y1', value: 30 },
{ x: 'x2', y: 'y2', value: 100 },
]"
:axisX=['x1', 'x2']
:axisY=['y1', 'y2']
/>
</template>
...
Result:
data
— (required) NxN-sized array of values, e.g:
:data=[
{ x: 'x1', y: 'y1', value: 10 },
{ x: 'x1', y: 'y2', value: 60 },
{ x: 'x2', y: 'y1', value: 30 },
{ x: 'x2', y: 'y2', value: 100 },
]
axisX
— (required) array of x-axis variables, e.g:
:axisX=['x1', 'x2']
axisY
- (required) array of y-axis variables, e.g:
:axisY=['y1', 'y2']
npm install
npm run serve
npm run build